Maybe check your changes to what we added to the Google Closure Library for 
html and see if any of these files are a result of the goog.html package.  They 
might have always been there to handle EventTarget and minification.

HelloWorld used to be 60K (actually, 29K way back) but if it zips to 20K that's 
probably ok.

-Alex

On 12/28/21, 2:35 PM, "Harbs" <harbs.li...@gmail.com> wrote:

    Source maps are likely a clue as to where the code is coming from:

    "goog/base.js","class 
com.google.javascript.jscomp.FunctionRewriter$EmptyFunctionReducer:helper","class
 com.google.javascript.jscomp.FunctionRewriter$SetterReducer:helper","class 
com.google.javascript.jscomp.FunctionRewriter$GetterReducer:helper","class 
com.google.javascript.jscomp.FunctionRewriter$ReturnConstantReducer:helper"," 
[synthetic:util/defineproperty] "," [synthetic:util/global] "," 
[synthetic:util/polyfill] "," [synthetic:es6/weakmap] "," 
[synthetic:es6/util/arrayiterator] "," [synthetic:util/owns] "," 
[synthetic:es6/util/makeiterator] 
","goog/string/string.js","goog/reflect/reflect.js","goog/labs/useragent/util.js","goog/array/array.js","goog/object/object.js","goog/useragent/useragent.js","goog/labs/useragent/browser.js","goog/labs/useragent/engine.js","goog/labs/useragent/platform.js","goog/html/sanitizer/noclobber.js","goog/events/listenable.js","goog/events/listener.js","goog/events/listenermap.js","goog/disposable/disposable.js","goog/events/event.js","goog/events/browserfeature.js","goog/events/browserevent.js","goog/events/eventtype.js","goog/events/events.js","goog/events/eventtarget.js”,

    We definitely don’t want all that junk. Maybe we should roll back the 
sanitizing changes...

    > On Dec 29, 2021, at 12:11 AM, Harbs <harbs.li...@gmail.com> wrote:
    > 
    > HelloWorld size: 78,547 bytes and 20,788 bytes minified.
    > 
    > There does seem to be a bunch of cruft at the top of the file. Not sure 
where it’s all coming from:
    > 
    > 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpaste.apache.org%2Fd6p4j&amp;data=04%7C01%7Caharui%40adobe.com%7C6cc0f8dd9af54e579c9908d9ca525fb1%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637763277411096254%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=MP5WeD6g6DsTI53w8Md5ThBppdBgrFYlpQUcRh2wkg4%3D&amp;reserved=0
    > 
    >> On Dec 28, 2021, at 10:13 PM, Alex Harui <aha...@adobe.com.INVALID> 
wrote:
    >> 
    >> Maybe.  Can you confirm it?  I think if there are any exports in that 
code it might stick around.
    >> 
    >> -Alex
    >> 
    >> On 12/27/21, 9:24 PM, "Harbs" <harbs.li...@gmail.com> wrote:
    >> 
    >>   Won’t the minification remove the code if it’s not needed?
    >> 
    >>> On Dec 28, 2021, at 2:10 AM, Alex Harui <aha...@adobe.com.INVALID> 
wrote:
    >>> 
    >>> I think with this change we'll see HelloWorld grow by the size of the 
goog.html and related code, which could be a noticeable chunk.  Ideally, 
there'd be some way to kick out the sanitization code if rare situations it 
isn't needed, or just to show our HelloWorld is still small.  And then it would 
nice to not have to remember to update the compiler if we add some other goog 
dependency later.  The compiler did list a bunch of goog files for the debug 
build's addDependency list, so maybe we just need to start from that list.  
However, I'm hoping to not spend more time on this, so maybe some other 
volunteer can do that.
    >>> 
    >>> -Alex
    >>> 
    >>> On 12/27/21, 1:03 AM, "Harbs" <harbs.li...@gmail.com> wrote:
    >>> 
    >>>  OK. I’ll give it a go. I see what you did. It’s probably reasonable to 
just add dependencies if/when we need them.
    >>> 
    >>>> On Dec 27, 2021, at 9:53 AM, Alex Harui <aha...@adobe.com.INVALID> 
wrote:
    >>>> 
    >>>> It looks like the compiler has some expectations that 
goog.events.EventTarget is the only goog dependency in a Royale app.
    >>>> I added HtmlSanitizer and a test case I was using that had the same 
problem started working.  Maybe we need a smarter way to dictate what goog 
dependencies really are.
    >>>> 
    >>>> -Alex
    >>>> 
    >>>> On 12/26/21, 11:51 AM, "Harbs" <harbs.li...@gmail.com> wrote:
    >>>> 
    >>>> This is when running the CoreJS tests.
    >>>> 
    >>>>> On Dec 26, 2021, at 8:54 PM, Harbs <harbs.li...@gmail.com> wrote:
    >>>>> 
    >>>>> Uncaught TypeError: Cannot read properties of undefined (reading 'ua’)
    >>>>> 
    >>>>> in gf(Ci, We.H.ua);
    >>>>> 
    >>>>> “We.H" is undefined.
    >>>>> 
    >>>>> Here’s the surrounding code:
    >>>>> 
    >>>>> function Ci(a, b) {
    >>>>> We.H.ua.call(this, a, b)
    >>>>> }
    >>>>> gf(Ci, We.H.ua);
    >>>>> C(je, Ci);
    >>>>> Ci.unwrap = function(a) {
    >>>>> return We.H.ua.unwrap(a)
    >>>>> }
    >>>>> ;
    >>>>> C('org.apache.royale.utils.string.InternalSafeUrl.unwrap', Ci.unwrap);
    >>>>> Ci.sanitize = function(a) {
    >>>>> return We.H.ua.sanitize(a)
    >>>>> }
    >>>>> ;
    >>>>> C('org.apache.royale.utils.string.InternalSafeUrl.sanitize', 
Ci.sanitize);
    >>>>> Ci.prototype.g = {
    >>>>> names: [{
    >>>>>    name: 'InternalSafeUrl',
    >>>>>    h: je,
    >>>>>    kind: p
    >>>>> }]
    >>>>> };
    >>>>> Ci.prototype.i = function() {
    >>>>> return {
    >>>>>    methods: function() {
    >>>>>        return {
    >>>>>            InternalSafeUrl: {
    >>>>>                type: '',
    >>>>>                declaredBy: je,
    >>>>>                parameters: function() {
    >>>>>                    return [l, !1, k, !1]
    >>>>>                }
    >>>>>            },
    >>>>>            '|unwrap': {
    >>>>>                type: l,
    >>>>>                declaredBy: je,
    >>>>>                parameters: function() {
    >>>>>                    return [kc, !1]
    >>>>>                }
    >>>>>            },
    >>>>>            '|sanitize': {
    >>>>>                type: kc,
    >>>>>                declaredBy: je,
    >>>>>                parameters: function() {
    >>>>>                    return [l, !1]
    >>>>>                }
    >>>>>            }
    >>>>>        }
    >>>>>    }
    >>>>> }
    >>>>> }
    >>>>> ;
    >>>>> 
    >>>>>> On Dec 26, 2021, at 7:27 PM, Alex Harui <aha...@adobe.com.INVALID> 
wrote:
    >>>>>> 
    >>>>>> What error do you get in release mode?  The goog classes "should" be 
renamed in release mode if it is all static methods.
    >>>>>> 
    >>>>>> -Alex
    >>>>>> 
    >>>>>> On 12/26/21, 2:11 AM, "Harbs" <harbs.li...@gmail.com> wrote:
    >>>>>> 
    >>>>>> I subclassed the goog classes. That seems to help in debug mode, but 
for some reason I’m not clear on, the goog classes disappear in release mode.
    >>>>>> 
    >>>>>> You can see what I did on the sanitize branch...
    >>>>>> 
    >>>>>>> On Dec 26, 2021, at 9:35 AM, Harbs <harbs.li...@gmail.com> wrote:
    >>>>>>> 
    >>>>>>> I’ll try to create placeholder classes to subclass them.
    >>>>>>> 
    >>>>>>>> Might be simpler to just special case these two.
    >>>>>>> 
    >>>>>>> How would we go about that?
    >>>>>>> 
    >>>>>>>> On Dec 25, 2021, at 6:08 PM, Alex Harui <aha...@adobe.com.INVALID> 
wrote:
    >>>>>>>> 
    >>>>>>>> Hmm.  That may not work since you can't extend a static function.  
Might be simpler to just special case these two.
    >>>>>>>> 
    >>>>>>>> -Alex
    >>>>>>>> 
    >>>>>>>> On 12/25/21, 12:08 AM, "Alex Harui" <aha...@adobe.com.INVALID> 
wrote:
    >>>>>>>> 
    >>>>>>>> I took a look.  It does require an "extends" relationship to force 
the goog.require for something in GCL.swc.  I don't think we want to change 
that, so try a workaround.
    >>>>>>>> 
    >>>>>>>> On 12/20/21, 9:02 AM, "Alex Harui" <aha...@adobe.com.INVALID> 
wrote:
    >>>>>>>> 
    >>>>>>>> I will try to look at it this coming weekend.  One thing to try 
for now is to create a class that extends goog.html.SafeHtml and redirect 
sanitization through the subclass.  Maybe the only way to get the dependency is 
to have an 'extends' relationship on the dependency, since that's what 
EventDispatcher does.
    >>>>>>>> 
    >>>>>>>> -Alex
    >>>>>>>> 
    >>>>>>>> On 12/20/21, 7:16 AM, "Harbs" <harbs.li...@gmail.com> wrote:
    >>>>>>>> 
    >>>>>>>> 
    >>>>>>>> 
    >>>>>>>>> On Dec 20, 2021, at 10:20 AM, Alex Harui 
<aha...@adobe.com.INVALID> wrote:
    >>>>>>>>> 
    >>>>>>>>> I might have time this weekend to spend more time getting it to 
work, but the idea is that you add to GCL.swc the .as version of whatever JS 
file you need from Google Closure Library
    >>>>>>>> 
    >>>>>>>>     Check.
    >>>>>>>> 
    >>>>>>>>> , make sure the subset code in downloads.xml doesn't delete it,
    >>>>>>>> 
    >>>>>>>>     Check.
    >>>>>>>> 
    >>>>>>>>> and then if the transpiled output of, say, Label references 
goog.html.SafeHtml, it should show up in the addDependency line for Label.
    >>>>>>>> 
    >>>>>>>> 
    >>>>>>>>     Here’s where I’m stuck.
    >>>>>>>> 
    >>>>>>>>     That’s what I was expecting, but it doesn’t. I don’t know if 
it’s because it’s a utility function rather than a class or some other reason, 
but goog.html.SafeHtml and friends do not appear as dependencies.
    >>>>>>>> 
    >>>>>>>> 
    >>>>>>>> 
    >>>>>>> 
    >>>>>> 
    >>>>>> 
    >>>>> 
    >>>> 
    >>>> 
    >>> 
    >>> 
    >> 
    >> 
    > 


Reply via email to