Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify sample code #45

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Clarify sample code #45

wants to merge 1 commit into from

Conversation

japgolly
Copy link

@japgolly japgolly commented Jun 9, 2020

  • Add explicit import
  • prefix SBT keys by Test / as it's going to be the 90%+ case

Comment on lines -16 to +20
jsEnv := PhantomJSEnv().value
scalaJSLinkerConfig ~= { _.withESFeatures(_.withUseECMAScript2015(false)) }
Test / jsEnv := PhantomJSEnv().value
Test / scalaJSLinkerConfig ~= { _.withESFeatures(_.withUseECMAScript2015(false)) }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I agree with those changes. It's fairly intentional that we don't specify Test /, so that the two settings apply equally in the Compile and Test configurations. Did you have a specific issue by not putting them in Test /?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrt the jsEnv, no issue; just limiting it's scope. The scalaJSLinkerConfig OTOH is critical that I scope by Test because I don't the real/main/non-test output coming out in ES3. I want to keep the main artifacts on ES6 and only limit the test JS to ES3 for PhantomJS. I could be wrong but I think the 99% case is going to be running tests cos it's 1 or 2 orders of magnitude faster than Node.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hum, I see. In that case I would still prefer that we keep the general form first, but we can a paragraph afterwards starting with something like "If you want the changes above to only apply in the Test configuration, you can scope the settings with Test / as follows:"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants