Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(deconflictChunk): Deconflict multiple
index
imports for ES form…
…at using nested export star statements (#3435) * Add failing test for barrel exports #3365 * Update expected outputs * Fix expected output * Set chunkOrExternalModule.variableName in deconflictImportsEsm * Dconflict deps when preserveModules is true * Update system-exports-wrap-pure-annotation * Actually use preserveModules flag * Only deconflict deps in esm to minimize impact * Update tests expected output * Update test, add more context to comment
- Loading branch information
1 parent
3ef6f07
commit ff72e90
Showing
26 changed files
with
154 additions
and
16 deletions.
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'; | ||
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