@atlaspack/runtime-js 2.14.1-dev.53 → 2.14.1-dev.58
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/CHANGELOG.md +24 -0
- package/lib/JSRuntime.js +7 -18
- package/package.json +7 -10
- package/src/JSRuntime.js +7 -22
- package/src/helpers/browser/analytics/analytics.js.flow +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @atlaspack/runtime-js
|
|
2
2
|
|
|
3
|
+
## 2.14.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`9b85d3e`](https://github.com/atlassian-labs/atlaspack/commit/9b85d3e645b10bd027eed2304afc970a5ba40062), [`17b9579`](https://github.com/atlassian-labs/atlaspack/commit/17b9579484eced0ed8f23e2aba6d23b3c7238c39), [`8f4e6c1`](https://github.com/atlassian-labs/atlaspack/commit/8f4e6c1b0e7c1fd48624afda48c1dcc599f1460f)]:
|
|
8
|
+
- @atlaspack/feature-flags@2.14.2
|
|
9
|
+
- @atlaspack/utils@2.14.2
|
|
10
|
+
- @atlaspack/plugin@2.14.2
|
|
11
|
+
|
|
12
|
+
## 2.14.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#450](https://github.com/atlassian-labs/atlaspack/pull/450) [`b9d41b1`](https://github.com/atlassian-labs/atlaspack/commit/b9d41b175ad5771651a5b0278a5a0147e669234a) Thanks [@benjervis](https://github.com/benjervis)! - Remove the Atlaspack engines compatibility check
|
|
17
|
+
|
|
18
|
+
- [#478](https://github.com/atlassian-labs/atlaspack/pull/478) [`570493b`](https://github.com/atlassian-labs/atlaspack/commit/570493beaf754e7985aebc7daaaf6dfcfa8fe56b) Thanks [@yamadapc](https://github.com/yamadapc)! - The first attempt at Version Packages didn't include the built artifacts.
|
|
19
|
+
This has hopefully been fixed, so this change will force those packages to re-release.
|
|
20
|
+
- Updated dependencies [[`b9d41b1`](https://github.com/atlassian-labs/atlaspack/commit/b9d41b175ad5771651a5b0278a5a0147e669234a), [`ce13d5e`](https://github.com/atlassian-labs/atlaspack/commit/ce13d5e885d55518ee6318e7a72e3a6e4e5126f2), [`4aab060`](https://github.com/atlassian-labs/atlaspack/commit/4aab0605c0d4ee8e0dcc3ffa1162eae5b360b677), [`e1422ad`](https://github.com/atlassian-labs/atlaspack/commit/e1422ad0a801faaa4bc4f1023bed042ffe236e9b), [`570493b`](https://github.com/atlassian-labs/atlaspack/commit/570493beaf754e7985aebc7daaaf6dfcfa8fe56b)]:
|
|
21
|
+
- @atlaspack/domain-sharding@2.14.1
|
|
22
|
+
- @atlaspack/utils@2.14.1
|
|
23
|
+
- @atlaspack/feature-flags@2.14.1
|
|
24
|
+
- @atlaspack/diagnostic@2.14.1
|
|
25
|
+
- @atlaspack/plugin@2.14.1
|
|
26
|
+
|
|
3
27
|
## 2.14.0
|
|
4
28
|
|
|
5
29
|
### Minor Changes
|
package/lib/JSRuntime.js
CHANGED
|
@@ -47,8 +47,6 @@ function _featureFlags() {
|
|
|
47
47
|
return data;
|
|
48
48
|
}
|
|
49
49
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
50
|
-
const filename = /*#__ATLASPACK_IGNORE__*/__filename;
|
|
51
|
-
|
|
52
50
|
// Used for as="" in preload/prefetch
|
|
53
51
|
const TYPE_TO_RESOURCE_PRIORITY = {
|
|
54
52
|
css: 'style',
|
|
@@ -165,7 +163,7 @@ var _default = exports.default = new (_plugin().Runtime)({
|
|
|
165
163
|
// return a simple runtime of `Promise.resolve(internalRequire(assetId))`.
|
|
166
164
|
// The linker handles this for scope-hoisting.
|
|
167
165
|
assets.push({
|
|
168
|
-
filePath:
|
|
166
|
+
filePath: __filename,
|
|
169
167
|
code: `module.exports = Promise.resolve(module.bundle.root(${JSON.stringify(bundleGraph.getAssetPublicId(resolved.value))}))`,
|
|
170
168
|
dependency,
|
|
171
169
|
env: {
|
|
@@ -245,7 +243,7 @@ var _default = exports.default = new (_plugin().Runtime)({
|
|
|
245
243
|
// If a URL dependency was not able to be resolved, add a runtime that
|
|
246
244
|
// exports the original specifier.
|
|
247
245
|
assets.push({
|
|
248
|
-
filePath:
|
|
246
|
+
filePath: __filename,
|
|
249
247
|
code: `module.exports = ${JSON.stringify(dependency.specifier)}`,
|
|
250
248
|
dependency,
|
|
251
249
|
env: {
|
|
@@ -263,15 +261,6 @@ var _default = exports.default = new (_plugin().Runtime)({
|
|
|
263
261
|
return entries.some(e => bundleGroup.entryAssetId === e.id);
|
|
264
262
|
}));
|
|
265
263
|
|
|
266
|
-
// Skip URL runtime for native node imports as they need to be require
|
|
267
|
-
// directly
|
|
268
|
-
// Currently enabled only for internal builds
|
|
269
|
-
if (process.env.ATLASPACK_SUPER_BUILD === 'true') {
|
|
270
|
-
if (mainBundle.bundleBehavior === 'isolated' && mainBundle.env.context === 'node' && mainBundle.type === 'node') {
|
|
271
|
-
continue;
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
|
|
275
264
|
// Skip URL runtimes for library builds. This is handled in packaging so that
|
|
276
265
|
// the url is inlined and statically analyzable.
|
|
277
266
|
if (bundle.env.isLibrary && mainBundle.bundleBehavior !== 'isolated') {
|
|
@@ -299,7 +288,7 @@ var _default = exports.default = new (_plugin().Runtime)({
|
|
|
299
288
|
let relativePathExpr = getRelativePathExpr(bundle, referencedBundle, options);
|
|
300
289
|
let loaderCode = `require(${JSON.stringify(loader)})(${getAbsoluteUrlExpr(relativePathExpr, bundle, config.domainSharding)})`;
|
|
301
290
|
assets.push({
|
|
302
|
-
filePath:
|
|
291
|
+
filePath: __filename,
|
|
303
292
|
code: loaderCode,
|
|
304
293
|
isEntry: true,
|
|
305
294
|
env: {
|
|
@@ -310,7 +299,7 @@ var _default = exports.default = new (_plugin().Runtime)({
|
|
|
310
299
|
}
|
|
311
300
|
if (shouldUseRuntimeManifest(bundle, options) && bundleGraph.getChildBundles(bundle).some(b => b.bundleBehavior !== 'inline') && isNewContext(bundle, bundleGraph)) {
|
|
312
301
|
assets.push({
|
|
313
|
-
filePath:
|
|
302
|
+
filePath: __filename,
|
|
314
303
|
code: getRegisterCode(bundle, bundleGraph),
|
|
315
304
|
isEntry: true,
|
|
316
305
|
env: {
|
|
@@ -512,7 +501,7 @@ function getLoaderRuntime({
|
|
|
512
501
|
});
|
|
513
502
|
}})`;
|
|
514
503
|
return {
|
|
515
|
-
filePath:
|
|
504
|
+
filePath: __filename,
|
|
516
505
|
code: loaderCode,
|
|
517
506
|
dependency,
|
|
518
507
|
env: {
|
|
@@ -527,7 +516,7 @@ function getLoaderRuntime({
|
|
|
527
516
|
}
|
|
528
517
|
code.push(`module.exports = ${loaderCode};`);
|
|
529
518
|
return {
|
|
530
|
-
filePath:
|
|
519
|
+
filePath: __filename,
|
|
531
520
|
code: code.join('\n'),
|
|
532
521
|
dependency,
|
|
533
522
|
env: {
|
|
@@ -601,7 +590,7 @@ function getURLRuntime(dependency, from, to, options, shardingConfig) {
|
|
|
601
590
|
code = `module.exports = ${getAbsoluteUrlExpr(relativePathExpr, from, shardingConfig)};`;
|
|
602
591
|
}
|
|
603
592
|
return {
|
|
604
|
-
filePath:
|
|
593
|
+
filePath: __filename,
|
|
605
594
|
code,
|
|
606
595
|
dependency,
|
|
607
596
|
env: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/runtime-js",
|
|
3
|
-
"version": "2.14.1-dev.
|
|
3
|
+
"version": "2.14.1-dev.58+304528673",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -11,20 +11,17 @@
|
|
|
11
11
|
},
|
|
12
12
|
"main": "lib/JSRuntime.js",
|
|
13
13
|
"source": "src/JSRuntime.js",
|
|
14
|
-
"atlaspackReferences": [
|
|
15
|
-
"./src/helpers/**/*"
|
|
16
|
-
],
|
|
17
14
|
"engines": {
|
|
18
15
|
"node": ">= 16.0.0"
|
|
19
16
|
},
|
|
20
17
|
"dependencies": {
|
|
21
|
-
"@atlaspack/diagnostic": "2.14.1-dev.
|
|
22
|
-
"@atlaspack/domain-sharding": "2.14.1-dev.
|
|
23
|
-
"@atlaspack/feature-flags": "2.14.1-dev.
|
|
24
|
-
"@atlaspack/plugin": "2.14.1-dev.
|
|
25
|
-
"@atlaspack/utils": "2.14.1-dev.
|
|
18
|
+
"@atlaspack/diagnostic": "2.14.1-dev.58+304528673",
|
|
19
|
+
"@atlaspack/domain-sharding": "2.14.1-dev.58+304528673",
|
|
20
|
+
"@atlaspack/feature-flags": "2.14.1-dev.58+304528673",
|
|
21
|
+
"@atlaspack/plugin": "2.14.1-dev.58+304528673",
|
|
22
|
+
"@atlaspack/utils": "2.14.1-dev.58+304528673",
|
|
26
23
|
"nullthrows": "^1.1.1"
|
|
27
24
|
},
|
|
28
25
|
"type": "commonjs",
|
|
29
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "304528673208007ba9e03ec6360fdf99a4945910"
|
|
30
27
|
}
|
package/src/JSRuntime.js
CHANGED
|
@@ -20,8 +20,6 @@ import path from 'path';
|
|
|
20
20
|
import nullthrows from 'nullthrows';
|
|
21
21
|
import {getFeatureFlag} from '@atlaspack/feature-flags';
|
|
22
22
|
|
|
23
|
-
const filename = /*#__ATLASPACK_IGNORE__*/ __filename;
|
|
24
|
-
|
|
25
23
|
// Used for as="" in preload/prefetch
|
|
26
24
|
const TYPE_TO_RESOURCE_PRIORITY = {
|
|
27
25
|
css: 'style',
|
|
@@ -159,7 +157,7 @@ export default (new Runtime({
|
|
|
159
157
|
// return a simple runtime of `Promise.resolve(internalRequire(assetId))`.
|
|
160
158
|
// The linker handles this for scope-hoisting.
|
|
161
159
|
assets.push({
|
|
162
|
-
filePath:
|
|
160
|
+
filePath: __filename,
|
|
163
161
|
code: `module.exports = Promise.resolve(module.bundle.root(${JSON.stringify(
|
|
164
162
|
bundleGraph.getAssetPublicId(resolved.value),
|
|
165
163
|
)}))`,
|
|
@@ -259,7 +257,7 @@ export default (new Runtime({
|
|
|
259
257
|
// If a URL dependency was not able to be resolved, add a runtime that
|
|
260
258
|
// exports the original specifier.
|
|
261
259
|
assets.push({
|
|
262
|
-
filePath:
|
|
260
|
+
filePath: __filename,
|
|
263
261
|
code: `module.exports = ${JSON.stringify(dependency.specifier)}`,
|
|
264
262
|
dependency,
|
|
265
263
|
env: {sourceType: 'module'},
|
|
@@ -279,19 +277,6 @@ export default (new Runtime({
|
|
|
279
277
|
}),
|
|
280
278
|
);
|
|
281
279
|
|
|
282
|
-
// Skip URL runtime for native node imports as they need to be require
|
|
283
|
-
// directly
|
|
284
|
-
// Currently enabled only for internal builds
|
|
285
|
-
if (process.env.ATLASPACK_SUPER_BUILD === 'true') {
|
|
286
|
-
if (
|
|
287
|
-
mainBundle.bundleBehavior === 'isolated' &&
|
|
288
|
-
mainBundle.env.context === 'node' &&
|
|
289
|
-
mainBundle.type === 'node'
|
|
290
|
-
) {
|
|
291
|
-
continue;
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
|
|
295
280
|
// Skip URL runtimes for library builds. This is handled in packaging so that
|
|
296
281
|
// the url is inlined and statically analyzable.
|
|
297
282
|
if (bundle.env.isLibrary && mainBundle.bundleBehavior !== 'isolated') {
|
|
@@ -339,7 +324,7 @@ export default (new Runtime({
|
|
|
339
324
|
config.domainSharding,
|
|
340
325
|
)})`;
|
|
341
326
|
assets.push({
|
|
342
|
-
filePath:
|
|
327
|
+
filePath: __filename,
|
|
343
328
|
code: loaderCode,
|
|
344
329
|
isEntry: true,
|
|
345
330
|
env: {sourceType: 'module'},
|
|
@@ -355,7 +340,7 @@ export default (new Runtime({
|
|
|
355
340
|
isNewContext(bundle, bundleGraph)
|
|
356
341
|
) {
|
|
357
342
|
assets.push({
|
|
358
|
-
filePath:
|
|
343
|
+
filePath: __filename,
|
|
359
344
|
code: getRegisterCode(bundle, bundleGraph),
|
|
360
345
|
isEntry: true,
|
|
361
346
|
env: {sourceType: 'module'},
|
|
@@ -700,7 +685,7 @@ function getLoaderRuntime({
|
|
|
700
685
|
}})`;
|
|
701
686
|
|
|
702
687
|
return {
|
|
703
|
-
filePath:
|
|
688
|
+
filePath: __filename,
|
|
704
689
|
code: loaderCode,
|
|
705
690
|
dependency,
|
|
706
691
|
env: {sourceType: 'module'},
|
|
@@ -720,7 +705,7 @@ function getLoaderRuntime({
|
|
|
720
705
|
code.push(`module.exports = ${loaderCode};`);
|
|
721
706
|
|
|
722
707
|
return {
|
|
723
|
-
filePath:
|
|
708
|
+
filePath: __filename,
|
|
724
709
|
code: code.join('\n'),
|
|
725
710
|
dependency,
|
|
726
711
|
env: {sourceType: 'module'},
|
|
@@ -848,7 +833,7 @@ function getURLRuntime(
|
|
|
848
833
|
}
|
|
849
834
|
|
|
850
835
|
return {
|
|
851
|
-
filePath:
|
|
836
|
+
filePath: __filename,
|
|
852
837
|
code,
|
|
853
838
|
dependency,
|
|
854
839
|
env: {sourceType: 'module'},
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
export type AtlaspackAnalyticsEvent = {|
|
|
4
4
|
action: string,
|
|
5
|
-
attributes?: {
|
|
5
|
+
attributes?: {[key: string]: string | number | boolean},
|
|
6
6
|
|};
|
|
7
7
|
|
|
8
|
-
declare export function sendAnalyticsEvent(
|
|
8
|
+
declare export function sendAnalyticsEvent(
|
|
9
|
+
event: AtlaspackAnalyticsEvent,
|
|
10
|
+
): void;
|