Skip to content
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 for library targets #6570

Merged
merged 3 commits into from Jul 9, 2021
Merged

Improvements for library targets #6570

merged 3 commits into from Jul 9, 2021

Conversation

devongovett
Copy link
Member

@devongovett devongovett commented Jul 8, 2021

  • Always enable scope hoisting for library targets, even in development builds. It doesn't make sense to output global JS built with the dev packager into e.g. a module field. This fixes parcel watch with libraries. Fixes parcel watch (v2) cannot build package with module target #5075.
  • Add diagnostics if users attempt to use library targets (either common or custom) without scope hoisting enabled.
  • Prevent the HMR runtime from being inserted into libraries in development.
  • Enable parcel build or parcel watch without any other arguments. This will work the same as parcel build . - i.e. it will look at the source field in package.json.

@height
Copy link

height bot commented Jul 8, 2021

Link Height tasks by mentioning a task ID in the pull request title or description, commit messages, or comments.

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

@parcel-benchmark
Copy link

Benchmark Results

Kitchen Sink 🚨

Timings

Description Time Difference
Cold FAILED -0.00ms
Cached FAILED -0.00ms

Cold Bundles

No bundles found, this is probably a failed build...

Cached Bundles

No bundles found, this is probably a failed build...

React HackerNews ✅

Timings

Description Time Difference
Cold 10.37s +33.00ms
Cached 520.00ms +7.00ms

Cold Bundles

Bundle Size Difference Time Difference
dist/logo.1e014c76.png 274.00b +0.00b 234.00ms -40.00ms 🚀

Cached Bundles

Bundle Size Difference Time Difference
dist/logo.1e014c76.png 274.00b +0.00b 244.00ms -40.00ms 🚀

AtlasKit Editor 🚨

Timings

Description Time Difference
Cold FAILED -0.00ms
Cached FAILED -0.00ms

Cold Bundles

No bundles found, this is probably a failed build...

Cached Bundles

No bundles found, this is probably a failed build...

Three.js ✅

Timings

Description Time Difference
Cold 7.54s +9.00ms
Cached 449.00ms +5.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

Click here to view a detailed benchmark overview.

@devongovett devongovett merged commit 946b141 into v2 Jul 9, 2021
@devongovett devongovett deleted the library-target-fixes branch July 9, 2021 02:15
lettertwo added a commit that referenced this pull request Jul 13, 2021
* v2: (34 commits)
  Wrap assets recursively when any incoming dependency is wrapped (#6572)
  Improvements for library targets (#6570)
  Diagnostic for undeclared external dependencies in library builds (#6564)
  More bugs (#6567)
  Don't require `url:` for image transformer (#6565)
  Remove 'Name already registered with serializer' error (#6566)
  Fix live bindings and `this` of external CommonJS modules (#6548)
  JS runtime improvements (#6531)
  Make sure the absolute path isn't contained in the cache (#5900)
  Adds '@parcel/diagnostic' to dependencies (#6563)
  Disable workers with string literals and improve diagnostics (#6536)
  Bug fixes (#6541)
  Don't attempt to resolve URLs starting with '#' (#6504)
  Correctly set worker's output format if not support by environment (#6534)
  Babel: Recognize peerDependencies in isJSX (#6497)
  fix setHeaders ordering on dev server (#6500)
  Graph: Remove Node interface (#6530)
  Fix TS build script for old Node versions (#6526)
  Improve library targets (#6517)
  Fix TypeScript and other sourcemaps by always creating an initial sourcemap (#6472)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

parcel watch (v2) cannot build package with module target
3 participants