@atlaspack/core 2.12.1-canary.3468 → 2.12.1-canary.3470
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/Atlaspack.js +1 -2
- package/lib/CommittedAsset.js +8 -2
- package/lib/PackagerRunner.js +8 -2
- package/lib/RequestTracker.js +10 -4
- package/lib/UncommittedAsset.js +8 -2
- package/lib/assetUtils.js +8 -2
- package/lib/index.js +0 -43
- package/lib/registerCoreWithSerializer.js +11 -5
- package/lib/requests/AtlaspackConfigRequest.js +8 -2
- package/lib/requests/ConfigRequest.js +9 -4
- package/lib/requests/DevDepRequest.js +9 -3
- package/lib/requests/PathRequest.js +8 -2
- package/lib/worker.js +8 -2
- package/package.json +17 -16
- package/src/Atlaspack.js +1 -4
- package/src/CommittedAsset.js +3 -1
- package/src/PackagerRunner.js +1 -1
- package/src/RequestTracker.js +1 -1
- package/src/UncommittedAsset.js +1 -1
- package/src/assetUtils.js +1 -1
- package/src/index.js +0 -10
- package/src/registerCoreWithSerializer.js +7 -4
- package/src/requests/AtlaspackConfigRequest.js +1 -1
- package/src/requests/ConfigRequest.js +1 -2
- package/src/requests/DevDepRequest.js +1 -1
- package/src/requests/PathRequest.js +1 -1
- package/src/worker.js +1 -1
- package/lib/buildCache.js +0 -18
- package/lib/serializer.js +0 -216
- package/lib/serializerCore.js +0 -16
- package/src/buildCache.js +0 -15
- package/src/serializer.js +0 -255
- package/src/serializerCore.js +0 -5
- package/test/serializer.test.js +0 -302
package/lib/Atlaspack.js
CHANGED
|
@@ -603,7 +603,6 @@ exports.BuildError = BuildError;
|
|
|
603
603
|
function createWorkerFarm(options = {}) {
|
|
604
604
|
return new (_workers().default)({
|
|
605
605
|
...options,
|
|
606
|
-
|
|
607
|
-
workerPath: process.browser ? '@atlaspack/core/worker' : require.resolve('./worker')
|
|
606
|
+
workerPath: require.resolve('./worker')
|
|
608
607
|
});
|
|
609
608
|
}
|
package/lib/CommittedAsset.js
CHANGED
|
@@ -11,6 +11,13 @@ function _stream() {
|
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
|
+
function _buildCache() {
|
|
15
|
+
const data = require("@atlaspack/build-cache");
|
|
16
|
+
_buildCache = function () {
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
14
21
|
function _sourceMap() {
|
|
15
22
|
const data = _interopRequireDefault(require("@parcel/source-map"));
|
|
16
23
|
_sourceMap = function () {
|
|
@@ -26,7 +33,6 @@ function _utils() {
|
|
|
26
33
|
return data;
|
|
27
34
|
}
|
|
28
35
|
var _assetUtils = require("./assetUtils");
|
|
29
|
-
var _serializer = require("./serializer");
|
|
30
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
37
|
class CommittedAsset {
|
|
32
38
|
constructor(value, options) {
|
|
@@ -122,7 +128,7 @@ class CommittedAsset {
|
|
|
122
128
|
return Promise.resolve(null);
|
|
123
129
|
}
|
|
124
130
|
if (this.ast == null) {
|
|
125
|
-
this.ast = this.options.cache.getBlob(this.value.astKey).then(serializedAst => (0,
|
|
131
|
+
this.ast = this.options.cache.getBlob(this.value.astKey).then(serializedAst => (0, _buildCache().deserializeRaw)(serializedAst));
|
|
126
132
|
}
|
|
127
133
|
return this.ast;
|
|
128
134
|
}
|
package/lib/PackagerRunner.js
CHANGED
|
@@ -11,6 +11,13 @@ function _assert() {
|
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
|
+
function _buildCache() {
|
|
15
|
+
const data = require("@atlaspack/build-cache");
|
|
16
|
+
_buildCache = function () {
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
14
21
|
function _utils() {
|
|
15
22
|
const data = require("@atlaspack/utils");
|
|
16
23
|
_utils = function () {
|
|
@@ -76,7 +83,6 @@ var _projectPath = require("./projectPath");
|
|
|
76
83
|
var _InternalConfig = require("./InternalConfig");
|
|
77
84
|
var _ConfigRequest = require("./requests/ConfigRequest");
|
|
78
85
|
var _DevDepRequest = require("./requests/DevDepRequest");
|
|
79
|
-
var _buildCache = require("./buildCache");
|
|
80
86
|
var _assetUtils = require("./assetUtils");
|
|
81
87
|
var _utils2 = require("./utils");
|
|
82
88
|
function _profiler() {
|
|
@@ -93,7 +99,7 @@ const BOUNDARY_LENGTH = _constants.HASH_REF_PREFIX.length + 32 - 1;
|
|
|
93
99
|
|
|
94
100
|
// Packager/optimizer configs are not bundle-specific, so we only need to
|
|
95
101
|
// load them once per build.
|
|
96
|
-
const pluginConfigs = (0, _buildCache.createBuildCache)();
|
|
102
|
+
const pluginConfigs = (0, _buildCache().createBuildCache)();
|
|
97
103
|
class PackagerRunner {
|
|
98
104
|
constructor({
|
|
99
105
|
config,
|
package/lib/RequestTracker.js
CHANGED
|
@@ -23,6 +23,13 @@ function _path2() {
|
|
|
23
23
|
};
|
|
24
24
|
return data;
|
|
25
25
|
}
|
|
26
|
+
function _buildCache() {
|
|
27
|
+
const data = require("@atlaspack/build-cache");
|
|
28
|
+
_buildCache = function () {
|
|
29
|
+
return data;
|
|
30
|
+
};
|
|
31
|
+
return data;
|
|
32
|
+
}
|
|
26
33
|
function _featureFlags() {
|
|
27
34
|
const data = require("@atlaspack/feature-flags");
|
|
28
35
|
_featureFlags = function () {
|
|
@@ -69,7 +76,6 @@ var _constants = require("./constants");
|
|
|
69
76
|
var _projectPath = require("./projectPath");
|
|
70
77
|
var _ReporterRunner = require("./ReporterRunner");
|
|
71
78
|
var _ConfigRequest = require("./requests/ConfigRequest");
|
|
72
|
-
var _serializer = require("./serializer");
|
|
73
79
|
var _utils2 = require("./utils");
|
|
74
80
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
75
81
|
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); }
|
|
@@ -749,7 +755,7 @@ class RequestTracker {
|
|
|
749
755
|
} else if (node.resultCacheKey != null && ifMatch == null) {
|
|
750
756
|
let key = node.resultCacheKey;
|
|
751
757
|
(0, _assert().default)(this.options.cache.hasLargeBlob(key));
|
|
752
|
-
let cachedResult = (0,
|
|
758
|
+
let cachedResult = (0, _buildCache().deserialize)(await this.options.cache.getLargeBlob(key));
|
|
753
759
|
node.result = cachedResult;
|
|
754
760
|
return cachedResult;
|
|
755
761
|
}
|
|
@@ -927,7 +933,7 @@ class RequestTracker {
|
|
|
927
933
|
if (signal !== null && signal !== void 0 && signal.aborted) {
|
|
928
934
|
throw new Error('Serialization was aborted');
|
|
929
935
|
}
|
|
930
|
-
await this.options.cache.setLargeBlob(key, (0,
|
|
936
|
+
await this.options.cache.setLargeBlob(key, (0, _buildCache().serialize)(contents), signal ? {
|
|
931
937
|
signal: signal
|
|
932
938
|
} : undefined);
|
|
933
939
|
total += 1;
|
|
@@ -1046,7 +1052,7 @@ async function readAndDeserializeRequestGraph(cache, requestGraphKey, cacheKey)
|
|
|
1046
1052
|
const getAndDeserialize = async key => {
|
|
1047
1053
|
let buffer = await cache.getLargeBlob(key);
|
|
1048
1054
|
bufferLength += Buffer.byteLength(buffer);
|
|
1049
|
-
return (0,
|
|
1055
|
+
return (0, _buildCache().deserialize)(buffer);
|
|
1050
1056
|
};
|
|
1051
1057
|
let serializedRequestGraph = await getAndDeserialize(requestGraphKey);
|
|
1052
1058
|
let nodePromises = serializedRequestGraph.nodeCountsPerBlob.map(async (nodesCount, i) => {
|
package/lib/UncommittedAsset.js
CHANGED
|
@@ -25,6 +25,13 @@ function _sourceMap() {
|
|
|
25
25
|
};
|
|
26
26
|
return data;
|
|
27
27
|
}
|
|
28
|
+
function _buildCache() {
|
|
29
|
+
const data = require("@atlaspack/build-cache");
|
|
30
|
+
_buildCache = function () {
|
|
31
|
+
return data;
|
|
32
|
+
};
|
|
33
|
+
return data;
|
|
34
|
+
}
|
|
28
35
|
function _utils() {
|
|
29
36
|
const data = require("@atlaspack/utils");
|
|
30
37
|
_utils = function () {
|
|
@@ -39,7 +46,6 @@ function _rust() {
|
|
|
39
46
|
};
|
|
40
47
|
return data;
|
|
41
48
|
}
|
|
42
|
-
var _serializer = require("./serializer");
|
|
43
49
|
var _Dependency = require("./Dependency");
|
|
44
50
|
var _Environment = require("./Environment");
|
|
45
51
|
var _constants = require("./constants");
|
|
@@ -88,7 +94,7 @@ class UncommittedAsset {
|
|
|
88
94
|
|
|
89
95
|
// Since we can only read from the stream once, compute the content length
|
|
90
96
|
// and hash while it's being written to the cache.
|
|
91
|
-
await Promise.all([contentKey != null && this.commitContent(contentKey).then(s => (size = s.size, outputHash = s.hash)), this.mapBuffer != null && mapKey != null && this.options.cache.setBlob(mapKey, this.mapBuffer), astKey != null && this.options.cache.setBlob(astKey, (0,
|
|
97
|
+
await Promise.all([contentKey != null && this.commitContent(contentKey).then(s => (size = s.size, outputHash = s.hash)), this.mapBuffer != null && mapKey != null && this.options.cache.setBlob(mapKey, this.mapBuffer), astKey != null && this.options.cache.setBlob(astKey, (0, _buildCache().serializeRaw)(this.ast))]);
|
|
92
98
|
this.value.contentKey = contentKey;
|
|
93
99
|
this.value.mapKey = mapKey;
|
|
94
100
|
this.value.astKey = astKey;
|
package/lib/assetUtils.js
CHANGED
|
@@ -15,6 +15,13 @@ function _stream() {
|
|
|
15
15
|
};
|
|
16
16
|
return data;
|
|
17
17
|
}
|
|
18
|
+
function _buildCache() {
|
|
19
|
+
const data = require("@atlaspack/build-cache");
|
|
20
|
+
_buildCache = function () {
|
|
21
|
+
return data;
|
|
22
|
+
};
|
|
23
|
+
return data;
|
|
24
|
+
}
|
|
18
25
|
function _logger() {
|
|
19
26
|
const data = require("@atlaspack/logger");
|
|
20
27
|
_logger = function () {
|
|
@@ -42,7 +49,6 @@ function _utils() {
|
|
|
42
49
|
return data;
|
|
43
50
|
}
|
|
44
51
|
var _utils2 = require("./utils");
|
|
45
|
-
var _buildCache = require("./buildCache");
|
|
46
52
|
var _projectPath = require("./projectPath");
|
|
47
53
|
function _rust() {
|
|
48
54
|
const data = require("@atlaspack/rust");
|
|
@@ -161,7 +167,7 @@ function getInvalidationId(invalidation) {
|
|
|
161
167
|
throw new Error('Unknown invalidation type: ' + invalidation.type);
|
|
162
168
|
}
|
|
163
169
|
}
|
|
164
|
-
const hashCache = (0, _buildCache.createBuildCache)();
|
|
170
|
+
const hashCache = (0, _buildCache().createBuildCache)();
|
|
165
171
|
async function getInvalidationHash(invalidations, options) {
|
|
166
172
|
if (invalidations.length === 0) {
|
|
167
173
|
return '';
|
package/lib/index.js
CHANGED
|
@@ -4,12 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
var _exportNames = {
|
|
7
|
-
registerSerializableClass: true,
|
|
8
|
-
unregisterSerializableClass: true,
|
|
9
|
-
prepareForSerialization: true,
|
|
10
|
-
restoreDeserializedObject: true,
|
|
11
|
-
serialize: true,
|
|
12
|
-
deserialize: true,
|
|
13
7
|
Atlaspack: true,
|
|
14
8
|
Parcel: true,
|
|
15
9
|
BuildError: true,
|
|
@@ -59,43 +53,6 @@ Object.defineProperty(exports, "default", {
|
|
|
59
53
|
return _Atlaspack.default;
|
|
60
54
|
}
|
|
61
55
|
});
|
|
62
|
-
Object.defineProperty(exports, "deserialize", {
|
|
63
|
-
enumerable: true,
|
|
64
|
-
get: function () {
|
|
65
|
-
return _serializer.deserialize;
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
Object.defineProperty(exports, "prepareForSerialization", {
|
|
69
|
-
enumerable: true,
|
|
70
|
-
get: function () {
|
|
71
|
-
return _serializer.prepareForSerialization;
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
Object.defineProperty(exports, "registerSerializableClass", {
|
|
75
|
-
enumerable: true,
|
|
76
|
-
get: function () {
|
|
77
|
-
return _serializer.registerSerializableClass;
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
Object.defineProperty(exports, "restoreDeserializedObject", {
|
|
81
|
-
enumerable: true,
|
|
82
|
-
get: function () {
|
|
83
|
-
return _serializer.restoreDeserializedObject;
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
Object.defineProperty(exports, "serialize", {
|
|
87
|
-
enumerable: true,
|
|
88
|
-
get: function () {
|
|
89
|
-
return _serializer.serialize;
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
Object.defineProperty(exports, "unregisterSerializableClass", {
|
|
93
|
-
enumerable: true,
|
|
94
|
-
get: function () {
|
|
95
|
-
return _serializer.unregisterSerializableClass;
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
var _serializer = require("./serializer");
|
|
99
56
|
var _Atlaspack = _interopRequireWildcard(require("./Atlaspack"));
|
|
100
57
|
var _atlaspackV = require("./atlaspack-v3");
|
|
101
58
|
Object.keys(_atlaspackV).forEach(function (key) {
|
|
@@ -4,6 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.registerCoreWithSerializer = registerCoreWithSerializer;
|
|
7
|
+
function _buildCache() {
|
|
8
|
+
const data = require("@atlaspack/build-cache");
|
|
9
|
+
_buildCache = function () {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
7
14
|
function _graph() {
|
|
8
15
|
const data = require("@atlaspack/graph");
|
|
9
16
|
_graph = function () {
|
|
@@ -11,13 +18,12 @@ function _graph() {
|
|
|
11
18
|
};
|
|
12
19
|
return data;
|
|
13
20
|
}
|
|
14
|
-
var
|
|
21
|
+
var _package = _interopRequireDefault(require("../package.json"));
|
|
22
|
+
var _AtlaspackConfig = require("./AtlaspackConfig");
|
|
15
23
|
var _AssetGraph = _interopRequireDefault(require("./AssetGraph"));
|
|
16
24
|
var _BundleGraph = _interopRequireDefault(require("./BundleGraph"));
|
|
17
|
-
var _AtlaspackConfig = require("./AtlaspackConfig");
|
|
18
|
-
var _RequestTracker = require("./RequestTracker");
|
|
19
25
|
var _Config = _interopRequireDefault(require("./public/Config"));
|
|
20
|
-
var
|
|
26
|
+
var _RequestTracker = require("./RequestTracker");
|
|
21
27
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
22
28
|
let coreRegistered;
|
|
23
29
|
function registerCoreWithSerializer() {
|
|
@@ -39,7 +45,7 @@ function registerCoreWithSerializer() {
|
|
|
39
45
|
RequestGraph: _RequestTracker.RequestGraph
|
|
40
46
|
// $FlowFixMe[unclear-type]
|
|
41
47
|
})) {
|
|
42
|
-
(0,
|
|
48
|
+
(0, _buildCache().registerSerializableClass)(packageVersion + ':' + name, ctor);
|
|
43
49
|
}
|
|
44
50
|
coreRegistered = true;
|
|
45
51
|
}
|
|
@@ -18,6 +18,13 @@ exports.resolveAtlaspackConfig = resolveAtlaspackConfig;
|
|
|
18
18
|
exports.resolveExtends = resolveExtends;
|
|
19
19
|
exports.validateConfigFile = validateConfigFile;
|
|
20
20
|
exports.validateNotEmpty = validateNotEmpty;
|
|
21
|
+
function _buildCache() {
|
|
22
|
+
const data = require("@atlaspack/build-cache");
|
|
23
|
+
_buildCache = function () {
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
21
28
|
function _utils() {
|
|
22
29
|
const data = require("@atlaspack/utils");
|
|
23
30
|
_utils = function () {
|
|
@@ -55,7 +62,6 @@ function _assert() {
|
|
|
55
62
|
}
|
|
56
63
|
var _AtlaspackConfig = require("../AtlaspackConfig");
|
|
57
64
|
var _AtlaspackConfig2 = _interopRequireDefault(require("../AtlaspackConfig.schema"));
|
|
58
|
-
var _buildCache = require("../buildCache");
|
|
59
65
|
var _projectPath = require("../projectPath");
|
|
60
66
|
var _RequestTracker = require("../RequestTracker");
|
|
61
67
|
var _utils2 = require("../utils");
|
|
@@ -103,7 +109,7 @@ function createAtlaspackConfigRequest() {
|
|
|
103
109
|
input: null
|
|
104
110
|
};
|
|
105
111
|
}
|
|
106
|
-
const atlaspackConfigCache = (0, _buildCache.createBuildCache)();
|
|
112
|
+
const atlaspackConfigCache = (0, _buildCache().createBuildCache)();
|
|
107
113
|
function getCachedAtlaspackConfig(result, options) {
|
|
108
114
|
let {
|
|
109
115
|
config: processedConfig,
|
|
@@ -15,7 +15,13 @@ function _utils() {
|
|
|
15
15
|
};
|
|
16
16
|
return data;
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
function _buildCache() {
|
|
19
|
+
const data = require("@atlaspack/build-cache");
|
|
20
|
+
_buildCache = function () {
|
|
21
|
+
return data;
|
|
22
|
+
};
|
|
23
|
+
return data;
|
|
24
|
+
}
|
|
19
25
|
function _logger() {
|
|
20
26
|
const data = require("@atlaspack/logger");
|
|
21
27
|
_logger = function () {
|
|
@@ -50,7 +56,6 @@ function _profiler() {
|
|
|
50
56
|
}
|
|
51
57
|
var _RequestTracker = require("../RequestTracker");
|
|
52
58
|
var _projectPath = require("../projectPath");
|
|
53
|
-
var _buildCache = require("../buildCache");
|
|
54
59
|
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); }
|
|
55
60
|
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; }
|
|
56
61
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -81,7 +86,7 @@ async function loadPluginConfig(loadedPlugin, config, options) {
|
|
|
81
86
|
});
|
|
82
87
|
}
|
|
83
88
|
}
|
|
84
|
-
const configKeyCache = (0, _buildCache.createBuildCache)();
|
|
89
|
+
const configKeyCache = (0, _buildCache().createBuildCache)();
|
|
85
90
|
async function getConfigKeyContentHash(filePath, configKey, options) {
|
|
86
91
|
let cacheKey = `${(0, _projectPath.fromProjectPathRelative)(filePath)}:${configKey}`;
|
|
87
92
|
let cachedValue = configKeyCache.get(cacheKey);
|
|
@@ -166,7 +171,7 @@ async function getConfigHash(config, pluginName, options) {
|
|
|
166
171
|
})), options));
|
|
167
172
|
} else if (config.result != null) {
|
|
168
173
|
try {
|
|
169
|
-
hash.writeBuffer((0,
|
|
174
|
+
hash.writeBuffer((0, _buildCache().serializeRaw)(config.result));
|
|
170
175
|
} catch (err) {
|
|
171
176
|
throw new (_diagnostic().default)({
|
|
172
177
|
diagnostic: {
|
|
@@ -8,6 +8,13 @@ exports.getDevDepRequests = getDevDepRequests;
|
|
|
8
8
|
exports.getWorkerDevDepRequests = getWorkerDevDepRequests;
|
|
9
9
|
exports.invalidateDevDeps = invalidateDevDeps;
|
|
10
10
|
exports.runDevDepRequest = runDevDepRequest;
|
|
11
|
+
function _buildCache() {
|
|
12
|
+
const data = require("@atlaspack/build-cache");
|
|
13
|
+
_buildCache = function () {
|
|
14
|
+
return data;
|
|
15
|
+
};
|
|
16
|
+
return data;
|
|
17
|
+
}
|
|
11
18
|
function _nullthrows() {
|
|
12
19
|
const data = _interopRequireDefault(require("nullthrows"));
|
|
13
20
|
_nullthrows = function () {
|
|
@@ -16,7 +23,6 @@ function _nullthrows() {
|
|
|
16
23
|
return data;
|
|
17
24
|
}
|
|
18
25
|
var _assetUtils = require("../assetUtils");
|
|
19
|
-
var _buildCache = require("../buildCache");
|
|
20
26
|
var _utils = require("../utils");
|
|
21
27
|
var _projectPath = require("../projectPath");
|
|
22
28
|
var _RequestTracker = require("../RequestTracker");
|
|
@@ -98,7 +104,7 @@ async function getDevDepRequests(api) {
|
|
|
98
104
|
|
|
99
105
|
// Tracks dev deps that have been invalidated during this build
|
|
100
106
|
// so we don't invalidate the require cache more than once.
|
|
101
|
-
const invalidatedDevDeps = (0, _buildCache.createBuildCache)();
|
|
107
|
+
const invalidatedDevDeps = (0, _buildCache().createBuildCache)();
|
|
102
108
|
function invalidateDevDeps(invalidDevDeps, options, config) {
|
|
103
109
|
for (let {
|
|
104
110
|
specifier,
|
|
@@ -142,7 +148,7 @@ async function runDevDepRequest(api, devDepRequest) {
|
|
|
142
148
|
|
|
143
149
|
// A cache of plugin dependency hashes that we've already sent to the main thread.
|
|
144
150
|
// Automatically cleared before each build.
|
|
145
|
-
const pluginCache = (0, _buildCache.createBuildCache)();
|
|
151
|
+
const pluginCache = (0, _buildCache().createBuildCache)();
|
|
146
152
|
function getWorkerDevDepRequests(devDepRequests) {
|
|
147
153
|
return devDepRequests.map(devDepRequest => {
|
|
148
154
|
// If we've already sent a matching transformer + hash to the main thread during this build,
|
|
@@ -5,6 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.ResolverRunner = void 0;
|
|
7
7
|
exports.default = createPathRequest;
|
|
8
|
+
function _buildCache() {
|
|
9
|
+
const data = require("@atlaspack/build-cache");
|
|
10
|
+
_buildCache = function () {
|
|
11
|
+
return data;
|
|
12
|
+
};
|
|
13
|
+
return data;
|
|
14
|
+
}
|
|
8
15
|
function _diagnostic() {
|
|
9
16
|
const data = _interopRequireWildcard(require("@atlaspack/diagnostic"));
|
|
10
17
|
_diagnostic = function () {
|
|
@@ -48,7 +55,6 @@ var _AtlaspackConfigRequest = _interopRequireWildcard(require("./AtlaspackConfig
|
|
|
48
55
|
var _utils2 = require("../utils");
|
|
49
56
|
var _projectPath = require("../projectPath");
|
|
50
57
|
var _types = require("../types");
|
|
51
|
-
var _buildCache = require("../buildCache");
|
|
52
58
|
var _InternalConfig = require("../InternalConfig");
|
|
53
59
|
var _ConfigRequest = require("./ConfigRequest");
|
|
54
60
|
var _DevDepRequest = require("./DevDepRequest");
|
|
@@ -126,7 +132,7 @@ async function run({
|
|
|
126
132
|
throw err;
|
|
127
133
|
}
|
|
128
134
|
}
|
|
129
|
-
const configCache = (0, _buildCache.createBuildCache)();
|
|
135
|
+
const configCache = (0, _buildCache().createBuildCache)();
|
|
130
136
|
class ResolverRunner {
|
|
131
137
|
constructor({
|
|
132
138
|
config,
|
package/lib/worker.js
CHANGED
|
@@ -37,7 +37,13 @@ var _PackagerRunner = _interopRequireDefault(require("./PackagerRunner"));
|
|
|
37
37
|
var _Validation = _interopRequireDefault(require("./Validation"));
|
|
38
38
|
var _AtlaspackConfig = require("./AtlaspackConfig");
|
|
39
39
|
var _registerCoreWithSerializer = require("./registerCoreWithSerializer");
|
|
40
|
-
|
|
40
|
+
function _buildCache() {
|
|
41
|
+
const data = require("@atlaspack/build-cache");
|
|
42
|
+
_buildCache = function () {
|
|
43
|
+
return data;
|
|
44
|
+
};
|
|
45
|
+
return data;
|
|
46
|
+
}
|
|
41
47
|
function _sourceMap() {
|
|
42
48
|
const data = require("@parcel/source-map");
|
|
43
49
|
_sourceMap = function () {
|
|
@@ -105,7 +111,7 @@ async function loadConfig(cachePath, options) {
|
|
|
105
111
|
}
|
|
106
112
|
function clearConfigCache() {
|
|
107
113
|
_utils().loadConfig.clear();
|
|
108
|
-
(0, _buildCache.clearBuildCaches)();
|
|
114
|
+
(0, _buildCache().clearBuildCaches)();
|
|
109
115
|
}
|
|
110
116
|
async function runTransform(workerApi, opts) {
|
|
111
117
|
let {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/core",
|
|
3
|
-
"version": "2.12.1-canary.
|
|
3
|
+
"version": "2.12.1-canary.3470+5c9edeedc",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -20,20 +20,21 @@
|
|
|
20
20
|
"check-ts": "tsc --noEmit index.d.ts"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@atlaspack/cache": "2.12.1-canary.
|
|
24
|
-
"@atlaspack/
|
|
25
|
-
"@atlaspack/
|
|
26
|
-
"@atlaspack/
|
|
27
|
-
"@atlaspack/
|
|
28
|
-
"@atlaspack/
|
|
29
|
-
"@atlaspack/
|
|
30
|
-
"@atlaspack/
|
|
31
|
-
"@atlaspack/
|
|
32
|
-
"@atlaspack/
|
|
33
|
-
"@atlaspack/
|
|
34
|
-
"@atlaspack/
|
|
35
|
-
"@atlaspack/
|
|
36
|
-
"@atlaspack/
|
|
23
|
+
"@atlaspack/build-cache": "2.12.1-canary.3470+5c9edeedc",
|
|
24
|
+
"@atlaspack/cache": "2.12.1-canary.3470+5c9edeedc",
|
|
25
|
+
"@atlaspack/diagnostic": "2.12.1-canary.3470+5c9edeedc",
|
|
26
|
+
"@atlaspack/events": "2.12.1-canary.3470+5c9edeedc",
|
|
27
|
+
"@atlaspack/feature-flags": "2.12.1-canary.3470+5c9edeedc",
|
|
28
|
+
"@atlaspack/fs": "2.12.1-canary.3470+5c9edeedc",
|
|
29
|
+
"@atlaspack/graph": "3.2.1-canary.3470+5c9edeedc",
|
|
30
|
+
"@atlaspack/logger": "2.12.1-canary.3470+5c9edeedc",
|
|
31
|
+
"@atlaspack/package-manager": "2.12.1-canary.3470+5c9edeedc",
|
|
32
|
+
"@atlaspack/plugin": "2.12.1-canary.3470+5c9edeedc",
|
|
33
|
+
"@atlaspack/profiler": "2.12.1-canary.3470+5c9edeedc",
|
|
34
|
+
"@atlaspack/rust": "2.12.1-canary.3470+5c9edeedc",
|
|
35
|
+
"@atlaspack/types": "2.12.1-canary.3470+5c9edeedc",
|
|
36
|
+
"@atlaspack/utils": "2.12.1-canary.3470+5c9edeedc",
|
|
37
|
+
"@atlaspack/workers": "2.12.1-canary.3470+5c9edeedc",
|
|
37
38
|
"@mischnic/json-sourcemap": "^0.1.0",
|
|
38
39
|
"@parcel/source-map": "^2.1.1",
|
|
39
40
|
"base-x": "^3.0.8",
|
|
@@ -64,5 +65,5 @@
|
|
|
64
65
|
"browser": {
|
|
65
66
|
"./src/serializerCore.js": "./src/serializerCore.browser.js"
|
|
66
67
|
},
|
|
67
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "5c9edeedc43e0a68fa1e7cdf72d6d6616432cbd9"
|
|
68
69
|
}
|
package/src/Atlaspack.js
CHANGED
|
@@ -645,9 +645,6 @@ export function createWorkerFarm(
|
|
|
645
645
|
): WorkerFarm {
|
|
646
646
|
return new WorkerFarm({
|
|
647
647
|
...options,
|
|
648
|
-
|
|
649
|
-
workerPath: process.browser
|
|
650
|
-
? '@atlaspack/core/worker'
|
|
651
|
-
: require.resolve('./worker'),
|
|
648
|
+
workerPath: require.resolve('./worker'),
|
|
652
649
|
});
|
|
653
650
|
}
|
package/src/CommittedAsset.js
CHANGED
|
@@ -4,10 +4,12 @@ import type {AST, Blob} from '@atlaspack/types';
|
|
|
4
4
|
import type {Asset, Dependency, AtlaspackOptions} from './types';
|
|
5
5
|
|
|
6
6
|
import {Readable} from 'stream';
|
|
7
|
+
|
|
8
|
+
import {deserializeRaw} from '@atlaspack/build-cache';
|
|
7
9
|
import SourceMap from '@parcel/source-map';
|
|
8
10
|
import {bufferStream, blobToStream, streamFromPromise} from '@atlaspack/utils';
|
|
11
|
+
|
|
9
12
|
import {generateFromAST} from './assetUtils';
|
|
10
|
-
import {deserializeRaw} from './serializer';
|
|
11
13
|
|
|
12
14
|
export default class CommittedAsset {
|
|
13
15
|
key: ?string;
|
package/src/PackagerRunner.js
CHANGED
|
@@ -24,6 +24,7 @@ import type {ConfigRequest} from './requests/ConfigRequest';
|
|
|
24
24
|
import type {DevDepSpecifier} from './requests/DevDepRequest';
|
|
25
25
|
|
|
26
26
|
import invariant from 'assert';
|
|
27
|
+
import {createBuildCache} from '@atlaspack/build-cache';
|
|
27
28
|
import {blobToStream, TapStream} from '@atlaspack/utils';
|
|
28
29
|
import {PluginLogger} from '@atlaspack/logger';
|
|
29
30
|
import ThrowableDiagnostic, {errorToDiagnostic} from '@atlaspack/diagnostic';
|
|
@@ -57,7 +58,6 @@ import {
|
|
|
57
58
|
createDevDependency,
|
|
58
59
|
getWorkerDevDepRequests,
|
|
59
60
|
} from './requests/DevDepRequest';
|
|
60
|
-
import {createBuildCache} from './buildCache';
|
|
61
61
|
import {getInvalidationId, getInvalidationHash} from './assetUtils';
|
|
62
62
|
import {optionsProxy} from './utils';
|
|
63
63
|
import {invalidateDevDeps} from './requests/DevDepRequest';
|
package/src/RequestTracker.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import invariant, {AssertionError} from 'assert';
|
|
4
4
|
import path from 'path';
|
|
5
5
|
|
|
6
|
+
import {deserialize, serialize} from '@atlaspack/build-cache';
|
|
6
7
|
import type {Cache} from '@atlaspack/cache';
|
|
7
8
|
import {getFeatureFlag} from '@atlaspack/feature-flags';
|
|
8
9
|
import {ContentGraph} from '@atlaspack/graph';
|
|
@@ -60,7 +61,6 @@ import type {AtlaspackConfigRequestResult} from './requests/AtlaspackConfigReque
|
|
|
60
61
|
import type {AtlaspackBuildRequestResult} from './requests/AtlaspackBuildRequest';
|
|
61
62
|
import type {EntryRequestResult} from './requests/EntryRequest';
|
|
62
63
|
import type {BundleGraphResult} from './requests/BundleGraphRequest';
|
|
63
|
-
import {deserialize, serialize} from './serializer';
|
|
64
64
|
import type {
|
|
65
65
|
AssetRequestResult,
|
|
66
66
|
AtlaspackOptions,
|
package/src/UncommittedAsset.js
CHANGED
|
@@ -14,6 +14,7 @@ import type {Asset, Dependency, AtlaspackOptions, Invalidations} from './types';
|
|
|
14
14
|
import invariant from 'assert';
|
|
15
15
|
import {Readable} from 'stream';
|
|
16
16
|
import SourceMap from '@parcel/source-map';
|
|
17
|
+
import {serializeRaw} from '@atlaspack/build-cache';
|
|
17
18
|
import {
|
|
18
19
|
blobToStream,
|
|
19
20
|
bufferStream,
|
|
@@ -23,7 +24,6 @@ import {
|
|
|
23
24
|
SOURCEMAP_RE,
|
|
24
25
|
} from '@atlaspack/utils';
|
|
25
26
|
import {hashString, hashBuffer, Hash} from '@atlaspack/rust';
|
|
26
|
-
import {serializeRaw} from './serializer';
|
|
27
27
|
import {createDependency, mergeDependencies} from './Dependency';
|
|
28
28
|
import {mergeEnvironments} from './Environment';
|
|
29
29
|
import {ATLASPACK_VERSION} from './constants';
|
package/src/assetUtils.js
CHANGED
|
@@ -21,6 +21,7 @@ import type {
|
|
|
21
21
|
} from './types';
|
|
22
22
|
|
|
23
23
|
import {Readable} from 'stream';
|
|
24
|
+
import {createBuildCache} from '@atlaspack/build-cache';
|
|
24
25
|
import {PluginLogger} from '@atlaspack/logger';
|
|
25
26
|
import nullthrows from 'nullthrows';
|
|
26
27
|
import CommittedAsset from './CommittedAsset';
|
|
@@ -30,7 +31,6 @@ import {Asset as PublicAsset} from './public/Asset';
|
|
|
30
31
|
import PluginOptions from './public/PluginOptions';
|
|
31
32
|
import {blobToStream, hashFile} from '@atlaspack/utils';
|
|
32
33
|
import {hashFromOption, toInternalSourceLocation} from './utils';
|
|
33
|
-
import {createBuildCache} from './buildCache';
|
|
34
34
|
import {
|
|
35
35
|
type ProjectPath,
|
|
36
36
|
fromProjectPath,
|
package/src/index.js
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
|
|
3
|
-
// Needs to be exported first because of circular imports
|
|
4
|
-
export {
|
|
5
|
-
registerSerializableClass,
|
|
6
|
-
unregisterSerializableClass,
|
|
7
|
-
prepareForSerialization,
|
|
8
|
-
restoreDeserializedObject,
|
|
9
|
-
serialize,
|
|
10
|
-
deserialize,
|
|
11
|
-
} from './serializer';
|
|
12
|
-
|
|
13
3
|
export {
|
|
14
4
|
default,
|
|
15
5
|
default as Atlaspack,
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
// @flow
|
|
2
|
+
|
|
3
|
+
import {registerSerializableClass} from '@atlaspack/build-cache';
|
|
2
4
|
import {Graph} from '@atlaspack/graph';
|
|
3
|
-
|
|
5
|
+
|
|
6
|
+
import packageJson from '../package.json';
|
|
7
|
+
|
|
8
|
+
import {AtlaspackConfig} from './AtlaspackConfig';
|
|
4
9
|
import AssetGraph from './AssetGraph';
|
|
5
10
|
import BundleGraph from './BundleGraph';
|
|
6
|
-
import {AtlaspackConfig} from './AtlaspackConfig';
|
|
7
|
-
import {RequestGraph} from './RequestTracker';
|
|
8
11
|
import Config from './public/Config';
|
|
9
|
-
import
|
|
12
|
+
import {RequestGraph} from './RequestTracker';
|
|
10
13
|
|
|
11
14
|
let coreRegistered;
|
|
12
15
|
export function registerCoreWithSerializer() {
|
|
@@ -15,6 +15,7 @@ import type {
|
|
|
15
15
|
ProcessedAtlaspackConfig,
|
|
16
16
|
} from '../types';
|
|
17
17
|
|
|
18
|
+
import {createBuildCache} from '@atlaspack/build-cache';
|
|
18
19
|
import {
|
|
19
20
|
isDirectoryInside,
|
|
20
21
|
hashObject,
|
|
@@ -35,7 +36,6 @@ import invariant from 'assert';
|
|
|
35
36
|
|
|
36
37
|
import {AtlaspackConfig} from '../AtlaspackConfig';
|
|
37
38
|
import AtlaspackConfigSchema from '../AtlaspackConfig.schema';
|
|
38
|
-
import {createBuildCache} from '../buildCache';
|
|
39
39
|
import {toProjectPath} from '../projectPath';
|
|
40
40
|
import {requestTypes} from '../RequestTracker';
|
|
41
41
|
import {optionsProxy} from '../utils';
|