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.
Unlike the Glimmer VM monorepo, where packages are self-contained (i.e. they don't depend on any packages outside the monorepo), packages in Glimmer.js do have dependencies on external packages.
Ideally, we could:
This pull request resolves all three of these issues.
At a high level, it works by generating a single entry point file that uses JS module syntax to import every test file in the system. That entry point file is passed to Rollup, which begins loading the test files.
Dependencies encountered while Rollup builds the bundle are handled in one of two ways:
monorepo-resolver
Rollup plugin will look at the importers path and, if originating from a file in apackages/
directory, delegates torollup-plugin-node-resolve
to resolve relative to that directory.node-resolve
Rollup plugin is configured to look up compiled Glimmer.js packages from a previous Broccoli transform.Effectively, the lookup rules while building the tests are (relative to the project root):
./packages/@glimmer/{pkg}/node_modules
./node_modules
./dist
In my tests, both bootstrapping the project, doing a build and running the tests are faster to varying degrees. More importantly, this change means that we don't have to worry about what happens if we ever have conflicting dependencies across two packages. It also means that debugging in tests is much easier since we don't have triplicate versions of every Glimmer VM package, only one of which is actually used.