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

Fully support arbitrary module namespace identifiers for all formats #5298

Merged
merged 2 commits into from Dec 13, 2023

Conversation

lukastaegert
Copy link
Member

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:

Description

This should bring full support for arbitrary module namespace identifiers at last. While we already had partial support for some time, our parser now fully supports all variations since we switched to SWC. Unfortunately, we did not properly render these cases, though.
This PR seeks to fix all relevant scenarios:

  • imported bindings from external dependencies that need to be quoted/escaped
  • exported bindings that need to be quoted/escaped
  • bindings in namespace objects that need to be quoted/escaped

Copy link

vercel bot commented Dec 12, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rollup ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 13, 2023 5:29am

@lukastaegert lukastaegert changed the title Support arbitrary module namespace identifiers Fully support arbitrary module namespace identifiers for all formats Dec 12, 2023
Copy link

github-actions bot commented Dec 12, 2023

Thank you for your contribution! ❤️

You can try out this pull request locally by installing Rollup via

npm install rollup/rollup#arbitrary-namespace-identifiers

Notice: Ensure you have installed Rust nightly. If you haven't installed it yet, please first see https://www.rust-lang.org/tools/install to learn how to download Rustup and install Rust, then see https://rust-lang.github.io/rustup/concepts/channels.html to learn how to install Rust nightly.

or load it into the REPL:
https://rollup-r16jp2hpv-rollup-js.vercel.app/repl/?pr=5298

Copy link

codecov bot commented Dec 12, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7f9d85c) 98.82% compared to head (1381e95) 98.82%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5298   +/-   ##
=======================================
  Coverage   98.82%   98.82%           
=======================================
  Files         232      232           
  Lines        8962     8968    +6     
  Branches     2336     2338    +2     
=======================================
+ Hits         8857     8863    +6     
  Misses         46       46           
  Partials       59       59           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lukastaegert lukastaegert merged commit 44889e0 into master Dec 13, 2023
28 checks passed
@lukastaegert lukastaegert deleted the arbitrary-namespace-identifiers branch December 13, 2023 09:11
Copy link

This PR has been released as part of rollup@4.9.0. You can test it via npm install rollup.

@guybedford
Copy link
Contributor

Great to see this fixed, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants