@atlaspack/transformer-js 3.2.3-canary.115 → 3.2.3-canary.117
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/JSTransformer.js +5 -0
- package/package.json +8 -8
- package/src/JSTransformer.js +5 -0
package/lib/JSTransformer.js
CHANGED
|
@@ -344,6 +344,7 @@ var _default = exports.default = new (_plugin().Transformer)({
|
|
|
344
344
|
shebang,
|
|
345
345
|
hoist_result,
|
|
346
346
|
symbol_result,
|
|
347
|
+
is_empty_or_empty_export,
|
|
347
348
|
needs_esm_helpers,
|
|
348
349
|
diagnostics,
|
|
349
350
|
used_env,
|
|
@@ -385,6 +386,7 @@ var _default = exports.default = new (_plugin().Transformer)({
|
|
|
385
386
|
inline_constants: config.inlineConstants,
|
|
386
387
|
conditional_bundling: options.featureFlags.conditionalBundlingApi,
|
|
387
388
|
hmr_improvements: options.featureFlags.hmrImprovements,
|
|
389
|
+
computed_properties_fix: options.featureFlags.unusedComputedPropertyFix,
|
|
388
390
|
magic_comments: Boolean(config === null || config === void 0 ? void 0 : config.magicComments),
|
|
389
391
|
callMacro: asset.isSource ? async (err, src, exportName, args, loc) => {
|
|
390
392
|
let mod;
|
|
@@ -822,6 +824,9 @@ var _default = exports.default = new (_plugin().Transformer)({
|
|
|
822
824
|
// (and the asset has side effects), or the asset is wrapped.
|
|
823
825
|
// This allows accessing symbols that don't exist without errors in symbol propagation.
|
|
824
826
|
if (hoist_result.has_cjs_exports || !hoist_result.is_esm && asset.sideEffects && deps.size === 0 && Object.keys(hoist_result.exported_symbols).length === 0 || hoist_result.should_wrap && !asset.symbols.hasExportSymbol('*')) {
|
|
827
|
+
if (is_empty_or_empty_export) {
|
|
828
|
+
asset.meta.emptyFileStarReexport = true;
|
|
829
|
+
}
|
|
825
830
|
asset.symbols.set('*', `$${asset.id}$exports`);
|
|
826
831
|
}
|
|
827
832
|
asset.meta.hasCJSExports = hoist_result.has_cjs_exports;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/transformer-js",
|
|
3
|
-
"version": "3.2.3-canary.
|
|
3
|
+
"version": "3.2.3-canary.117+becf977f6",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
"src"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@atlaspack/diagnostic": "2.14.1-canary.
|
|
26
|
-
"@atlaspack/feature-flags": "2.14.1-canary.
|
|
27
|
-
"@atlaspack/plugin": "2.14.5-canary.
|
|
28
|
-
"@atlaspack/rust": "3.2.1-canary.
|
|
29
|
-
"@atlaspack/utils": "2.14.5-canary.
|
|
30
|
-
"@atlaspack/workers": "2.14.5-canary.
|
|
25
|
+
"@atlaspack/diagnostic": "2.14.1-canary.185+becf977f6",
|
|
26
|
+
"@atlaspack/feature-flags": "2.14.1-canary.185+becf977f6",
|
|
27
|
+
"@atlaspack/plugin": "2.14.5-canary.117+becf977f6",
|
|
28
|
+
"@atlaspack/rust": "3.2.1-canary.117+becf977f6",
|
|
29
|
+
"@atlaspack/utils": "2.14.5-canary.117+becf977f6",
|
|
30
|
+
"@atlaspack/workers": "2.14.5-canary.117+becf977f6",
|
|
31
31
|
"@parcel/source-map": "^2.1.1",
|
|
32
32
|
"@swc/helpers": "^0.5.15",
|
|
33
33
|
"browserslist": "^4.6.6",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"@atlaspack/core": "^2.13.1"
|
|
40
40
|
},
|
|
41
41
|
"type": "commonjs",
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "becf977f625d5ee46dae3d4c679f173bf5f40cc0"
|
|
43
43
|
}
|
package/src/JSTransformer.js
CHANGED
|
@@ -428,6 +428,7 @@ export default (new Transformer({
|
|
|
428
428
|
shebang,
|
|
429
429
|
hoist_result,
|
|
430
430
|
symbol_result,
|
|
431
|
+
is_empty_or_empty_export,
|
|
431
432
|
needs_esm_helpers,
|
|
432
433
|
diagnostics,
|
|
433
434
|
used_env,
|
|
@@ -476,6 +477,7 @@ export default (new Transformer({
|
|
|
476
477
|
inline_constants: config.inlineConstants,
|
|
477
478
|
conditional_bundling: options.featureFlags.conditionalBundlingApi,
|
|
478
479
|
hmr_improvements: options.featureFlags.hmrImprovements,
|
|
480
|
+
computed_properties_fix: options.featureFlags.unusedComputedPropertyFix,
|
|
479
481
|
magic_comments: Boolean(config?.magicComments),
|
|
480
482
|
callMacro: asset.isSource
|
|
481
483
|
? async (err, src, exportName, args, loc) => {
|
|
@@ -1004,6 +1006,9 @@ export default (new Transformer({
|
|
|
1004
1006
|
Object.keys(hoist_result.exported_symbols).length === 0) ||
|
|
1005
1007
|
(hoist_result.should_wrap && !asset.symbols.hasExportSymbol('*'))
|
|
1006
1008
|
) {
|
|
1009
|
+
if (is_empty_or_empty_export) {
|
|
1010
|
+
asset.meta.emptyFileStarReexport = true;
|
|
1011
|
+
}
|
|
1007
1012
|
asset.symbols.set('*', `$${asset.id}$exports`);
|
|
1008
1013
|
}
|
|
1009
1014
|
|