Heads Up: <inject_html> was replaced with <inject_script>

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Heads Up: <inject_html> was replaced with <inject_script>

yishayw

Hi,

 

A heads-up in case your application uses <inject_html>. Due to a bug [1] that was found when loading modules on IE <inject_html> was deprecated in favor of <inject_script>. So if you’ve used <inject_html> to add html elements to your application, please convert it to add js instead.

 

For example,

 

 

         * <inject_html>

         * <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>

         * <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css">

         * </inject_html>

 

Should be converted to be

 

         * <inject_script>

         * var script = document.createElement("script");

         * script.setAttribute("src", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js");

                                * document.head.appendChild(script);

         * var link = document.createElement("link");

         * link.setAttribute("rel", "stylesheet");

         * link.setAttribute("type", "text/css");

         * link.setAttribute("href", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css");

         * document.head.appendChild(link);

         * </inject_script>

 

Thanks,

Yishay

 

[1] https://github.com/apache/royale-asjs/issues/826

 

Reply | Threaded
Open this post in threaded view
|

Re: Heads Up: <inject_html> was replaced with <inject_script>

Carlos Rovira-2
Hi Yishay,

I'm seeing in TDJ this error when running:

ReferenceError: dialogPolyfill is not defined
    at /Users/carlosrovira/Dev/Royale/Source/royale-asjs/examples/jewel/TourDeJewel/target/javascript/bin/js-debug/App.js:10:1

Although Alert seems to work. Maybe dialogPolyfill is not needed anymore?

How can that error be removed?



El vie., 15 may. 2020 a las 17:26, Yishay Weiss (<[hidden email]>) escribió:

Hi,

 

A heads-up in case your application uses <inject_html>. Due to a bug [1] that was found when loading modules on IE <inject_html> was deprecated in favor of <inject_script>. So if you’ve used <inject_html> to add html elements to your application, please convert it to add js instead.

 

For example,

 

 

         * <inject_html>

         * <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>

         * <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css">

         * </inject_html>

 

Should be converted to be

 

         * <inject_script>

         * var script = document.createElement("script");

         * script.setAttribute("src", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js");

                                * document.head.appendChild(script);

         * var link = document.createElement("link");

         * link.setAttribute("rel", "stylesheet");

         * link.setAttribute("type", "text/css");

         * link.setAttribute("href", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css");

         * document.head.appendChild(link);

         * </inject_script>

 

Thanks,

Yishay

 

[1] https://github.com/apache/royale-asjs/issues/826

 



--
Reply | Threaded
Open this post in threaded view
|

RE: Heads Up: <inject_html> was replaced with <inject_script>

yishayw

Are you sure you updated both the compiler and asjs? I did test Alert.

 


From: Carlos Rovira <[hidden email]>
Sent: Saturday, May 16, 2020 12:50:43 PM
To: [hidden email] <[hidden email]>
Subject: Re: Heads Up: <inject_html> was replaced with <inject_script>
 
Hi Yishay,

I'm seeing in TDJ this error when running:

ReferenceError: dialogPolyfill is not defined
    at /Users/carlosrovira/Dev/Royale/Source/royale-asjs/examples/jewel/TourDeJewel/target/javascript/bin/js-debug/App.js:10:1

Although Alert seems to work. Maybe dialogPolyfill is not needed anymore?

How can that error be removed?



El vie., 15 may. 2020 a las 17:26, Yishay Weiss (<[hidden email]>) escribió:

Hi,

 

A heads-up in case your application uses <inject_html>. Due to a bug [1] that was found when loading modules on IE <inject_html> was deprecated in favor of <inject_script>. So if you’ve used <inject_html> to add html elements to your application, please convert it to add js instead.

 

For example,

 

 

         * <inject_html>

         * <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>

         * <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css">

         * </inject_html>

 

Should be converted to be

 

         * <inject_script>

         * var script = document.createElement("script");

         * script.setAttribute("src", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js");

                                * document.head.appendChild(script);

         * var link = document.createElement("link");

         * link.setAttribute("rel", "stylesheet");

         * link.setAttribute("type", "text/css");

         * link.setAttribute("href", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css");

         * document.head.appendChild(link);

         * </inject_script>

 

Thanks,

Yishay

 

[1] https://github.com/apache/royale-asjs/issues/826

 



--
Reply | Threaded
Open this post in threaded view
|

Re: Heads Up: <inject_html> was replaced with <inject_script>

Carlos Rovira-2
Hi Yishay,
yes I build all days before starting


El sáb., 16 may. 2020 a las 11:54, Yishay Weiss (<[hidden email]>) escribió:

Are you sure you updated both the compiler and asjs? I did test Alert.

 


From: Carlos Rovira <[hidden email]>
Sent: Saturday, May 16, 2020 12:50:43 PM
To: [hidden email] <[hidden email]>
Subject: Re: Heads Up: <inject_html> was replaced with <inject_script>
 
Hi Yishay,

I'm seeing in TDJ this error when running:

ReferenceError: dialogPolyfill is not defined
    at /Users/carlosrovira/Dev/Royale/Source/royale-asjs/examples/jewel/TourDeJewel/target/javascript/bin/js-debug/App.js:10:1

Although Alert seems to work. Maybe dialogPolyfill is not needed anymore?

How can that error be removed?



El vie., 15 may. 2020 a las 17:26, Yishay Weiss (<[hidden email]>) escribió:

Hi,

 

A heads-up in case your application uses <inject_html>. Due to a bug [1] that was found when loading modules on IE <inject_html> was deprecated in favor of <inject_script>. So if you’ve used <inject_html> to add html elements to your application, please convert it to add js instead.

 

For example,

 

 

         * <inject_html>

         * <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>

         * <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css">

         * </inject_html>

 

Should be converted to be

 

         * <inject_script>

         * var script = document.createElement("script");

         * script.setAttribute("src", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js");

                                * document.head.appendChild(script);

         * var link = document.createElement("link");

         * link.setAttribute("rel", "stylesheet");

         * link.setAttribute("type", "text/css");

         * link.setAttribute("href", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css");

         * document.head.appendChild(link);

         * </inject_script>

 

Thanks,

Yishay

 

[1] https://github.com/apache/royale-asjs/issues/826

 



--


--
Reply | Threaded
Open this post in threaded view
|

Re: Heads Up: <inject_html> was replaced with <inject_script>

Carlos Rovira-2
Hi, I think the problems is only in release not in debug mode

El sáb., 16 may. 2020 a las 12:17, Carlos Rovira (<[hidden email]>) escribió:
Hi Yishay,
yes I build all days before starting


El sáb., 16 may. 2020 a las 11:54, Yishay Weiss (<[hidden email]>) escribió:

Are you sure you updated both the compiler and asjs? I did test Alert.

 


From: Carlos Rovira <[hidden email]>
Sent: Saturday, May 16, 2020 12:50:43 PM
To: [hidden email] <[hidden email]>
Subject: Re: Heads Up: <inject_html> was replaced with <inject_script>
 
Hi Yishay,

I'm seeing in TDJ this error when running:

ReferenceError: dialogPolyfill is not defined
    at /Users/carlosrovira/Dev/Royale/Source/royale-asjs/examples/jewel/TourDeJewel/target/javascript/bin/js-debug/App.js:10:1

Although Alert seems to work. Maybe dialogPolyfill is not needed anymore?

How can that error be removed?



El vie., 15 may. 2020 a las 17:26, Yishay Weiss (<[hidden email]>) escribió:

Hi,

 

A heads-up in case your application uses <inject_html>. Due to a bug [1] that was found when loading modules on IE <inject_html> was deprecated in favor of <inject_script>. So if you’ve used <inject_html> to add html elements to your application, please convert it to add js instead.

 

For example,

 

 

         * <inject_html>

         * <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>

         * <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css">

         * </inject_html>

 

Should be converted to be

 

         * <inject_script>

         * var script = document.createElement("script");

         * script.setAttribute("src", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js");

                                * document.head.appendChild(script);

         * var link = document.createElement("link");

         * link.setAttribute("rel", "stylesheet");

         * link.setAttribute("type", "text/css");

         * link.setAttribute("href", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css");

         * document.head.appendChild(link);

         * </inject_script>

 

Thanks,

Yishay

 

[1] https://github.com/apache/royale-asjs/issues/826

 



--


--


--
Reply | Threaded
Open this post in threaded view
|

RE: Heads Up: <inject_html> was replaced with <inject_script>

yishayw

Ok, I’m seeing it now. It looks like there’s a race condition that only manifests in release mode because the app initializes quicker. The good news is that window[“dialogPolyfill”], window[“hljs”], etc. do eventually load in release as well, so I don’t think there will be functional implications unless your code calls these objects on initialization.

 

 

From: Carlos Rovira <[hidden email]>
Sent: Saturday, May 16, 2020 1:18:20 PM
To: [hidden email] <[hidden email]>
Subject: Re: Heads Up: <inject_html> was replaced with <inject_script>

 

Hi, I think the problems is only in release not in debug mode

 

El sáb., 16 may. 2020 a las 12:17, Carlos Rovira (<[hidden email]>) escribió:

Hi Yishay,

yes I build all days before starting

 

 

El sáb., 16 may. 2020 a las 11:54, Yishay Weiss (<[hidden email]>) escribió:

Are you sure you updated both the compiler and asjs? I did test Alert.

 

From: Carlos Rovira <[hidden email]>
Sent: Saturday, May 16, 2020 12:50:43 PM
To: [hidden email] <[hidden email]>
Subject: Re: Heads Up: <inject_html> was replaced with <inject_script>

 

Hi Yishay,

 

I'm seeing in TDJ this error when running:

 

ReferenceError: dialogPolyfill is not defined
    at /Users/carlosrovira/Dev/Royale/Source/royale-asjs/examples/jewel/TourDeJewel/target/javascript/bin/js-debug/App.js:10:1

 

Although Alert seems to work. Maybe dialogPolyfill is not needed anymore?

 

How can that error be removed?

 

 

 

El vie., 15 may. 2020 a las 17:26, Yishay Weiss (<[hidden email]>) escribió:

Hi,

 

A heads-up in case your application uses <inject_html>. Due to a bug [1] that was found when loading modules on IE <inject_html> was deprecated in favor of <inject_script>. So if you’ve used <inject_html> to add html elements to your application, please convert it to add js instead.

 

For example,

 

 

         * <inject_html>

         * <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>

         * <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css">

         * </inject_html>

 

Should be converted to be

 

         * <inject_script>

         * var script = document.createElement("script");

         * script.setAttribute("src", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js");

                                * document.head.appendChild(script);

         * var link = document.createElement("link");

         * link.setAttribute("rel", "stylesheet");

         * link.setAttribute("type", "text/css");

         * link.setAttribute("href", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css");

         * document.head.appendChild(link);

         * </inject_script>

 

Thanks,

Yishay

 

[1] https://github.com/apache/royale-asjs/issues/826

 


 

--

Carlos Rovira

 


 

--

Carlos Rovira

 


 

--

 

From: [hidden email]
Sent: Saturday, May 16, 2020 1:18 PM
To: [hidden email]
Subject: Re: Heads Up: <inject_html> was replaced with <inject_script>

 

Hi, I think the problems is only in release not in debug mode

 

El sáb., 16 may. 2020 a las 12:17, Carlos Rovira (<[hidden email]>) escribió:

Hi Yishay,

yes I build all days before starting

 

 

El sáb., 16 may. 2020 a las 11:54, Yishay Weiss (<[hidden email]>) escribió:

Are you sure you updated both the compiler and asjs? I did test Alert.

 

From: Carlos Rovira <[hidden email]>
Sent: Saturday, May 16, 2020 12:50:43 PM
To: [hidden email] <[hidden email]>
Subject: Re: Heads Up: <inject_html> was replaced with <inject_script>

 

Hi Yishay,

 

I'm seeing in TDJ this error when running:

 

ReferenceError: dialogPolyfill is not defined
    at /Users/carlosrovira/Dev/Royale/Source/royale-asjs/examples/jewel/TourDeJewel/target/javascript/bin/js-debug/App.js:10:1

 

Although Alert seems to work. Maybe dialogPolyfill is not needed anymore?

 

How can that error be removed?

 

 

 

El vie., 15 may. 2020 a las 17:26, Yishay Weiss (<[hidden email]>) escribió:

Hi,

 

A heads-up in case your application uses <inject_html>. Due to a bug [1] that was found when loading modules on IE <inject_html> was deprecated in favor of <inject_script>. So if you’ve used <inject_html> to add html elements to your application, please convert it to add js instead.

 

For example,

 

 

         * <inject_html>

         * <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>

         * <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css">

         * </inject_html>

 

Should be converted to be

 

         * <inject_script>

         * var script = document.createElement("script");

         * script.setAttribute("src", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js");

                                * document.head.appendChild(script);

         * var link = document.createElement("link");

         * link.setAttribute("rel", "stylesheet");

         * link.setAttribute("type", "text/css");

         * link.setAttribute("href", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css");

         * document.head.appendChild(link);

         * </inject_script>

 

Thanks,

Yishay

 

[1] https://github.com/apache/royale-asjs/issues/826

 


 

--

Carlos Rovira

 


 

--

Carlos Rovira

 


 

--

 

 

Reply | Threaded
Open this post in threaded view
|

RE: Heads Up: <inject_html> was replaced with <inject_script>

yishayw

To avoid errors in the console and have more control over this in your app, you can probably use static initializers. For example (not tested),

 

package A

{

                import org.apache.royale.utils.css.loadCSS;

                import org.apache.royale.utils.js.loadJavascript;

                public class B

                {

                                private static var jsId:String = getJs();

                                private static var cssId:String = getCss();

                                private static var jsLoaded:Boolean;

                                private static var cssLoaded:Boolean;

 

                                private static function getJs():Boolean

                                {

                                                return loadJavascript(“http://myLib.js”, raiseJsLoadedFlag);

                                }

 

                                private static function getCss():Boolean

                                {

                                                return loadCSS("http://myLib.css”, raiseCssLoadedFlag);

                                }

 

                                private static function raiseJsLoadedFlag():void

                                {

                                                jsLoaded = true;

                                }

 

                                private static function raiseCssLoadedFlag():void

                                {

                                                cssLoaded = true;

                                }

 

                                public function doLibStuff():void

                                {

                                                if (jsLoaded && cssLoaded)

                                                {

                                                                // call lib api

                                                } else

                                                {

                                                                // warn user lib hasn't been loaded yet

                                                }

                                }

                }

}

 

This also allows for a conditional load based on BrowserInfo.

 

From: [hidden email]
Sent: Saturday, May 16, 2020 2:04 PM
To: [hidden email]
Subject: RE: Heads Up: <inject_html> was replaced with <inject_script>

 

Ok, I’m seeing it now. It looks like there’s a race condition that only manifests in release mode because the app initializes quicker. The good news is that window[“dialogPolyfill”], window[“hljs”], etc. do eventually load in release as well, so I don’t think there will be functional implications unless your code calls these objects on initialization.

 

 

From: Carlos Rovira <[hidden email]>
Sent: Saturday, May 16, 2020 1:18:20 PM
To: [hidden email] <[hidden email]>
Subject: Re: Heads Up: <inject_html> was replaced with <inject_script>

 

Hi, I think the problems is only in release not in debug mode

 

El sáb., 16 may. 2020 a las 12:17, Carlos Rovira (<[hidden email]>) escribió:

Hi Yishay,

yes I build all days before starting

 

 

El sáb., 16 may. 2020 a las 11:54, Yishay Weiss (<[hidden email]>) escribió:

Are you sure you updated both the compiler and asjs? I did test Alert.

 

From: Carlos Rovira <[hidden email]>
Sent: Saturday, May 16, 2020 12:50:43 PM
To:
[hidden email] <[hidden email]>
Subject: Re: Heads Up: <inject_html> was replaced with <inject_script>

 

Hi Yishay,

 

I'm seeing in TDJ this error when running:

 

ReferenceError: dialogPolyfill is not defined
    at /Users/carlosrovira/Dev/Royale/Source/royale-asjs/examples/jewel/TourDeJewel/target/javascript/bin/js-debug/App.js:10:1

 

Although Alert seems to work. Maybe dialogPolyfill is not needed anymore?

 

How can that error be removed?

 

 

 

El vie., 15 may. 2020 a las 17:26, Yishay Weiss (<[hidden email]>) escribió:

Hi,

 

A heads-up in case your application uses <inject_html>. Due to a bug [1] that was found when loading modules on IE <inject_html> was deprecated in favor of <inject_script>. So if you’ve used <inject_html> to add html elements to your application, please convert it to add js instead.

 

For example,

 

 

         * <inject_html>

         * <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>

         * <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css">

         * </inject_html>

 

Should be converted to be

 

         * <inject_script>

         * var script = document.createElement("script");

         * script.setAttribute("src", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js");

                                * document.head.appendChild(script);

         * var link = document.createElement("link");

         * link.setAttribute("rel", "stylesheet");

         * link.setAttribute("type", "text/css");

         * link.setAttribute("href", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css");

         * document.head.appendChild(link);

         * </inject_script>

 

Thanks,

Yishay

 

[1] https://github.com/apache/royale-asjs/issues/826

 


 

--

Carlos Rovira

 


 

--

Carlos Rovira

 


 

--

 

From: [hidden email]
Sent: Saturday, May 16, 2020 1:18 PM
To: [hidden email]
Subject: Re: Heads Up: <inject_html> was replaced with <inject_script>

 

Hi, I think the problems is only in release not in debug mode

 

El sáb., 16 may. 2020 a las 12:17, Carlos Rovira (<[hidden email]>) escribió:

Hi Yishay,

yes I build all days before starting

 

 

El sáb., 16 may. 2020 a las 11:54, Yishay Weiss (<[hidden email]>) escribió:

Are you sure you updated both the compiler and asjs? I did test Alert.

 

From: Carlos Rovira <[hidden email]>
Sent: Saturday, May 16, 2020 12:50:43 PM
To:
[hidden email] <[hidden email]>
Subject: Re: Heads Up: <inject_html> was replaced with <inject_script>

 

Hi Yishay,

 

I'm seeing in TDJ this error when running:

 

ReferenceError: dialogPolyfill is not defined
    at /Users/carlosrovira/Dev/Royale/Source/royale-asjs/examples/jewel/TourDeJewel/target/javascript/bin/js-debug/App.js:10:1

 

Although Alert seems to work. Maybe dialogPolyfill is not needed anymore?

 

How can that error be removed?

 

 

 

El vie., 15 may. 2020 a las 17:26, Yishay Weiss (<[hidden email]>) escribió:

Hi,

 

A heads-up in case your application uses <inject_html>. Due to a bug [1] that was found when loading modules on IE <inject_html> was deprecated in favor of <inject_script>. So if you’ve used <inject_html> to add html elements to your application, please convert it to add js instead.

 

For example,

 

 

         * <inject_html>

         * <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>

         * <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css">

         * </inject_html>

 

Should be converted to be

 

         * <inject_script>

         * var script = document.createElement("script");

         * script.setAttribute("src", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js");

                                * document.head.appendChild(script);

         * var link = document.createElement("link");

         * link.setAttribute("rel", "stylesheet");

         * link.setAttribute("type", "text/css");

         * link.setAttribute("href", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css");

         * document.head.appendChild(link);

         * </inject_script>

 

Thanks,

Yishay

 

[1] https://github.com/apache/royale-asjs/issues/826

 


 

--

Carlos Rovira

 


 

--

Carlos Rovira

 


 

--

 

 

 

Reply | Threaded
Open this post in threaded view
|

RE: Heads Up: <inject_html> was replaced with <inject_script>

yishayw

Should be getJs():String{} and getCss():String{}

 

From: [hidden email]
Sent: Saturday, May 16, 2020 2:42 PM
To: [hidden email]
Subject: RE: Heads Up: <inject_html> was replaced with <inject_script>

 

To avoid errors in the console and have more control over this in your app, you can probably use static initializers. For example (not tested),

 

package A

{

                import org.apache.royale.utils.css.loadCSS;

                import org.apache.royale.utils.js.loadJavascript;

                public class B

                {

                                private static var jsId:String = getJs();

                                private static var cssId:String = getCss();

                                private static var jsLoaded:Boolean;

                                private static var cssLoaded:Boolean;

 

                                private static function getJs():Boolean

                                {

                                                return loadJavascript(“http://myLib.js”, raiseJsLoadedFlag);

                                }

 

                                private static function getCss():Boolean

                                {

                                                return loadCSS("http://myLib.css”, raiseCssLoadedFlag);

                                }

 

                                private static function raiseJsLoadedFlag():void

                                {

                                                jsLoaded = true;

                                }

 

                                private static function raiseCssLoadedFlag():void

                                {

                                                cssLoaded = true;

                                }

 

                                public function doLibStuff():void

                                {

                                                if (jsLoaded && cssLoaded)

                                                {

                                                                // call lib api

                                                } else

                                                {

                                                                // warn user lib hasn't been loaded yet

                                                }

                                }

                }

}

 

This also allows for a conditional load based on BrowserInfo.

 

From: [hidden email]
Sent: Saturday, May 16, 2020 2:04 PM
To: [hidden email]
Subject: RE: Heads Up: <inject_html> was replaced with <inject_script>

 

Ok, I’m seeing it now. It looks like there’s a race condition that only manifests in release mode because the app initializes quicker. The good news is that window[“dialogPolyfill”], window[“hljs”], etc. do eventually load in release as well, so I don’t think there will be functional implications unless your code calls these objects on initialization.

 

 

From: Carlos Rovira <[hidden email]>
Sent: Saturday, May 16, 2020 1:18:20 PM
To: [hidden email] <[hidden email]>
Subject: Re: Heads Up: <inject_html> was replaced with <inject_script>

 

Hi, I think the problems is only in release not in debug mode

 

El sáb., 16 may. 2020 a las 12:17, Carlos Rovira (<[hidden email]>) escribió:

Hi Yishay,

yes I build all days before starting

 

 

El sáb., 16 may. 2020 a las 11:54, Yishay Weiss (<[hidden email]>) escribió:

Are you sure you updated both the compiler and asjs? I did test Alert.

 

From: Carlos Rovira <[hidden email]>
Sent: Saturday, May 16, 2020 12:50:43 PM
To:
[hidden email] <[hidden email]>
Subject: Re: Heads Up: <inject_html> was replaced with <inject_script>

 

Hi Yishay,

 

I'm seeing in TDJ this error when running:

 

ReferenceError: dialogPolyfill is not defined
    at /Users/carlosrovira/Dev/Royale/Source/royale-asjs/examples/jewel/TourDeJewel/target/javascript/bin/js-debug/App.js:10:1

 

Although Alert seems to work. Maybe dialogPolyfill is not needed anymore?

 

How can that error be removed?

 

 

 

El vie., 15 may. 2020 a las 17:26, Yishay Weiss (<[hidden email]>) escribió:

Hi,

 

A heads-up in case your application uses <inject_html>. Due to a bug [1] that was found when loading modules on IE <inject_html> was deprecated in favor of <inject_script>. So if you’ve used <inject_html> to add html elements to your application, please convert it to add js instead.

 

For example,

 

 

         * <inject_html>

         * <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>

         * <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css">

         * </inject_html>

 

Should be converted to be

 

         * <inject_script>

         * var script = document.createElement("script");

         * script.setAttribute("src", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js");

                                * document.head.appendChild(script);

         * var link = document.createElement("link");

         * link.setAttribute("rel", "stylesheet");

         * link.setAttribute("type", "text/css");

         * link.setAttribute("href", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css");

         * document.head.appendChild(link);

         * </inject_script>

 

Thanks,

Yishay

 

[1] https://github.com/apache/royale-asjs/issues/826

 


 

--

Carlos Rovira

 


 

--

Carlos Rovira

 


 

--

 

From: [hidden email]
Sent: Saturday, May 16, 2020 1:18 PM
To: [hidden email]
Subject: Re: Heads Up: <inject_html> was replaced with <inject_script>

 

Hi, I think the problems is only in release not in debug mode

 

El sáb., 16 may. 2020 a las 12:17, Carlos Rovira (<[hidden email]>) escribió:

Hi Yishay,

yes I build all days before starting

 

 

El sáb., 16 may. 2020 a las 11:54, Yishay Weiss (<[hidden email]>) escribió:

Are you sure you updated both the compiler and asjs? I did test Alert.

 

From: Carlos Rovira <[hidden email]>
Sent: Saturday, May 16, 2020 12:50:43 PM
To:
[hidden email] <[hidden email]>
Subject: Re: Heads Up: <inject_html> was replaced with <inject_script>

 

Hi Yishay,

 

I'm seeing in TDJ this error when running:

 

ReferenceError: dialogPolyfill is not defined
    at /Users/carlosrovira/Dev/Royale/Source/royale-asjs/examples/jewel/TourDeJewel/target/javascript/bin/js-debug/App.js:10:1

 

Although Alert seems to work. Maybe dialogPolyfill is not needed anymore?

 

How can that error be removed?

 

 

 

El vie., 15 may. 2020 a las 17:26, Yishay Weiss (<[hidden email]>) escribió:

Hi,

 

A heads-up in case your application uses <inject_html>. Due to a bug [1] that was found when loading modules on IE <inject_html> was deprecated in favor of <inject_script>. So if you’ve used <inject_html> to add html elements to your application, please convert it to add js instead.

 

For example,

 

 

         * <inject_html>

         * <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>

         * <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css">

         * </inject_html>

 

Should be converted to be

 

         * <inject_script>

         * var script = document.createElement("script");

         * script.setAttribute("src", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js");

                                * document.head.appendChild(script);

         * var link = document.createElement("link");

         * link.setAttribute("rel", "stylesheet");

         * link.setAttribute("type", "text/css");

         * link.setAttribute("href", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css");

         * document.head.appendChild(link);

         * </inject_script>

 

Thanks,

Yishay

 

[1] https://github.com/apache/royale-asjs/issues/826

 


 

--

Carlos Rovira

 


 

--

Carlos Rovira

 


 

--

 

 

 

 

Reply | Threaded
Open this post in threaded view
|

RE: Heads Up: <inject_html> was replaced with <inject_script>

yishayw

One last note to make it clear, if you use static initializers like that you don’t need <inject_script> at all.

 

From: [hidden email]
Sent: Saturday, May 16, 2020 2:47 PM
To: [hidden email]
Subject: RE: Heads Up: <inject_html> was replaced with <inject_script>

 

Should be getJs():String{} and getCss():String{}

 

From: [hidden email]
Sent: Saturday, May 16, 2020 2:42 PM
To: [hidden email]
Subject: RE: Heads Up: <inject_html> was replaced with <inject_script>

 

To avoid errors in the console and have more control over this in your app, you can probably use static initializers. For example (not tested),

 

package A

{

                import org.apache.royale.utils.css.loadCSS;

                import org.apache.royale.utils.js.loadJavascript;

                public class B

                {

                                private static var jsId:String = getJs();

                                private static var cssId:String = getCss();

                                private static var jsLoaded:Boolean;

                                private static var cssLoaded:Boolean;

 

                                private static function getJs():Boolean

                                {

                                                return loadJavascript(“http://myLib.js”, raiseJsLoadedFlag);

                                }

 

                                private static function getCss():Boolean

                                {

                                                return loadCSS("http://myLib.css”, raiseCssLoadedFlag);

                                }

 

                                private static function raiseJsLoadedFlag():void

                                {

                                                jsLoaded = true;

                                }

 

                                private static function raiseCssLoadedFlag():void

                                {

                                                cssLoaded = true;

                                }

 

                                public function doLibStuff():void

                                {

                                                if (jsLoaded && cssLoaded)

                                                {

                                                                // call lib api

                                                } else

                                                {

                                                                // warn user lib hasn't been loaded yet

                                                }

                                }

                }

}

 

This also allows for a conditional load based on BrowserInfo.

 

From: [hidden email]
Sent: Saturday, May 16, 2020 2:04 PM
To: [hidden email]
Subject: RE: Heads Up: <inject_html> was replaced with <inject_script>

 

Ok, I’m seeing it now. It looks like there’s a race condition that only manifests in release mode because the app initializes quicker. The good news is that window[“dialogPolyfill”], window[“hljs”], etc. do eventually load in release as well, so I don’t think there will be functional implications unless your code calls these objects on initialization.

 

 

From: Carlos Rovira <[hidden email]>
Sent: Saturday, May 16, 2020 1:18:20 PM
To: [hidden email] <[hidden email]>
Subject: Re: Heads Up: <inject_html> was replaced with <inject_script>

 

Hi, I think the problems is only in release not in debug mode

 

El sáb., 16 may. 2020 a las 12:17, Carlos Rovira (<[hidden email]>) escribió:

Hi Yishay,

yes I build all days before starting

 

 

El sáb., 16 may. 2020 a las 11:54, Yishay Weiss (<[hidden email]>) escribió:

Are you sure you updated both the compiler and asjs? I did test Alert.

 

From: Carlos Rovira <[hidden email]>
Sent: Saturday, May 16, 2020 12:50:43 PM
To:
[hidden email] <[hidden email]>
Subject: Re: Heads Up: <inject_html> was replaced with <inject_script>

 

Hi Yishay,

 

I'm seeing in TDJ this error when running:

 

ReferenceError: dialogPolyfill is not defined
    at /Users/carlosrovira/Dev/Royale/Source/royale-asjs/examples/jewel/TourDeJewel/target/javascript/bin/js-debug/App.js:10:1

 

Although Alert seems to work. Maybe dialogPolyfill is not needed anymore?

 

How can that error be removed?

 

 

 

El vie., 15 may. 2020 a las 17:26, Yishay Weiss (<[hidden email]>) escribió:

Hi,

 

A heads-up in case your application uses <inject_html>. Due to a bug [1] that was found when loading modules on IE <inject_html> was deprecated in favor of <inject_script>. So if you’ve used <inject_html> to add html elements to your application, please convert it to add js instead.

 

For example,

 

 

         * <inject_html>

         * <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>

         * <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css">

         * </inject_html>

 

Should be converted to be

 

         * <inject_script>

         * var script = document.createElement("script");

         * script.setAttribute("src", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js");

                                * document.head.appendChild(script);

         * var link = document.createElement("link");

         * link.setAttribute("rel", "stylesheet");

         * link.setAttribute("type", "text/css");

         * link.setAttribute("href", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css");

         * document.head.appendChild(link);

         * </inject_script>

 

Thanks,

Yishay

 

[1] https://github.com/apache/royale-asjs/issues/826

 


 

--

Carlos Rovira

 


 

--

Carlos Rovira

 


 

--

 

From: [hidden email]
Sent: Saturday, May 16, 2020 1:18 PM
To: [hidden email]
Subject: Re: Heads Up: <inject_html> was replaced with <inject_script>

 

Hi, I think the problems is only in release not in debug mode

 

El sáb., 16 may. 2020 a las 12:17, Carlos Rovira (<[hidden email]>) escribió:

Hi Yishay,

yes I build all days before starting

 

 

El sáb., 16 may. 2020 a las 11:54, Yishay Weiss (<[hidden email]>) escribió:

Are you sure you updated both the compiler and asjs? I did test Alert.

 

From: Carlos Rovira <[hidden email]>
Sent: Saturday, May 16, 2020 12:50:43 PM
To:
[hidden email] <[hidden email]>
Subject: Re: Heads Up: <inject_html> was replaced with <inject_script>

 

Hi Yishay,

 

I'm seeing in TDJ this error when running:

 

ReferenceError: dialogPolyfill is not defined
    at /Users/carlosrovira/Dev/Royale/Source/royale-asjs/examples/jewel/TourDeJewel/target/javascript/bin/js-debug/App.js:10:1

 

Although Alert seems to work. Maybe dialogPolyfill is not needed anymore?

 

How can that error be removed?

 

 

 

El vie., 15 may. 2020 a las 17:26, Yishay Weiss (<[hidden email]>) escribió:

Hi,

 

A heads-up in case your application uses <inject_html>. Due to a bug [1] that was found when loading modules on IE <inject_html> was deprecated in favor of <inject_script>. So if you’ve used <inject_html> to add html elements to your application, please convert it to add js instead.

 

For example,

 

 

         * <inject_html>

         * <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>

         * <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css">

         * </inject_html>

 

Should be converted to be

 

         * <inject_script>

         * var script = document.createElement("script");

         * script.setAttribute("src", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js");

                                * document.head.appendChild(script);

         * var link = document.createElement("link");

         * link.setAttribute("rel", "stylesheet");

         * link.setAttribute("type", "text/css");

         * link.setAttribute("href", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css");

         * document.head.appendChild(link);

         * </inject_script>

 

Thanks,

Yishay

 

[1] https://github.com/apache/royale-asjs/issues/826

 


 

--

Carlos Rovira

 


 

--

Carlos Rovira

 


 

--

 

 

 

 

 

Reply | Threaded
Open this post in threaded view
|

Re: Heads Up: <inject_html> was replaced with <inject_script>

Carlos Rovira-2
Hi Yishay,

In TDJ I have involved:

1) dialogPolyfill at Jewel library level
2) hljs at TDJ level

only the dialogPolyfill is generating a RTE in release mode. I think far beyond strategies on how to load it, we should fix that race issue for release mode since is a bug introduced, right?

About load strategies, I think it deserves other thread, since I was thinking about it (even considering some proposals from Alex about it), but prefer don't write about it here to avoid confusion about the RTE issue in release mode.

Thanks


El sáb., 16 may. 2020 a las 13:53, Yishay Weiss (<[hidden email]>) escribió:

One last note to make it clear, if you use static initializers like that you don’t need <inject_script> at all.

 

From: [hidden email]
Sent: Saturday, May 16, 2020 2:47 PM
To: [hidden email]
Subject: RE: Heads Up: <inject_html> was replaced with <inject_script>

 

Should be getJs():String{} and getCss():String{}

 

From: [hidden email]
Sent: Saturday, May 16, 2020 2:42 PM
To: [hidden email]
Subject: RE: Heads Up: <inject_html> was replaced with <inject_script>

 

To avoid errors in the console and have more control over this in your app, you can probably use static initializers. For example (not tested),

 

package A

{

                import org.apache.royale.utils.css.loadCSS;

                import org.apache.royale.utils.js.loadJavascript;

                public class B

                {

                                private static var jsId:String = getJs();

                                private static var cssId:String = getCss();

                                private static var jsLoaded:Boolean;

                                private static var cssLoaded:Boolean;

 

                                private static function getJs():Boolean

                                {

                                                return loadJavascript(“http://myLib.js”, raiseJsLoadedFlag);

                                }

 

                                private static function getCss():Boolean

                                {

                                                return loadCSS("http://myLib.css”, raiseCssLoadedFlag);

                                }

 

                                private static function raiseJsLoadedFlag():void

                                {

                                                jsLoaded = true;

                                }

 

                                private static function raiseCssLoadedFlag():void

                                {

                                                cssLoaded = true;

                                }

 

                                public function doLibStuff():void

                                {

                                                if (jsLoaded && cssLoaded)

                                                {

                                                                // call lib api

                                                } else

                                                {

                                                                // warn user lib hasn't been loaded yet

                                                }

                                }

                }

}

 

This also allows for a conditional load based on BrowserInfo.

 

From: [hidden email]
Sent: Saturday, May 16, 2020 2:04 PM
To: [hidden email]
Subject: RE: Heads Up: <inject_html> was replaced with <inject_script>

 

Ok, I’m seeing it now. It looks like there’s a race condition that only manifests in release mode because the app initializes quicker. The good news is that window[“dialogPolyfill”], window[“hljs”], etc. do eventually load in release as well, so I don’t think there will be functional implications unless your code calls these objects on initialization.

 

 

From: Carlos Rovira <[hidden email]>
Sent: Saturday, May 16, 2020 1:18:20 PM
To: [hidden email] <[hidden email]>
Subject: Re: Heads Up: <inject_html> was replaced with <inject_script>

 

Hi, I think the problems is only in release not in debug mode

 

El sáb., 16 may. 2020 a las 12:17, Carlos Rovira (<[hidden email]>) escribió:

Hi Yishay,

yes I build all days before starting

 

 

El sáb., 16 may. 2020 a las 11:54, Yishay Weiss (<[hidden email]>) escribió:

Are you sure you updated both the compiler and asjs? I did test Alert.

 

From: Carlos Rovira <[hidden email]>
Sent: Saturday, May 16, 2020 12:50:43 PM
To:
[hidden email] <[hidden email]>
Subject: Re: Heads Up: <inject_html> was replaced with <inject_script>

 

Hi Yishay,

 

I'm seeing in TDJ this error when running:

 

ReferenceError: dialogPolyfill is not defined
    at /Users/carlosrovira/Dev/Royale/Source/royale-asjs/examples/jewel/TourDeJewel/target/javascript/bin/js-debug/App.js:10:1

 

Although Alert seems to work. Maybe dialogPolyfill is not needed anymore?

 

How can that error be removed?

 

 

 

El vie., 15 may. 2020 a las 17:26, Yishay Weiss (<[hidden email]>) escribió:

Hi,

 

A heads-up in case your application uses <inject_html>. Due to a bug [1] that was found when loading modules on IE <inject_html> was deprecated in favor of <inject_script>. So if you’ve used <inject_html> to add html elements to your application, please convert it to add js instead.

 

For example,

 

 

         * <inject_html>

         * <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>

         * <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css">

         * </inject_html>

 

Should be converted to be

 

         * <inject_script>

         * var script = document.createElement("script");

         * script.setAttribute("src", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js");

                                * document.head.appendChild(script);

         * var link = document.createElement("link");

         * link.setAttribute("rel", "stylesheet");

         * link.setAttribute("type", "text/css");

         * link.setAttribute("href", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css");

         * document.head.appendChild(link);

         * </inject_script>

 

Thanks,

Yishay

 

[1] https://github.com/apache/royale-asjs/issues/826

 


 

--

Carlos Rovira

 


 

--

Carlos Rovira

 


 

--

 

From: [hidden email]
Sent: Saturday, May 16, 2020 1:18 PM
To: [hidden email]
Subject: Re: Heads Up: <inject_html> was replaced with <inject_script>

 

Hi, I think the problems is only in release not in debug mode

 

El sáb., 16 may. 2020 a las 12:17, Carlos Rovira (<[hidden email]>) escribió:

Hi Yishay,

yes I build all days before starting

 

 

El sáb., 16 may. 2020 a las 11:54, Yishay Weiss (<[hidden email]>) escribió:

Are you sure you updated both the compiler and asjs? I did test Alert.

 

From: Carlos Rovira <[hidden email]>
Sent: Saturday, May 16, 2020 12:50:43 PM
To:
[hidden email] <[hidden email]>
Subject: Re: Heads Up: <inject_html> was replaced with <inject_script>

 

Hi Yishay,

 

I'm seeing in TDJ this error when running:

 

ReferenceError: dialogPolyfill is not defined
    at /Users/carlosrovira/Dev/Royale/Source/royale-asjs/examples/jewel/TourDeJewel/target/javascript/bin/js-debug/App.js:10:1

 

Although Alert seems to work. Maybe dialogPolyfill is not needed anymore?

 

How can that error be removed?

 

 

 

El vie., 15 may. 2020 a las 17:26, Yishay Weiss (<[hidden email]>) escribió:

Hi,

 

A heads-up in case your application uses <inject_html>. Due to a bug [1] that was found when loading modules on IE <inject_html> was deprecated in favor of <inject_script>. So if you’ve used <inject_html> to add html elements to your application, please convert it to add js instead.

 

For example,

 

 

         * <inject_html>

         * <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>

         * <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css">

         * </inject_html>

 

Should be converted to be

 

         * <inject_script>

         * var script = document.createElement("script");

         * script.setAttribute("src", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js");

                                * document.head.appendChild(script);

         * var link = document.createElement("link");

         * link.setAttribute("rel", "stylesheet");

         * link.setAttribute("type", "text/css");

         * link.setAttribute("href", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css");

         * document.head.appendChild(link);

         * </inject_script>

 

Thanks,

Yishay

 

[1] https://github.com/apache/royale-asjs/issues/826

 


 

--

Carlos Rovira

 


 

--

Carlos Rovira

 


 

--

 

 

 

 

 



--
Reply | Threaded
Open this post in threaded view
|

Re: Heads Up: <inject_html> was replaced with <inject_script>

Alex Harui-2
In reply to this post by yishayw

Is the script tag from inject_script going before or after the script tag for the application (should be before, IMO)?  Make sure the script tag has the same settings as the script tags google closure uses in js-debug.  I think they set some options so the scripts load in order.

 

HTH,

-Alex

 

From: Yishay Weiss <[hidden email]>
Reply-To: "[hidden email]" <[hidden email]>
Date: Saturday, May 16, 2020 at 4:04 AM
To: "[hidden email]" <[hidden email]>
Subject: RE: Heads Up: <inject_html> was replaced with <inject_script>

 

Ok, I’m seeing it now. It looks like there’s a race condition that only manifests in release mode because the app initializes quicker. The good news is that window[“dialogPolyfill”], window[“hljs”], etc. do eventually load in release as well, so I don’t think there will be functional implications unless your code calls these objects on initialization.

 

 

From: Carlos Rovira <[hidden email]>
Sent: Saturday, May 16, 2020 1:18:20 PM
To: [hidden email] <[hidden email]>
Subject: Re: Heads Up: <inject_html> was replaced with <inject_script>

 

Hi, I think the problems is only in release not in debug mode

 

El sáb., 16 may. 2020 a las 12:17, Carlos Rovira (<[hidden email]>) escribió:

Hi Yishay,

yes I build all days before starting

 

 

El sáb., 16 may. 2020 a las 11:54, Yishay Weiss (<[hidden email]>) escribió:

Are you sure you updated both the compiler and asjs? I did test Alert.

 

From: Carlos Rovira <[hidden email]>
Sent: Saturday, May 16, 2020 12:50:43 PM
To: [hidden email] <[hidden email]>
Subject: Re: Heads Up: <inject_html> was replaced with <inject_script>

 

Hi Yishay,

 

I'm seeing in TDJ this error when running:

 

ReferenceError: dialogPolyfill is not defined
    at /Users/carlosrovira/Dev/Royale/Source/royale-asjs/examples/jewel/TourDeJewel/target/javascript/bin/js-debug/App.js:10:1

 

Although Alert seems to work. Maybe dialogPolyfill is not needed anymore?

 

How can that error be removed?

 

 

 

El vie., 15 may. 2020 a las 17:26, Yishay Weiss (<[hidden email]>) escribió:

Hi,

 

A heads-up in case your application uses <inject_html>. Due to a bug [1] that was found when loading modules on IE <inject_html> was deprecated in favor of <inject_script>. So if you’ve used <inject_html> to add html elements to your application, please convert it to add js instead.

 

For example,

 

 

         * <inject_html>

         * <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>

         * <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css">

         * </inject_html>

 

Should be converted to be

 

         * <inject_script>

         * var script = document.createElement("script");

         * script.setAttribute("src", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js");

                                * document.head.appendChild(script);

         * var link = document.createElement("link");

         * link.setAttribute("rel", "stylesheet");

         * link.setAttribute("type", "text/css");

         * link.setAttribute("href", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css");

         * document.head.appendChild(link);

         * </inject_script>

 

Thanks,

Yishay

 

[1] https://github.com/apache/royale-asjs/issues/826

 


 

--

Carlos Rovira

 


 

--

Carlos Rovira

 


 

--

 

From: [hidden email]
Sent: Saturday, May 16, 2020 1:18 PM
To: [hidden email]
Subject: Re: Heads Up: <inject_html> was replaced with <inject_script>

 

Hi, I think the problems is only in release not in debug mode

 

El sáb., 16 may. 2020 a las 12:17, Carlos Rovira (<[hidden email]>) escribió:

Hi Yishay,

yes I build all days before starting

 

 

El sáb., 16 may. 2020 a las 11:54, Yishay Weiss (<[hidden email]>) escribió:

Are you sure you updated both the compiler and asjs? I did test Alert.

 

From: Carlos Rovira <[hidden email]>
Sent: Saturday, May 16, 2020 12:50:43 PM
To: [hidden email] <[hidden email]>
Subject: Re: Heads Up: <inject_html> was replaced with <inject_script>

 

Hi Yishay,

 

I'm seeing in TDJ this error when running:

 

ReferenceError: dialogPolyfill is not defined
    at /Users/carlosrovira/Dev/Royale/Source/royale-asjs/examples/jewel/TourDeJewel/target/javascript/bin/js-debug/App.js:10:1

 

Although Alert seems to work. Maybe dialogPolyfill is not needed anymore?

 

How can that error be removed?

 

 

 

El vie., 15 may. 2020 a las 17:26, Yishay Weiss (<[hidden email]>) escribió:

Hi,

 

A heads-up in case your application uses <inject_html>. Due to a bug [1] that was found when loading modules on IE <inject_html> was deprecated in favor of <inject_script>. So if you’ve used <inject_html> to add html elements to your application, please convert it to add js instead.

 

For example,

 

 

         * <inject_html>

         * <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>

         * <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css">

         * </inject_html>

 

Should be converted to be

 

         * <inject_script>

         * var script = document.createElement("script");

         * script.setAttribute("src", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js");

                                * document.head.appendChild(script);

         * var link = document.createElement("link");

         * link.setAttribute("rel", "stylesheet");

         * link.setAttribute("type", "text/css");

         * link.setAttribute("href", "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css");

         * document.head.appendChild(link);

         * </inject_script>

 

Thanks,

Yishay

 

[1] https://github.com/apache/royale-asjs/issues/826

 


 

--

Carlos Rovira

 


 

--

Carlos Rovira

 


 

--