-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix(deconflictChunk): Deconflict multiple index
imports for ES format using nested export star statements
#3435
Merged
lukastaegert
merged 10 commits into
rollup:master
from
kamranayub:fix/gh-3365/preserve-modules-export
Mar 12, 2020
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ac4af85
Add failing test for barrel exports #3365
kamranayub a96f344
Update expected outputs
kamranayub a1e404c
Fix expected output
kamranayub 58d6d89
Set chunkOrExternalModule.variableName in deconflictImportsEsm
kamranayub 53b45c4
Dconflict deps when preserveModules is true
kamranayub 4a8dbe8
Update system-exports-wrap-pure-annotation
kamranayub 15cf5ab
Actually use preserveModules flag
kamranayub b804496
Only deconflict deps in esm to minimize impact
kamranayub 04a4385
Update tests expected output
kamranayub 3e97dee
Update test, add more context to comment
kamranayub File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...-form/samples/preserve-modules-commonjs/_expected/es/_virtual/_external_commonjs-external
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import external from 'external'; | ||
import external$1 from 'external'; | ||
|
||
|
||
|
||
export default external; | ||
export default external$1; |
4 changes: 2 additions & 2 deletions
4
...king-form/samples/preserve-modules-commonjs/_expected/es/_virtual/other.js_commonjs-proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { __moduleExports as other } from '../other.js'; | ||
import { __moduleExports as other$1 } from '../other.js'; | ||
|
||
|
||
|
||
export default other; | ||
export default other$1; |
4 changes: 2 additions & 2 deletions
4
test/chunking-form/samples/preserve-modules-commonjs/_expected/es/commonjs.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
test/chunking-form/samples/preserve-modules-commonjs/_expected/es/main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import external from 'external'; | ||
import external$1 from 'external'; | ||
import value from './commonjs.js'; | ||
|
||
console.log(value, external); | ||
console.log(value, external$1); |
7 changes: 7 additions & 0 deletions
7
test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
description: 'confirm exports are deconflicted when exporting nested index aliases', | ||
options: { | ||
input: 'main.js', | ||
preserveModules: true | ||
} | ||
}; |
10 changes: 10 additions & 0 deletions
10
test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/amd/main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
define(['exports', './module-a/v1/index', './module-b/v1/index'], function (exports, index, index$1) { 'use strict'; | ||
|
||
|
||
|
||
exports.ModuleA_V1 = index; | ||
exports.ModuleB_V1 = index$1; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
}); |
9 changes: 9 additions & 0 deletions
9
...-form/samples/preserve-modules-nested-barrel-es-export/_expected/amd/module-a/v1/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
define(['exports'], function (exports) { 'use strict'; | ||
|
||
const TEST_MODULE_A = 'A'; | ||
|
||
exports.TEST_MODULE_A = TEST_MODULE_A; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
}); |
9 changes: 9 additions & 0 deletions
9
...-form/samples/preserve-modules-nested-barrel-es-export/_expected/amd/module-b/v1/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
define(['exports'], function (exports) { 'use strict'; | ||
|
||
const TEST_MODULE_B = 'A'; | ||
|
||
exports.TEST_MODULE_B = TEST_MODULE_B; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
}); |
11 changes: 11 additions & 0 deletions
11
test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/cjs/main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
'use strict'; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
var index = require('./module-a/v1/index.js'); | ||
var index$1 = require('./module-b/v1/index.js'); | ||
|
||
|
||
|
||
exports.ModuleA_V1 = index; | ||
exports.ModuleB_V1 = index$1; |
7 changes: 7 additions & 0 deletions
7
...-form/samples/preserve-modules-nested-barrel-es-export/_expected/cjs/module-a/v1/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
const TEST_MODULE_A = 'A'; | ||
|
||
exports.TEST_MODULE_A = TEST_MODULE_A; |
7 changes: 7 additions & 0 deletions
7
...-form/samples/preserve-modules-nested-barrel-es-export/_expected/cjs/module-b/v1/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
const TEST_MODULE_B = 'A'; | ||
|
||
exports.TEST_MODULE_B = TEST_MODULE_B; |
4 changes: 4 additions & 0 deletions
4
test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/es/main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import * as index from './module-a/v1/index.js'; | ||
export { index as ModuleA_V1 }; | ||
import * as index$1 from './module-b/v1/index.js'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the main goal of this PR, to deconflict the |
||
export { index$1 as ModuleB_V1 }; |
3 changes: 3 additions & 0 deletions
3
...g-form/samples/preserve-modules-nested-barrel-es-export/_expected/es/module-a/v1/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const TEST_MODULE_A = 'A'; | ||
|
||
export { TEST_MODULE_A }; |
3 changes: 3 additions & 0 deletions
3
...g-form/samples/preserve-modules-nested-barrel-es-export/_expected/es/module-b/v1/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const TEST_MODULE_B = 'A'; | ||
|
||
export { TEST_MODULE_B }; |
15 changes: 15 additions & 0 deletions
15
test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/system/main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
System.register(['./module-a/v1/index.js', './module-b/v1/index.js'], function (exports) { | ||
'use strict'; | ||
return { | ||
setters: [function (module) { | ||
exports('ModuleA_V1', module); | ||
}, function (module) { | ||
exports('ModuleB_V1', module); | ||
}], | ||
execute: function () { | ||
|
||
|
||
|
||
} | ||
}; | ||
}); |
10 changes: 10 additions & 0 deletions
10
...rm/samples/preserve-modules-nested-barrel-es-export/_expected/system/module-a/v1/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
System.register([], function (exports) { | ||
'use strict'; | ||
return { | ||
execute: function () { | ||
|
||
const TEST_MODULE_A = exports('TEST_MODULE_A', 'A'); | ||
|
||
} | ||
}; | ||
}); |
10 changes: 10 additions & 0 deletions
10
...rm/samples/preserve-modules-nested-barrel-es-export/_expected/system/module-b/v1/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
System.register([], function (exports) { | ||
'use strict'; | ||
return { | ||
execute: function () { | ||
|
||
const TEST_MODULE_B = exports('TEST_MODULE_B', 'A'); | ||
|
||
} | ||
}; | ||
}); |
2 changes: 2 additions & 0 deletions
2
test/chunking-form/samples/preserve-modules-nested-barrel-es-export/main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './module-a/index' | ||
export * from './module-b/index' |
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/preserve-modules-nested-barrel-es-export/module-a/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import * as ModuleA_V1 from './v1/index' | ||
|
||
export { ModuleA_V1 } |
1 change: 1 addition & 0 deletions
1
test/chunking-form/samples/preserve-modules-nested-barrel-es-export/module-a/v1/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const TEST_MODULE_A = 'A' |
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/preserve-modules-nested-barrel-es-export/module-b/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import * as ModuleB_V1 from './v1/index' | ||
|
||
export { ModuleB_V1 } |
1 change: 1 addition & 0 deletions
1
test/chunking-form/samples/preserve-modules-nested-barrel-es-export/module-b/v1/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const TEST_MODULE_B = 'A' |
4 changes: 2 additions & 2 deletions
4
...samples/side-effect-free-dependencies/avoid-imports-preserve-modules/_expected/es/main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { a } from './a.js'; | ||
import { a as a$1 } from './a.js'; | ||
import { d } from './one.js'; | ||
|
||
console.log(a + d); | ||
console.log(a$1 + d); |
4 changes: 2 additions & 2 deletions
4
.../samples/side-effect-free-dependencies/avoid-imports-preserve-modules/_expected/es/one.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { b } from './b.js'; | ||
import { b as b$1 } from './b.js'; | ||
|
||
const d = b + 4; | ||
const d = b$1 + 4; | ||
|
||
export { d }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, and easy to get back to for a deeper fix 👍