rfcs
rfcs copied to clipboard
Advance RFC #0939 `"Introduce a Wildcard Module Import API"` to Stage Ready for Release
Advance #0939 to the Ready For Release Stage
Summary
This pull request is advancing the RFC to the Ready For Release Stage.
- PR to Accepted Stage: #0939
An FCP is required before merging this PR to advance.
Upon merging this PR, automation will open a draft PR for this RFC to move to the Released Stage.
Ready for Release Stage Description
This stage is complete when the implementation is complete according to plan outlined in the RFC, and is in harmony with any changes in Ember that have occurred since the RFC was first written. This includes any necessary learning materials. At this stage, features or deprecations may be available for use behind a feature flag, or with an optional package, etc.
For codebase changes, there are no open questions that are anticipated to require breaking changes; the Ember team is ready to commit to the stability of any interfaces exposed by the current implementation of the feature.
This stage should include a list of criteria for determining when the proposal can be considered Recommended after being Released.
An FCP is required to move into this stage.
Each Ember core team will be requested as a reviewer on the PR to move into this stage. A representative of each team adds a review. If a team does not respond to the request, and after the conclusion of the FCP, it is assumed that the release may proceed.
Checklist to move to Ready for Release
- [ ] Implementation is complete according to plan outlined in the RFC, with any adjustments noted in the RFC
- [ ] Any necessary learning materials have been updated
- [ ] The Ember team is ready to commit to the stability of any interfaces exposed by the current implementation of the feature. This is the go/no go decision for any feature flags, but the flags should only be turned on when moving to Released.
- [ ] Criteria for moving to the Recommended Stage has been filled out
- [ ] This PR has been converted from a draft to a regular PR and the
Final Comment Periodlabel has been added to start the FCP - [ ] Each team has been added as a reviewer to the PR at the start of the FCP. Reviews are not required by the end of the FCP. This is a notification step.
- Framework @emberjs/framework
- Data @emberjs/ember-data-core
- CLI @emberjs/cli
- Learning @emberjs/learning-core
- Typescript @emberjs/typescript-core
- Steering @emberjs/steering
Criteria for moving to Recommended (required)
A set of criteria for moving this RFC to the Recommended Stage, following release:
Track Implementation
Environment implementations:
- [x] classic (with runtime implementation) https://github.com/NullVoxPopuli/ember-classic-import-meta-glob
- [x] vite (is native)
- [ ] @embroider/webpack
- [ ] ember-auto-import (webpack)
Implementation progress: https://github.com/NullVoxPopuli/ember-classic-import-meta-glob
Other implementation progress: https://github.com/beerinho/ember-glob-import-demo
Some issues I've found with the build-time only implementation (at least for the classic / non-appImports usage),
Other implementation progress: https://github.com/beerinho/ember-glob-import-demo
but as I've been playing around with the implementation (in a local copy of it), I've been tweaking things, making notes, etc.
../isn't supported (useful for going from the tests directory to the app directory- work-around: have a top-level
app/whatever.jsthat you import from tests andapp/whatever.jsdoes the import.meta.glob
- work-around: have a top-level
./doesn't work as expected from within sub-folders because in classic requirejs requires the full moduleName and relative requires aren't a thing- fixing this would require either deriving the moduleName from files babel doesn't normally care about, or requiring a config passed to the babel plugin
- I added a extra
ignoreentry for.d.tsfiles, since that cannot ever make it in to an output file
Implementation progress: https://github.com/NullVoxPopuli/ember-classic-import-meta-glob
- supports
../ - supports
./ - doesn't deal with
.d.ts
however, this does not mean we shouldn't continue pursing the build-time-only approach, as these are all solveable problems with v1 addons
- use v1 addon infra to:
- get the moduleName
- allows solving
../
- allows solving
- install the babel plugin
- get the moduleName
A helpful package here is: path-normalize, which collapses ../ and ./: https://www.npmjs.com/package/path-normalize?activeTab=readme
At the tooling meeting we reviewed the options here and decided the build-time implementation is good. It's good that it will look directly at your authored source, not the broccoli tree downstream of app-tree merging and other broccoli customization, because for compat with v2 apps none of that will be present anyway.