-
Notifications
You must be signed in to change notification settings - Fork 4
Import the JS Envs projects from the Scala.js core repository. #1
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
Conversation
A JS_DEPENDENCIES manifest file is added to each configuration classpath and exported in JARs. This way, libraries may declare what exact JS files should be included from a WebJar they depend on. (Or what JS files they provide themselves should be included). Example usages can be found in the build definitions for the jasmine-test-framework and the testing example. - This completely removes `importScripts` and fixes scala-js/scala-js#457 - The project's classpath is fully available even in the post package stages. This is necessary to allow for discovery of dependency manifests and JS libraries the project depends on.
- Fix scala-js/scala-js#442: Add Phantom.js environment - Add a setting whether a project requires the DOM
…tput Send printlns to the console, not the logger.
The new API allows for classpaths to be partially linked (n.b. packageExternalDeps, this commit fixes scala-js/scala-js#609).
JSEnv#runJS used to return Some(<string>) if it failed due to historical reasons. This is no longer necessary and introduces useless clutter and confusion (e.g. runners failing without the outer code failing). runJS now throws an exception if it fails.
… JS identifiers
…s#958) This commit removes support for `__ScalaJSExportsNamespace`. Use `__ScalaJSEnv.exportsNamespace` instead.
In order to be able to use normal Node.js modules, the NodeJSEnv must respect NODE_PATH from the environment and properly merge it with its own provided library path (for CommonJS-style includes).
Fix scala-js/scala-js#1240: Add stop() to AsyncJSEnv
Back when that hack was introduced in 1fc8d0526ba9b46049c0deefc3fe3fa93d3271b0, Node.js' `console.log` deduplicated consecutive `%` signs in its argument, even if it was a single argument. At the time we thought that was intentional, and we added our hack to have it behave in a more standard way for Scala.js. The deduplication with only 1 argument turned out to be a bug, recognized as such in nodejs/node#3396, when it was accidentally fixed in Node.js 4. It is now the documented behavior, see https://nodejs.org/api/util.html#util_util_format_format_args which is referenced from https://nodejs.org/api/console.html#console_console_log_data_args.
This has been added way back in the days (scala-js/scala-js#958) as a poor man's way to support asynchronous testing. Since then, testing has substantially matured. Notably a JSEnv is not required anymore to be able to terminate automatically. Therefore, there is no need anymore to support exiting in a platform agnostic manner. Or if there is a need or such a thing, it should be put in an external library with JS-style dynamic platform detection. Unfortunately this makes the JSEnv test suite slightly more complicated again (and basically reverts 6746cf3a20d2497bbc6c520666a47f7ec1cd28dd).
…ort ES module errors. Backported from master.
Class#newInstance is deprecated.
And specialize them to the particular needs of each subproject: * `java.lang.StringBuilder` versus `java.io.Writer` instead of the generic `java.lang.Appendable`. * With or without tracking of how many characters are written out. Also review and specialize the one in `ir`.
This is a follow-up from scala-js/scala-js#3646.
It is not possible to cross-compile `@deprecatedName`s without warnings between Scala 2.12- and 2.13+, because: * In 2.12, they require symbol literals as arguments * In 2.13, symbol literals are deprecated Since they were deprecated more than two years ago, and are part of an API that is not used much anyway (JS envs), I believe it is fair to drop the source compatibility in this case.
…cts. Partest is not yet enabled in this commit, because a dependency of `partest` 2.13.0, namely `testkit`, was not published. See scala/bug#11529 upstream.
Partest is not yet enabled in this commit, because a dependency of `partest` 2.13.0, namely `testkit`, was not published. See scala/bugscala-js/scala-js#11529 upstream.
This includes d5021d2d0, 45cf1cff7, c4d50703b and fd2343eb9.
This removes the last references to `JavaConverters` in our codebase, excluding scalalib overrides and comments.
require(msgs.isEmpty) | ||
callOnOutputStream(config) | ||
new TestRun | ||
} | ||
|
||
def startWithCom(input: Input, config: RunConfig, onMessage: String => Unit): JSComRun = { | ||
def startWithCom(input: Seq[Input], config: RunConfig, onMessage: String => Unit): JSComRun = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The two changes here are necessary because the file was not compiling as is. It turns out we were not running jsEnvsTestKit/test
in the core repo!
// Links to the JavaDoc do not work | ||
Compile / doc / scalacOptions -= "-Xfatal-warnings", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that I deactivate fatal warnings in Scaladoc, because links to the JavaDoc, including in @throws
sections, do not work and report errors. We could fix this by doing all the heavy machinery that we do in scala-js/scala-js to patch up the JavaDoc links, but I found that overkill right now.
This is the initial import of the JS Envs projects (scalajs-js-envs, scalajs-js-envs-test-kit and scalajs-env-nodejs) from the Scala.js core repository. The history of this commit reflects the entire history of relevant files from the core repo, filter-branch'ed to appear as if they had always been in this repo. This commit adds the specific setup of the build and tests.
This is the initial import of the JS Envs projects (scalajs-js-envs, scalajs-js-envs-test-kit and scalajs-env-nodejs) from the Scala.js core repository. The history of this commit reflects the entire history of relevant files from the core repo, filter-branch'ed to appear as if they had always been in this repo. This commit adds the specific setup of the build and tests.
This has been done similarly to scala-js/scala-js-env-phantomjs#1 and scala-js/scala-js-env-jsdom-nodejs#1.
The history was obtained as follows, starting from commit scala-js/scala-js@c82fa8c of the core repo.
First, we identified all the paths where relevant files have lived in the past, through renamings along their history. A useful command:
This is the list:
Based on that, we filter-branch'ed to keep only those files, using the following incantation, inspired by http://stackoverflow.com/a/6006679/1829647:
That gave the result visible in https://github.com/sjrd/scala-js-js-envs/commits/import-from-core-step-1. However that includes the files specific to Rhino, PhantomJS and JSDOMNodeJSEnv, which we want to get rid off. We do this with:
giving https://github.com/sjrd/scala-js-js-envs/commits/import-from-core-step-2
Unfortunately,
--prune-empty
does not prune empty merge commits. We fixed that using the solution found in http://stackoverflow.com/a/38420284/1829647:git filter-branch --prune-empty --parent-filter 'sed "s/-p //g" | xargs -r git show-branch --independent | sed "s/\</-p /g"'
giving https://github.com/sjrd/scala-js-js-envs/commits/import-from-core-step-3
Now, we had a clean history, except that it was orphaned wrt. the Initial commit of this repository, which is e9d986c. To have a nice PR with a history that appears to have come from the Initial commit, we reattached the first commit to the Initial commit using:
git filter-branch --parent-filter 'sed "s/^\$/-p e9d986c60d0e44853f4c0faa9d901995a3f239f9/"' HEAD
which yielded https://github.com/sjrd/scala-js-js-envs/commits/import-from-core-step-4.
Almost there, except that now the files from the Initial commit have been removed in the first meaningful commit of the filter-branch. We restored them using:
git filter-branch --index-filter 'git reset e9d986c60d0e44853f4c0faa9d901995a3f239f9 -- .gitignore LICENSE README.md'
giving the history in https://github.com/sjrd/scala-js-js-envs/commits/import-from-core-step-5.
As a final polish, we rewrite, in commit messages, references to tickets of the form
#123
toscala-js/scala-js#123
, so that they point to issues in the scala-js/scala-js repository. This is done using the following incantation:git filter-branch --msg-filter 'sed -r -e "s/(#[0-9]+)/scala-js\/scala-js\1/g"'
and gives the result in https://github.com/sjrd/scala-js-js-envs/commits/import-from-core-step-6.
This PR is one commit on top of that final step.