Replies: 5 comments 4 replies
-
Thanks for writing this all up!
|
Beta Was this translation helpful? Give feedback.
-
Oh, and maybe a last topic:
|
Beta Was this translation helpful? Give feedback.
-
Theoretically we could declare |
Beta Was this translation helpful? Give feedback.
-
Regarding source maps… I think we shouldn't require them. What we're doing is no worse than the existing ScalaJS stack traces, and is fully compatible (to the best of my understanding) with the the standard approaches to mitigating that problem. In other words, we aren't making anything worse, and we complement the solutions which make everything better. Thus, we should follow ScalaJS's approach and not make the maps mandatory. Though, I would not be averse to mentioning them in the documentation. Regarding configuration, I don't really have much of a strong opinion on this beyond that I think it should follow any standard-ish JavaScript idioms for doing so. Equally importantly, tracing should be configurable from outside of a ScalaJS environment (e.g. |
Beta Was this translation helpful? Give feedback.
-
Continuing this discussion a bit… There's still one open question, which is whether or not we even should trace under fullOptJS. I'm not sure what users are expecting there. Obviously fullOpt without source maps should not be traced, but fullOpt with source maps is also an open question. If we decide that users simply don't expect the ability to introspect their code or any exceptions which are produced by their code in fullOpt mode, then we can detect fullOpt and trigger dead code elimination on all of the tracing stuff in that case. Realistically, this kind of comes down to ScalaJS user expectations, and it's something I don't have a good feel for. @sjrd can you perhaps weigh in on this point? |
Beta Was this translation helpful? Give feedback.
-
Decision time.
#2207 is starting to look like a dumping ground for new ideas and the scope seems to be changing every 5 minutes. This is really hard for reviewing, and I personally want to get tracing on JS right.
I would like this discussion to be a list of points that we can achieve consensus on, and then split each point into a separate, focused PRs.
It seems that we need a firm decision on the following things:
IMO, source maps are the way to get usable stack traces, especially when we're talking
fullOptJS
. I'm of the opinion that we should include this in our official recommendation, with the caveat that there is a slight set up curve before hand (npm install
and all). On the other hand, this sentence is copy pasted from the official Scala.js website in the Basic Tutorial:If we do make the official recommendation ourselves, this steers us in the direction of only testing the
node
CI with--enable-source-maps
. If we don't make this recommendation, I'm honestly not sure what to do, because the different permutations of options fornode
are getting out of hand.Configure the stack tracing mode using environment variables on
node
. I think this is self explanatory. I would like to not allow easy access to the mutable stack tracing mode. This probably means that browser users have no "easy" way of changing the stack tracing mode. IMO, cached mode is a sane default. This leads me to the next point.Have an escape hatch in the form of a dynamic type containing a
setTracingMode
method, similar to what we have forresetGlobal
on Scala.js. This is a workaround for browser users who care enough about changing the default stack tracing mode.However, (and I'm a bit ill-informed here), is there good source map support for Scala.js in the browser? Personally I'm not a huge fan of how stack traces look on Firefox (you can see them in the PR). Are browsers even considered a supported execution environment for Scala.js? I feel like Node is the officially supported choice, but what about the browsers.
Feel free to add any points that you think I have missed in summarizing.
cc @armanbilge @djspiewak
Beta Was this translation helpful? Give feedback.
All reactions