I'm not sure this is working properly. Here are some observations:
I'm seeing a very strange error with my Royale application Firefox (see
initially in a release build), and I have no idea how/where it is coming from:
Uncaught TypeError: Error #1034: Type Coercion failed: cannot convert "function
Function() {
[native code]
}" to Class.
I switched back to debug and noticed the same error with Firefox. When trying
to click on the console class/line numbers, I see the follow paths for all of
the files:
http://localhost/frameworks/projects/%7B$project.artifactId%7D/org/apache/royale/utils/Language.as
I was able to set " -source-map-source-root=/;", and that seemed to resolve the
path issue with my project, but the "as" files are not within the debug output.
FYI, this only seemed to work for debug mode. Attempting to build source-maps
for my release mode was doing something even stranger.. injecting the full
absolute path to my project files in the js map file -- making it even less
usable.
How are we supposed to debug things like this? Do I need to host the framework
in my webserver and set "-source-map-source-root=/<to my framework location>;"
to make this work?
How can I use "source-map-source-root" for release mode to help identify build
issues?
Thank you,
Brian
-----Original Message-----
From: Carlos Rovira <[email protected]>
Sent: Thursday, January 7, 2021 11:12 AM
To: Apache Royale Development <[email protected]>
Subject: [EXTERNAL] Re: Configuring source maps on Royale with new compiler
options
Hi,
just fyi I added:
-source-map-source-root=/frameworks/projects/{$project.artifactId}/
at frameworks/projects/pom.xml
so now we have setup source maps in all libraries
but while that seems ok, I'm not getting lib debugging as I stated in my last
email.
El jue, 7 ene 2021 a las 20:07, Carlos Rovira (<[email protected]>)
escribió:
> Ok Josh,
>
> so all seems ok, but debug is not working in classes from Jewel lib.
> I see the jewel.swc has the js.map files in the same way I related, so
> that's ok as you stated.
> I'm setting breakpoints in the same VSCode window for Jewel and TDJ
> files, but only TDJ files (in the root or subfolders) are making execution
> stop.
> If I set up a breakpoint in let's say Jewel Button.as, that appears
> empty on execution and doesn't have effect, while TDJ appears red and works
> ok.
>
> Do you know what could be happening?
>
>
>
> El jue, 7 ene 2021 a las 19:57, Josh Tynjala
> (<[email protected]>)
> escribió:
>
>> The path of the .js.map file is relative to the .js file. Since the
>> .js.map file is supposed to be in the same folder as the .js file,
>> that looks correct to me.
>>
>> --
>> Josh Tynjala
>> Bowler Hat LLC <https://bowlerhat.dev>
>>
>>
>> On Thu, Jan 7, 2021 at 10:28 AM Carlos Rovira
>> <[email protected]>
>> wrote:
>>
>> > Hi Josh,
>> >
>> > I'm trying to debug jewel classes in TDJ and for example
>> AlertController.js
>> > has at the end:
>> >
>> > //# sourceMappingURL=./AlertController.js.map
>> >
>> > It's ok? I expect it to reference the concrete subfolder:
>> > org/apache/royale/jewel/beads/controllers
>> >
>> >
>> >
>> > El jue, 7 ene 2021 a las 18:23, Josh Tynjala (<
>> [email protected]>)
>> > escribió:
>> >
>> > > Yes, you're right that +royalelib should not be required for
>> > > framework libs. I wasn't paying close enough attention to see
>> > > that you had added
>> > > +royalelib to both Jewel and TDJ.
>> > >
>> > > So, to summarize, you should use source-map-source-root when
>> > > building framework libs, and you should use +royalelib when
>> > > building
>> > examples/apps.
>> > > +royalelib is not necessary for framework libs, and
>> > source-map-source-root
>> > > is (generally) not necessary for examples/apps.
>> > >
>> > > --
>> > > Josh Tynjala
>> > > Bowler Hat LLC <https://bowlerhat.dev>
>> > >
>> > >
>> > > On Thu, Jan 7, 2021 at 7:43 AM Carlos Rovira
>> > > <[email protected]
>> >
>> > > wrote:
>> > >
>> > > > Hi Josh,
>> > > >
>> > > > I discover right now that I was understanding wrong how all
>> > > > this
>> works.
>> > > > I thought we needed +royalelib in framework libs, but it's not
>> > > > the
>> > case.
>> > > > Just need to add +royalelib to a final project, so that can be
>> > > > left
>> to
>> > > the
>> > > > user.
>> > > >
>> > > > That means that we can add to all libs this:
>> > > > -source-map-source-root=/frameworks/projects/XXX/target/
>> > > > (Where XXX is the root libraryfolder) -> For this I'll be
>> > > > adding in
>> a
>> > > > commit soon
>> > > >
>> > > > So, Chris, we don't need anything more to implement, as I
>> > > > commit the -source-map-source-root line in all framework poms.
>> > > >
>> > > > Another thing is if we should upload all source maps (js.map
>> > > > files)
>> of
>> > > all
>> > > > framework libs to some r.a.o url (for example /debug), and if
>> > > > people
>> > can
>> > > > point with +royalelib (i.e: +royalelib=
>> http://royale.apache.org/debug
>> > )
>> > > >
>> > > > What do you think?
>> > > >
>> > > >
>> > > >
>> > > > El mié, 6 ene 2021 a las 18:35, Josh Tynjala (<
>> > [email protected]
>> > > >)
>> > > > escribió:
>> > > >
>> > > > > While we can set source-map-source-root in all of the library
>> > > projects, I
>> > > > > don't think that there's any way for us to specify +royalelib
>> > > > > for
>> TDJ
>> > > and
>> > > > > other examples in a general way. That's the one thing that
>> > > > > users
>> will
>> > > > > probably need to set up manually because the source files
>> > > > > come
>> from
>> > an
>> > > > > IDE-compatible SDK.
>> > > > >
>> > > > > --
>> > > > > Josh Tynjala
>> > > > > Bowler Hat LLC <https://bowlerhat.dev>
>> > > > >
>> > > > >
>> > > > > On Wed, Jan 6, 2021 at 3:21 AM Carlos Rovira <
>> > [email protected]>
>> > > > > wrote:
>> > > > >
>> > > > > > Hi Greg, Harbs and others
>> > > > > >
>> > > > > > can you check my new commit on Jewel and TDJ poms to get
>> sourcemaps
>> > > in
>> > > > > > framework?
>> > > > > > We'll need to change the line:
>> > > > > >
>> > > > > >
>> +royalelib=/Users/carlosrovira/Dev/Royale/Sdks/apache-royale-maven
>> > > > > >
>> > > > > > for another more generalistic tha allow anyone of us to
>> > > > > > debug,
>> but
>> > I
>> > > > > think
>> > > > > > that will mean to upload sourcemaps to some r.a.o url?
>> > > > > >
>> > > > > > What it could be and would this be possible?
>> > > > > >
>> > > > > > Thanks
>> > > > > >
>> > > > > >
>> > > > > > El mié, 6 ene 2021 a las 12:12, Carlos Rovira (<
>> > > > [email protected]
>> > > > > >)
>> > > > > > escribió:
>> > > > > >
>> > > > > > > Hi Josh, Thanks! That worked and I finally have debugging
>> again!
>> > :D
>> > > > > > >
>> > > > > > > El mar, 5 ene 2021 a las 17:34, Josh Tynjala (<
>> > > > > [email protected]
>> > > > > > >)
>> > > > > > > escribió:
>> > > > > > >
>> > > > > > >> Hey Carlos,
>> > > > > > >>
>> > > > > > >> Try using source-map-source-root with Jewel only, and
>> > > > > > >> omit it
>> > from
>> > > > > TDJ.
>> > > > > > >>
>> > > > > > >> Jewel:
>> > > > > > >>
>> > > > > > >> <additionalCompilerOptions>
>> > > > > > >>
>> > +royalelib=/Users/carlosrovira/Dev/Royale/Sdks/apache-royale-maven
>> > > > > > >> -source-map=true;
>> > > > > > >> -source-map-source-root=/frameworks/projects/Jewel/
>> > > > > > >> </additionalCompilerOptions>
>> > > > > > >>
>> > > > > > >> TDJ:
>> > > > > > >>
>> > > > > > >> <additionalCompilerOptions>
>> > > > > > >>
>> > +royalelib=/Users/carlosrovira/Dev/Royale/Sdks/apache-royale-maven
>> > > > > > >> -source-map=true;
>> > > > > > >> </additionalCompilerOptions>
>> > > > > > >>
>> > > > > > >> I hadn't noticed before that you were also trying to use
>> > > > > > >> it
>> with
>> > > TDJ
>> > > > > > too.
>> > > > > > >> You usually want to use the default source root for an
>> > > > > > >> app
>> > > project,
>> > > > > > unless
>> > > > > > >> you have a specific reason for changing it.
>> > > > > > >>
>> > > > > > >> --
>> > > > > > >> Josh Tynjala
>> > > > > > >> Bowler Hat LLC <https://bowlerhat.dev>
>> > > > > > >>
>> > > > > > >>
>> > > > > > >> On Mon, Jan 4, 2021 at 1:16 AM Carlos Rovira <
>> > > > [email protected]
>> > > > > >
>> > > > > > >> wrote:
>> > > > > > >>
>> > > > > > >> > Hi Chis,
>> > > > > > >> >
>> > > > > > >> > to get debugging in Royale we now have additional
>> > > > > > >> > compiler
>> > > option
>> > > > > > called
>> > > > > > >> > "source-map-source-root" that complements "source-map".
>> > > > > > >> > I try this (without referring to `target` folder as
>> > > > > > >> > Josh
>> > said):
>> > > > > > >> >
>> > > > > > >> > In Jewel:
>> > > > > > >> >
>> > > > > > >> > <additionalCompilerOptions>
>> > > > > > >> >
>> > > +royalelib=/Users/carlosrovira/Dev/Royale/Sdks/apache-royale-mave
>> > > +n
>> > > > > > >> > -source-map=true;
>> > > > > > >> > -source-map-source-root=/frameworks/projects/Jewel/
>> > > > > > >> > </additionalCompilerOptions>
>> > > > > > >> >
>> > > > > > >> > and in TDJ:
>> > > > > > >> >
>> > > > > > >> >
>> > > +royalelib=/Users/carlosrovira/Dev/Royale/Sdks/apache-royale-mave
>> > > +n
>> > > > > > >> > -source-map=true;
>> > > > > > >> > -source-map-source-root=/examples/jewel/TourDeJewel
>> > > > > > >> > </additionalCompilerOptions>
>> > > > > > >> >
>> > > > > > >> > but no luck.
>> > > > > > >> >
>> > > > > > >> > So if +royalelib doesn't work for Maven maybe it
>> > > > > > >> > should be
>> > > > something
>> > > > > > >> like
>> > > > > > >> > "-source-map-source-root=$$$/frameworks/projects/Jewel
>> > > > > > >> > /",
>> > where
>> > > > $$$
>> > > > > > is a
>> > > > > > >> > token for a valid SDK.
>> > > > > > >> > As Josh said "Maven does not have an IDE-compatible
>> > > > > > >> > SDK",
>> so I
>> > > > think
>> > > > > > we
>> > > > > > >> > need to add some -DroyaleSDK var like we do when
>> > > > > > >> > create
>> > > > > distribution?
>> > > > > > Or
>> > > > > > >> > maybe you have a better idea.
>> > > > > > >> >
>> > > > > > >> > So we'll need to configure that var in local, in build
>> server,
>> > > and
>> > > > > so
>> > > > > > on
>> > > > > > >> > to generate the right pahs.
>> > > > > > >> > Hope this make sense.
>> > > > > > >> >
>> > > > > > >> > Carlos
>> > > > > > >> >
>> > > > > > >> >
>> > > > > > >> >
>> > > > > > >> > El lun, 4 ene 2021 a las 8:31, Christofer Dutz (<
>> > > > > > >> [email protected]>)
>> > > > > > >> > escribió:
>> > > > > > >> >
>> > > > > > >> >> Hi all,
>> > > > > > >> >>
>> > > > > > >> >> Sure, happy to help, but what exactly do you need?
>> > > > > > >> >>
>> > > > > > >> >> Chris
>> > > > > > >> >> ------------------------------
>> > > > > > >> >> *Von:* Carlos Rovira <[email protected]>
>> > > > > > >> >> *Gesendet:* Sonntag, 3. Januar 2021 23:23
>> > > > > > >> >> *An:* Josh Tynjala <[email protected]>;
>> Christofer
>> > > Dutz
>> > > > <
>> > > > > > >> >> [email protected]>; Apache Royale Development
>> > > > > > >> >> < [email protected]>
>> > > > > > >> >> *Betreff:* Re: Configuring source maps on Royale with
>> > > > > > >> >> new
>> > > > compiler
>> > > > > > >> >> options
>> > > > > > >> >>
>> > > > > > >> >> Thanks Josh,
>> > > > > > >> >>
>> > > > > > >> >> since this seems to be more complicated than I
>> > > > > > >> >> thought
>> due to
>> > > > maven
>> > > > > > >> >> needs, I'll add Chris to the thread, and also the dev
>> mailing
>> > > > list
>> > > > > > >> that was
>> > > > > > >> >> lost on your response.
>> > > > > > >> >> Hope Chris can give us the best way to handle this
>> > > > > > >> >> with
>> his
>> > > maven
>> > > > > > >> >> knowledge.
>> > > > > > >> >>
>> > > > > > >> >> Thanks for your help
>> > > > > > >> >>
>> > > > > > >> >>
>> > > > > > >> >> El dom, 3 ene 2021 a las 23:00, Josh Tynjala (<
>> > > > > > >> [email protected]>)
>> > > > > > >> >> escribió:
>> > > > > > >> >>
>> > > > > > >> >> I'm not sure that it's currently possible to use
>> > > > > > source-map-source-root
>> > > > > > >> >> correctly with Maven because Maven does not have an
>> > > > IDE-compatible
>> > > > > > SDK
>> > > > > > >> >> where the source files are located. The compiler
>> > > > > > >> >> relies on
>> > > > knowing
>> > > > > > >> where
>> > > > > > >> >> the original source files are to set the paths correctly.
>> > > > > > >> >>
>> > > > > > >> >> When building your app (such as TDJ), you could try
>> > > > > > >> >> adding
>> > the
>> > > > > > >> +royalelib
>> > > > > > >> >> option to your additionalCompilerOptions to point to
>> > > > > > >> >> an
>> > > > > > IDE-compatible
>> > > > > > >> SDK.
>> > > > > > >> >>
>> > > > > > >> >> It would look something like this:
>> > > > > > >> >>
>> > > > > > >> >> +royalelib=/path/to/royale-asjs/frameworks/
>> > > > > > >> >>
>> > > > > > >> >> This token (which you'll notice uses + instead of -)
>> > > > > > >> >> tells
>> > the
>> > > > > > compiler
>> > > > > > >> >> where the frameworks folder in an SDK is located.
>> > > > > > >> >> That's
>> how
>> > it
>> > > > > > >> figures out
>> > > > > > >> >> how to map the paths relative to your project.
>> > > > > > >> >>
>> > > > > > >> >> I should also add that I think you may be using the
>> > > > > > >> >> wrong
>> > path
>> > > > with
>> > > > > > the
>> > > > > > >> >> source-map-source-root option. In my examples from an
>> older
>> > > > > thread, I
>> > > > > > >> did
>> > > > > > >> >> not point it at the "target" folder, but its parent
>> instead.
>> > It
>> > > > may
>> > > > > > be
>> > > > > > >> that
>> > > > > > >> >> your setup is different for some reason that I'm not
>> > realizing,
>> > > > > but I
>> > > > > > >> just
>> > > > > > >> >> thought that I'd point out where I could see a
>> > > > > > >> >> difference
>> > with
>> > > > > what I
>> > > > > > >> >> showed before.
>> > > > > > >> >>
>> > > > > > >> >> --
>> > > > > > >> >> Josh Tynjala
>> > > > > > >> >> Bowler Hat LLC <https://bowlerhat.dev>
>> > > > > > >> >>
>> > > > > > >> >>
>> > > > > > >> >> On Sun, Jan 3, 2021 at 11:03 AM Carlos Rovira <
>> > > > > > [email protected]
>> > > > > > >> >
>> > > > > > >> >> wrote:
>> > > > > > >> >>
>> > > > > > >> >> Hi Josh,
>> > > > > > >> >>
>> > > > > > >> >> I have a little time now and want to try to set up
>> sourcemaps
>> > > on
>> > > > > > Royale
>> > > > > > >> >> by default. For this to happen we need a solution
>> > > > > > >> >> that is
>> > > general
>> > > > > so
>> > > > > > it
>> > > > > > >> >> works on local, for people using nightly builds, or a
>> > released
>> > > > SDK.
>> > > > > > >> >>
>> > > > > > >> >> I want to try it locally and ask on list with a final
>> working
>> > > > > > solution
>> > > > > > >> in
>> > > > > > >> >> hand and see if Greg and others are ok with it.
>> > > > > > >> >>
>> > > > > > >> >> I'm trying with this code in Jewel library:
>> > > > > > >> >>
>> > > > > > >> >> <additionalCompilerOptions>
>> > > > > > >> >> -source-map=true;
>> > > > > > >> >>
>> > > > > > -source-map-source-root=/frameworks/projects/Jewel/target/
>> > > > > > >> >> </additionalCompilerOptions>
>> > > > > > >> >>
>> > > > > > >> >> And in TDJ this:
>> > > > > > >> >>
>> > > > > > >> >> -source-map=true;
>> > > > > > >> >>
>> > > > > > -source-map-source-root=/examples/jewel/TourDeJewel/target
>> > > > > > >> >> </additionalCompilerOptions>
>> > > > > > >> >>
>> > > > > > >> >> But I'm not getting it to work when debug TDJ. So I'm
>> > > > > > >> >> a
>> bit
>> > > lost
>> > > > on
>> > > > > > >> this.
>> > > > > > >> >> Can you propose the config so I can try it?
>> > > > > > >> >>
>> > > > > > >> >> Thanks
>> > > > > > >> >>
>> > > > > > >> >>
>> > > > > > >> >> --
>> > > > > > >> >> Carlos Rovira
>> > > > > > >> >> Apache Member & Apache Royale PMC *Apache Software
>> > > > > > >> >> Foundation* http://about.me/carlosrovira
>> > > > > > >> >>
>> > > > > > >> >>
>> > > > > > >> >>
>> > > > > > >> >> --
>> > > > > > >> >> Carlos Rovira
>> > > > > > >> >> Apache Member & Apache Royale PMC *Apache Software
>> > > > > > >> >> Foundation* http://about.me/carlosrovira
>> > > > > > >> >>
>> > > > > > >> >>
>> > > > > > >> >
>> > > > > > >> > --
>> > > > > > >> > Carlos Rovira
>> > > > > > >> > Apache Member & Apache Royale PMC *Apache Software
>> > > > > > >> > Foundation* http://about.me/carlosrovira
>> > > > > > >> >
>> > > > > > >> >
>> > > > > > >>
>> > > > > > >
>> > > > > > >
>> > > > > > > --
>> > > > > > > Carlos Rovira
>> > > > > > > Apache Member & Apache Royale PMC *Apache Software
>> > > > > > > Foundation* http://about.me/carlosrovira
>> > > > > > >
>> > > > > > >
>> > > > > >
>> > > > > > --
>> > > > > > Carlos Rovira
>> > > > > > Apache Member & Apache Royale PMC *Apache Software
>> > > > > > Foundation* http://about.me/carlosrovira
>> > > > > >
>> > > > >
>> > > >
>> > > >
>> > > > --
>> > > > Carlos Rovira
>> > > > Apache Member & Apache Royale PMC *Apache Software Foundation*
>> > > > http://about.me/carlosrovira
>> > > >
>> > >
>> >
>> >
>> > --
>> > Carlos Rovira
>> > Apache Member & Apache Royale PMC
>> > *Apache Software Foundation*
>> > http://about.me/carlosrovira
>> >
>>
>
>
> --
> Carlos Rovira
> Apache Member & Apache Royale PMC
> *Apache Software Foundation*
> http://about.me/carlosrovira
>
>
--
Carlos Rovira
Apache Member & Apache Royale PMC
*Apache Software Foundation*
http://about.me/carlosrovira