rollup / rollup/rollup

UMD Wrapper Intro Documentation

Open
#3,850 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
26.3k
Forks
1.8k
Avg merge
2d 11h
Merged PRs (30d)
20

Description

Documentation Is:

  • Missing
  • Needed
  • Confusing
  • Not Sure?
Please Explain in Detail...

I'm currently looking at:

https://github.com/rollup/rollup/blob/51e727c99bfc67a6bc46087c63950cec2a7fe12f/src/finalisers/umd.ts#L147-L153

And noticed that it is using an older UMD template. It appears the template was changed here:
https://github.com/umdjs/umd/pull/22

I came across this when I was comparing the output from @babel/plugin-transform-modules-umd vs Rollup and saw that they were different. Babel's plugin does use the newer syntax.

It is nice to see both Babel and Rollup supporting globalThis.

Your Proposal for Changes

This may be a non-issue since Rollup is the build tool, but umd.ts might benefit from a small comment explaining the reason why it does not use the version that puts AMD first, or at the very least noting that it is intentional.

Compared to other open issues, I see this as a low priority. I couldn't find an existing issue that seemed to fit, so I opened a new one.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/finalisers/umd.ts around lines 147-153 and compare the referenced UMD template change with Babel's UMD output. Check whether the existing wrapper choice is intentional; done means the rationale is clearly documented there if maintainers agree that clarification is needed.

Written by the indexing model from the issue text.

Assessment

Tech stack
babel, javascript, typescript
Domain
build-system, documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.