Skip to content

feat(multi-entry)!: ensure deterministic order#1879

Merged
shellscape merged 3 commits intorollup:masterfrom
GauBen:feat/deterministic-multientry
Oct 4, 2025
Merged

feat(multi-entry)!: ensure deterministic order#1879
shellscape merged 3 commits intorollup:masterfrom
GauBen:feat/deterministic-multientry

Conversation

@GauBen
Copy link
Copy Markdown
Contributor

@GauBen GauBen commented Jun 24, 2025

Rollup Plugin Name: multi-entry

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

Not sure if this is a fix or a feature (it's both), but files are not deterministically sorted on all platforms (when caps are involved for instance).

This PR sorts the files with JS .sort(), which is deterministic. We cannot use .toSorted() as the plugin should work with Node 14+ (available in Node 20+).

This is not technically a breaking change, because the order is currently undefined, but I get why this might be refused for a minor release.

This can also be added as an option, tell me if it is more sensible

@GauBen GauBen requested a review from shellscape as a code owner June 24, 2025 14:24
@GauBen GauBen changed the title feat: ensure multi-entry is deterministic feat(multi-entry): ensure deterministic order Jun 24, 2025
@shellscape shellscape changed the title feat(multi-entry): ensure deterministic order feat(multi-entry): ensure deterministic order. Sep 4, 2025
@shellscape
Copy link
Copy Markdown
Collaborator

@GauBen sounds like a reasonable change to me. I see no reason why we can't just make this a major version.

@shellscape shellscape changed the title feat(multi-entry): ensure deterministic order. feat(multi-entry): ensure deterministic order Oct 4, 2025
@shellscape shellscape changed the title feat(multi-entry): ensure deterministic order feat(multi-entry)!: ensure deterministic order Oct 4, 2025
@shellscape shellscape merged commit 33cd373 into rollup:master Oct 4, 2025
3 of 5 checks passed
kr8n3r added a commit to alphagov/notifications-admin that referenced this pull request Apr 21, 2026
Plugin-multi-entry introduced a breaking change in v7
of always creating a deterministic output which uses sort()
- rollup/plugins#1879

 For the legacy bundle, we need the order of
 dependencies to be fixed.

 Instead of continuing to use this dependency,
 we have our own "plugin" which concatenates
 those files. In the build, we make sure
 that `this` means `window` context and that the
 file as before.
kr8n3r added a commit to alphagov/notifications-admin that referenced this pull request Apr 24, 2026
Plugin-multi-entry introduced a breaking change in v7
of always creating a deterministic output which uses sort()
- rollup/plugins#1879

 For the legacy bundle, we need the order of
 dependencies to be fixed.

 Instead of continuing to use this dependency,
 we have our own "plugin" which concatenates
 those files. In the build, we make sure
 that `this` means `window` context and that the
 file as before.

 Async load suggestion by @tombye
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