This repository has been archived by the owner on Jul 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Actually use our linker as the linker for sample/fastLinkJS. #47
Merged
Commits on Mar 31, 2024
-
We will need the Wasm backend to be built for 2.12.x in order to load it as a true linker from the sbt build.
Configuration menu - View commit details
-
Copy full SHA for ae074fb - Browse repository at this point
Copy the full SHA ae074fbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0def8eb - Browse repository at this point
Copy the full SHA 0def8ebView commit details -
Use an
OutputDirectory
inCompiler
to write the output.This way, we do not depend on Scala.js-specific APIs.
Configuration menu - View commit details
-
Copy full SHA for 8eab4df - Browse repository at this point
Copy the full SHA 8eab4dfView commit details -
Configuration menu - View commit details
-
Copy full SHA for f50253a - Browse repository at this point
Copy the full SHA f50253aView commit details -
Write the output of each linking in a separate directory.
An `OutputDirectory` is not supposed to be shared.
Configuration menu - View commit details
-
Copy full SHA for 81b1ec2 - Browse repository at this point
Copy the full SHA 81b1ec2View commit details -
Derive the name of the output files from the module IDs.
And delete stray files in the output directories, as is mandated by the contract of a linker backend.
Configuration menu - View commit details
-
Copy full SHA for 28f7c8b - Browse repository at this point
Copy the full SHA 28f7c8bView commit details -
Configuration menu - View commit details
-
Copy full SHA for df81d57 - Browse repository at this point
Copy the full SHA df81d57View commit details -
Replace the
Compiler
entry point by a realLinkerBackend
.This follows the architecture of the Scala.js linker.
Configuration menu - View commit details
-
Copy full SHA for 44b5cb7 - Browse repository at this point
Copy the full SHA 44b5cb7View commit details -
Make the linker backend actually produce the specified output shape.
In addition to emitting the `.wasm` and `.wat` files in the output directory, we now also emit emit the internal `__loader.js` file, and the public module specified by the `ModuleSet`, such as `main.js`. We embed the content of the loader as a constant string in the backend, so that it works both on the JVM and on JS. Eventually, we will probably generate it more dynamically from `backend.javascript.Trees` anyway, so this not really a big deal. This change requires to adapt the loading mechanism to force URL resolution against the base directory of the `loader.js` file, rather than the working directly. We do this thanks to `import.meta.url`, which is also available in browsers. As is, this change destroys the semantics of top-level exported `var`s. Mutations performed after the module initializers have completed will not be reflected in the exports of `main.js`. We will need to revisit this later on, with a technique similar to the one used by the JS backend. With these changes, our linker backend actually abides by the specification of a `LinkerBackend`, which means we will be able to directly use it from sbt.
Configuration menu - View commit details
-
Copy full SHA for 1e0f2e2 - Browse repository at this point
Copy the full SHA 1e0f2e2View commit details
Commits on Apr 1, 2024
-
Actually use our linker as the linker for
sample/fastLinkJS
.Now, `sample/fastLinkJS` uses our WebAssembly linker, and `sample/run` actually executes the `main` method of the sample project, linked to WebAssembly.
Configuration menu - View commit details
-
Copy full SHA for b1b51ed - Browse repository at this point
Copy the full SHA b1b51edView commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.