-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Improvements to new resolver #8844
Conversation
specifier: &'s str, | ||
from: &Path, | ||
specifier_type: SpecifierType, | ||
options: ResolveOptions, |
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.
Is there a case where there you'd want no conditions to apply (and then this should be an Option<ResolveOptions>
)? Probably not..
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.
You mean to disable the import/require conditions but not add any in its place? Hmm... not sure.
Benchmark ResultsKitchen Sink ✅
Timings
Cold Bundles
Cached Bundles
React HackerNews ✅
Timings
Cold BundlesNo bundle changes detected. Cached BundlesNo bundle changes detected. AtlasKit Editor ✅
Timings
Cold BundlesNo bundle changes detected. Cached BundlesNo bundle changes detected. Three.js ✅
Timings
Cold BundlesNo bundle changes detected. Cached BundlesNo bundle changes detected. |
* upstream/v2: Missing edge for multiple targets (parcel-bundler#8854) Split large runtime manifest into separate bundles (parcel-bundler#8837) Improvements to new resolver (parcel-bundler#8844) Fix published files for resolver New resolver implementation in Rust (parcel-bundler#8807) Update yarn.lock (parcel-bundler#8843) Bump napi-rs to latest (parcel-bundler#8838)
* upstream/v2: (128 commits) [webextension] Add support for `chrome_style` (#8867) Switch to SWC minifier by default (#8860) Use BitSet for bundler intersections (#8862) best key logic truncating package names (#8865) Add support for loadConfig to resolver plugins (#8847) Missing edge for multiple targets (#8854) Split large runtime manifest into separate bundles (#8837) Improvements to new resolver (#8844) Fix published files for resolver New resolver implementation in Rust (#8807) Update yarn.lock (#8843) Bump napi-rs to latest (#8838) Support .proxyrc.cjs (#8833) Sort global deps before injecting imports (#8818) Sort CSS module exports (#8817) fix: add extra information to unique bundles (#8784) Don't blow up HMR when <link />s don't have hrefs (#8800) v2.8.3 Changelog for v2.8.3 Address bug by updating an asset reference and merge conditions (#8762) ...
This implements two improvements to the new resolver from #8807 based on feedback in #4155.
.json
extension can be omitted from the tsconfig "extends" field. The behavior now matches TSC.sass
,less
,stylus
, andstyle
conditions that are supported by webpack.For performance reasons, we store commonly used conditions as bit flags in dependencies internally, with custom conditions stored as strings. This is done transparently to plugin authors. The rust resolver also uses a similar strategy.
When
packageConditions
is specified on a dependencies, it overrides the default "import" and "require" conditions that are normally inferred from thespecifierType
. These can be included explicitly if desired. This is so dependencies in style files don't use these conditions and end up resolving to JavaScript. The environment-based conditions such as browser/node/production/development/etc are merged with these conditions.This also adds an options parameter to the
resolve
function that is passed to transformers so that thespecifierType
andpackageConditions
can be customized.