Skip to content

Commit 1886d27

Browse files
committed
Merge branch 'master' of https://github.com/rollup/rollup into sync-79d5563a
2 parents 0e8c1f7 + 79d5563 commit 1886d27

File tree

21 files changed

+87
-69
lines changed

21 files changed

+87
-69
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# rollup changelog
22

3+
## 4.50.1
4+
5+
_2025-09-07_
6+
7+
### Bug Fixes
8+
9+
- Resolve a situation where a destructuring default value was removed (#6090)
10+
11+
### Pull Requests
12+
13+
- [#6088](https://github.com/rollup/rollup/pull/6088): feat(www): shorter repl shareables (@cyyynthia, @lukastaegert)
14+
- [#6090](https://github.com/rollup/rollup/pull/6090): Call includeNode for self or children nodes in includeDestructuredIfNecessary (@TrickyPi)
15+
- [#6091](https://github.com/rollup/rollup/pull/6091): fix(deps): update rust crate swc_compiler_base to v33 (@renovate[bot])
16+
- [#6092](https://github.com/rollup/rollup/pull/6092): chore(deps): lock file maintenance minor/patch updates (@renovate[bot])
17+
- [#6094](https://github.com/rollup/rollup/pull/6094): perf: replace startsWith with strict equality (@btea)
18+
319
## 4.50.0
420

521
_2025-08-31_

browser/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rollup/browser",
3-
"version": "4.50.0",
3+
"version": "4.50.1",
44
"description": "Next-generation ES module bundler browser build",
55
"main": "dist/rollup.browser.js",
66
"module": "dist/es/rollup.browser.js",

docs/.vitepress/verify-anchors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function verifyAnchorsOnPage(page: string, slugs: Set<string>) {
4141
let match: (RegExpExecArray & { groups?: { href?: string } }) | null;
4242
while ((match = markdownLinkRegExp.exec(text)) !== null) {
4343
const [href] = match;
44-
if (href.startsWith('#')) {
44+
if (href[0] === '#') {
4545
const anchor = href.slice(1);
4646
if (!slugs.has(anchor)) {
4747
console.log(slugs);

docs/repl/helpers/query.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export async function useUpdateStoresFromQuery() {
1616
try {
1717
if (query.shareable) {
1818
const rawJson = atob(query.shareable.replace(/_/g, '/').replace(/-/g, '+'));
19-
const json = rawJson.startsWith('%') ? decodeURIComponent(rawJson) : rawJson;
19+
const json = rawJson[0] === '%' ? decodeURIComponent(rawJson) : rawJson;
2020
const {
2121
modules: queryModules,
2222
options: queryOptions,

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rollup",
3-
"version": "4.50.0",
3+
"version": "4.50.1",
44
"description": "Next-generation ES module bundler",
55
"main": "dist/rollup.js",
66
"module": "dist/es/rollup.js",

scripts/test-options.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ for (const line of splitHelpText) {
7373
}
7474
}
7575

76-
const helpOptionLines = splitHelpText.filter(line => line.startsWith('-'));
76+
const helpOptionLines = splitHelpText.filter(line => line[0] === '-');
7777

7878
const cliFlagsText = commandReferenceText
7979
.split('\n## ')
@@ -85,7 +85,7 @@ const cliMarkdownSection = cliFlagsText.match(/```\n([\S\s]*?)\n```/);
8585
if (!cliMarkdownSection) {
8686
throw new Error('Could not find markdown section in "Command line flags" section.');
8787
}
88-
const optionListLines = cliMarkdownSection[1].split('\n').filter(line => line.startsWith('-'));
88+
const optionListLines = cliMarkdownSection[1].split('\n').filter(line => line[0] === '-');
8989

9090
for (const [index, line] of helpOptionLines.entries()) {
9191
const optionListLine = optionListLines[index];

src/Chunk.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ export default class Chunk {
966966
variable.isNamespace &&
967967
namespaceInteropHelpersByInteropType[interop(module.id)] &&
968968
(this.imports.has(variable) ||
969-
!this.exportNamesByVariable.get(variable)?.every(name => name.startsWith('*')))
969+
!this.exportNamesByVariable.get(variable)?.every(name => name[0] === '*'))
970970
) {
971971
// We only need to deconflict it if the namespace is actually
972972
// created as a variable, i.e. because it is used internally or
@@ -1143,7 +1143,7 @@ export default class Chunk {
11431143
return idWithoutExtension.slice(preserveModulesRoot.length).replace(/^[/\\]/, '');
11441144
} else {
11451145
// handle edge case in Windows
1146-
if (this.inputBase === '/' && !idWithoutExtension.startsWith('/')) {
1146+
if (this.inputBase === '/' && idWithoutExtension[0] !== '/') {
11471147
return relative(this.inputBase, idWithoutExtension.replace(/^[a-zA-Z]:[/\\]/, '/'));
11481148
}
11491149
return relative(this.inputBase, idWithoutExtension);

src/ast/nodes/ArrayPattern.ts

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -86,24 +86,19 @@ export default class ArrayPattern extends NodeBase implements DeclarationPattern
8686
): boolean {
8787
let included = false;
8888
const includedPatternPath = getIncludedPatternPath(destructuredInitPath);
89-
for (const element of this.elements) {
89+
for (const element of [...this.elements].reverse()) {
9090
if (element) {
91-
element.included ||= included;
91+
if (included && !element.included) {
92+
element.includeNode(context);
93+
}
9294
included =
9395
element.includeDestructuredIfNecessary(context, includedPatternPath, init) || included;
9496
}
9597
}
96-
if (included) {
97-
// This is necessary so that if any pattern element is included, all are
98-
// included for proper deconflicting
99-
for (const element of this.elements) {
100-
if (element && !element.included) {
101-
element.included = true;
102-
element.includeDestructuredIfNecessary(context, includedPatternPath, init);
103-
}
104-
}
98+
if (!this.included && included) {
99+
this.includeNode(context);
105100
}
106-
return (this.included ||= included);
101+
return this.included;
107102
}
108103

109104
markDeclarationReached(): void {

src/ast/nodes/AssignmentPattern.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,16 @@ export default class AssignmentPattern extends NodeBase implements DeclarationPa
7171
if ((included ||= this.right.shouldBeIncluded(context))) {
7272
this.right.include(context, false);
7373
if (!this.left.included) {
74-
this.left.included = true;
74+
this.left.includeNode(context);
7575
// Unfortunately, we need to include the left side again now, so that
7676
// any declared variables are properly included.
7777
this.left.includeDestructuredIfNecessary(context, destructuredInitPath, init);
7878
}
7979
}
80-
return (this.included = included);
80+
if (!this.included && included) {
81+
this.includeNode(context);
82+
}
83+
return this.included;
8184
}
8285

8386
includeNode(context: InclusionContext) {

0 commit comments

Comments
 (0)