@atlaspack/transformer-js
Advanced tools
Comparing version
@@ -64,2 +64,9 @@ "use strict"; | ||
var _package = _interopRequireDefault(require("../package.json")); | ||
function _featureFlags() { | ||
const data = require("@atlaspack/feature-flags"); | ||
_featureFlags = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
@@ -328,3 +335,4 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
has_node_replacements, | ||
is_constant_module | ||
is_constant_module, | ||
conditions | ||
} = await (_rust().transformAsync || _rust().transform)({ | ||
@@ -468,2 +476,9 @@ filename: asset.filePath, | ||
}); | ||
if ((0, _featureFlags().getFeatureFlag)('conditionalBundlingApi')) { | ||
asset.meta.conditions = conditions.map(c => ({ | ||
key: c.key, | ||
ifTruePlaceholder: c.if_true_placeholder, | ||
ifFalsePlaceholder: c.if_false_placeholder | ||
})); | ||
} | ||
if (is_constant_module) { | ||
@@ -685,3 +700,3 @@ asset.meta.isConstantModule = true; | ||
loc: convertLoc(dep.loc), | ||
priority: dep.kind === 'DynamicImport' ? 'lazy' : 'sync', | ||
priority: dep.kind === 'DynamicImport' ? 'lazy' : dep.kind === 'ConditionalImport' ? 'conditional' : 'sync', | ||
isOptional: dep.is_optional, | ||
@@ -688,0 +703,0 @@ meta, |
{ | ||
"name": "@atlaspack/transformer-js", | ||
"version": "2.12.1-canary.3432+415929ab6", | ||
"version": "2.12.1-canary.3434+c61bf3cde", | ||
"license": "(MIT OR Apache-2.0)", | ||
@@ -18,3 +18,3 @@ "publishConfig": { | ||
"engines": { | ||
"parcel": "2.12.1-canary.3432+415929ab6", | ||
"parcel": "2.12.1-canary.3434+c61bf3cde", | ||
"node": ">= 16.0.0" | ||
@@ -27,7 +27,8 @@ }, | ||
"dependencies": { | ||
"@atlaspack/diagnostic": "2.12.1-canary.3432+415929ab6", | ||
"@atlaspack/plugin": "2.12.1-canary.3432+415929ab6", | ||
"@atlaspack/rust": "2.12.1-canary.3432+415929ab6", | ||
"@atlaspack/utils": "2.12.1-canary.3432+415929ab6", | ||
"@atlaspack/workers": "2.12.1-canary.3432+415929ab6", | ||
"@atlaspack/diagnostic": "2.12.1-canary.3434+c61bf3cde", | ||
"@atlaspack/feature-flags": "2.12.1-canary.3434+c61bf3cde", | ||
"@atlaspack/plugin": "2.12.1-canary.3434+c61bf3cde", | ||
"@atlaspack/rust": "2.12.1-canary.3434+c61bf3cde", | ||
"@atlaspack/utils": "2.12.1-canary.3434+c61bf3cde", | ||
"@atlaspack/workers": "2.12.1-canary.3434+c61bf3cde", | ||
"@parcel/source-map": "^2.1.1", | ||
@@ -41,5 +42,5 @@ "@swc/helpers": "^0.5.0", | ||
"peerDependencies": { | ||
"@atlaspack/core": "2.12.1-canary.3432+415929ab6" | ||
"@atlaspack/core": "2.12.1-canary.3434+c61bf3cde" | ||
}, | ||
"gitHead": "415929ab63f5314913c27d3dfdb965f2e76bedf2" | ||
"gitHead": "c61bf3cde53d1cdb5ae13541c644a6e3ef5521e1" | ||
} |
@@ -8,2 +8,3 @@ // @flow | ||
FileCreateInvalidation, | ||
ConditionMeta, | ||
} from '@atlaspack/types'; | ||
@@ -24,2 +25,3 @@ import type {SchemaEntity} from '@atlaspack/utils'; | ||
import pkg from '../package.json'; | ||
import {getFeatureFlag} from '@atlaspack/feature-flags'; | ||
@@ -424,2 +426,3 @@ const JSX_EXTENSIONS = { | ||
is_constant_module, | ||
conditions, | ||
} = await (transformAsync || transform)({ | ||
@@ -583,2 +586,10 @@ filename: asset.filePath, | ||
if (getFeatureFlag('conditionalBundlingApi')) { | ||
asset.meta.conditions = conditions.map((c): ConditionMeta => ({ | ||
key: c.key, | ||
ifTruePlaceholder: c.if_true_placeholder, | ||
ifFalsePlaceholder: c.if_false_placeholder, | ||
})); | ||
} | ||
if (is_constant_module) { | ||
@@ -858,3 +869,8 @@ asset.meta.isConstantModule = true; | ||
loc: convertLoc(dep.loc), | ||
priority: dep.kind === 'DynamicImport' ? 'lazy' : 'sync', | ||
priority: | ||
dep.kind === 'DynamicImport' | ||
? 'lazy' | ||
: dep.kind === 'ConditionalImport' | ||
? 'conditional' | ||
: 'sync', | ||
isOptional: dep.is_optional, | ||
@@ -861,0 +877,0 @@ meta, |
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
85744
1.2%1936
1.57%311
0.65%62
3.33%8
33.33%311
0.65%13
8.33%+ Added
+ Added
+ Added
- Removed
- Removed