Skip to content

feat: support namespaced name and output.extend for IIFE format.#1861

Merged
underfin merged 36 commits intorolldown:mainfrom
7086cmd:feat/extend-and-namespace-iife
Aug 13, 2024
Merged

feat: support namespaced name and output.extend for IIFE format.#1861
underfin merged 36 commits intorolldown:mainfrom
7086cmd:feat/extend-and-namespace-iife

Conversation

@7086cmd
Copy link
Copy Markdown
Contributor

@7086cmd 7086cmd commented Aug 4, 2024

This pull request supports the use of namespaced names (including the dot character) and the output.extend option for IIFE format aligning with Rollup. Tests are included, and further refactoring is planned (not included in this PR, as it is better to conduct refactoring when more formats are supported, in my opinion).

@netlify
Copy link
Copy Markdown

netlify bot commented Aug 4, 2024

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit 97f37c8
🔍 Latest deploy log https://app.netlify.com/sites/rolldown-rs/deploys/66bb0ffbcde1bf000878de27

@7086cmd 7086cmd marked this pull request as ready for review August 5, 2024 00:24
@7086cmd 7086cmd changed the title feat(wip): support namespaced name and output.extend for IIFE format. feat: support namespaced name and output.extend for IIFE format. Aug 5, 2024
@7086cmd
Copy link
Copy Markdown
Contributor Author

7086cmd commented Aug 5, 2024

Rollup document related:

  • output.name option

    Namespaces are supported i.e. your name can contain dots. The resulting bundle will contain the setup necessary for the namespacing.

    rollup -n "a.b.c"
    
    /* ->
    this.a = this.a || {};
    this.a.b = this.a.b || {};
    this.a.b.c = ...
    */
  • output.extend option

@7086cmd 7086cmd marked this pull request as draft August 6, 2024 06:44
@7086cmd 7086cmd marked this pull request as ready for review August 6, 2024 08:37
@underfin underfin enabled auto-merge August 13, 2024 07:49
@underfin
Copy link
Copy Markdown
Contributor

Thank you.

@underfin underfin added this pull request to the merge queue Aug 13, 2024
Merged via the queue into rolldown:main with commit bfae17d Aug 13, 2024
@7086cmd 7086cmd deleted the feat/extend-and-namespace-iife branch August 13, 2024 08:29
github-merge-queue bot pushed a commit that referenced this pull request Aug 15, 2024
<!-- Thank you for contributing! -->

### Description
Related to #1861 

https://github.com/rolldown/rolldown/blob/745c1a57e66433df7182b5f9f4aa65aa00aa001b/crates/rolldown/src/ecmascript/format/utils/namespace.rs#L49-L51
<!-- Please insert your description here and provide especially info
about the "what" this PR is solving -->
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.

2 participants