@angular/build 22.2.0-next.5 → 22.2.0-next.7
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/package.json +14 -13
- package/src/builders/application/build-action.js +48 -39
- package/src/builders/application/build-action.js.map +1 -1
- package/src/builders/application/chunk-optimizer.js +4 -1
- package/src/builders/application/chunk-optimizer.js.map +1 -1
- package/src/builders/application/execute-build.js +1 -1
- package/src/builders/application/execute-build.js.map +1 -1
- package/src/builders/application/execute-post-bundle.js +4 -7
- package/src/builders/application/execute-post-bundle.js.map +1 -1
- package/src/builders/application/i18n.js +8 -9
- package/src/builders/application/i18n.js.map +1 -1
- package/src/builders/application/index.js +2 -2
- package/src/builders/application/index.js.map +1 -1
- package/src/builders/application/options.js +5 -2
- package/src/builders/application/options.js.map +1 -1
- package/src/builders/application/results.d.ts +3 -2
- package/src/builders/application/schema.d.ts +2 -1
- package/src/builders/application/schema.js.map +1 -1
- package/src/builders/application/schema.json +1 -2
- package/src/builders/dev-server/options.d.ts +4 -1
- package/src/builders/dev-server/options.js +1 -0
- package/src/builders/dev-server/options.js.map +1 -1
- package/src/builders/dev-server/vite/index.js +4 -7
- package/src/builders/dev-server/vite/index.js.map +1 -1
- package/src/builders/dev-server/vite/server.js +2 -2
- package/src/builders/dev-server/vite/server.js.map +1 -1
- package/src/builders/dev-server/vite/utils.d.ts +1 -1
- package/src/builders/dev-server/vite/utils.js +9 -4
- package/src/builders/dev-server/vite/utils.js.map +1 -1
- package/src/builders/extract-i18n/application-extraction.js +6 -5
- package/src/builders/extract-i18n/application-extraction.js.map +1 -1
- package/src/builders/karma/application_builder.js +1 -1
- package/src/builders/karma/application_builder.js.map +1 -1
- package/src/builders/karma/assets-middleware.d.ts +2 -2
- package/src/builders/karma/assets-middleware.js +5 -2
- package/src/builders/karma/assets-middleware.js.map +1 -1
- package/src/builders/karma/progress-reporter.js +7 -5
- package/src/builders/karma/progress-reporter.js.map +1 -1
- package/src/builders/karma/utils.d.ts +2 -1
- package/src/builders/karma/utils.js +2 -2
- package/src/builders/karma/utils.js.map +1 -1
- package/src/builders/unit-test/builder.js +1 -1
- package/src/builders/unit-test/options.d.ts +1 -0
- package/src/builders/unit-test/options.js +2 -1
- package/src/builders/unit-test/options.js.map +1 -1
- package/src/builders/unit-test/runners/vitest/build-options.js +5 -6
- package/src/builders/unit-test/runners/vitest/build-options.js.map +1 -1
- package/src/builders/unit-test/runners/vitest/executor.js +4 -4
- package/src/builders/unit-test/runners/vitest/executor.js.map +1 -1
- package/src/builders/unit-test/runners/vitest/plugins.d.ts +3 -4
- package/src/builders/unit-test/runners/vitest/plugins.js +2 -0
- package/src/builders/unit-test/runners/vitest/plugins.js.map +1 -1
- package/src/builders/unit-test/schema.d.ts +10 -2
- package/src/builders/unit-test/schema.js.map +1 -1
- package/src/builders/unit-test/schema.json +7 -1
- package/src/private.d.ts +1 -2
- package/src/private.js +4 -5
- package/src/private.js.map +1 -1
- package/src/tools/angular/compilation/angular-compilation.d.ts +3 -8
- package/src/tools/angular/compilation/angular-compilation.js +2 -88
- package/src/tools/angular/compilation/angular-compilation.js.map +1 -1
- package/src/tools/angular/compilation/aot-compilation.d.ts +5 -5
- package/src/tools/angular/compilation/aot-compilation.js +8 -14
- package/src/tools/angular/compilation/aot-compilation.js.map +1 -1
- package/src/tools/angular/compilation/compiler-options.d.ts +24 -0
- package/src/tools/angular/compilation/compiler-options.js +135 -0
- package/src/tools/angular/compilation/compiler-options.js.map +1 -0
- package/src/tools/angular/compilation/index.d.ts +1 -1
- package/src/tools/angular/compilation/index.js +1 -3
- package/src/tools/angular/compilation/index.js.map +1 -1
- package/src/tools/angular/compilation/jit-compilation.d.ts +5 -5
- package/src/tools/angular/compilation/jit-compilation.js +7 -16
- package/src/tools/angular/compilation/jit-compilation.js.map +1 -1
- package/src/tools/angular/compilation/parallel-compilation.d.ts +2 -7
- package/src/tools/angular/compilation/parallel-compilation.js +3 -29
- package/src/tools/angular/compilation/parallel-compilation.js.map +1 -1
- package/src/tools/angular/compilation/parallel-worker.d.ts +2 -2
- package/src/tools/angular/compilation/parallel-worker.js +3 -12
- package/src/tools/angular/compilation/parallel-worker.js.map +1 -1
- package/src/tools/angular/compilation/typescript-compilation.d.ts +31 -0
- package/src/tools/angular/compilation/typescript-compilation.js +115 -0
- package/src/tools/angular/compilation/typescript-compilation.js.map +1 -0
- package/src/tools/esbuild/angular/compilation-state.d.ts +23 -3
- package/src/tools/esbuild/angular/compilation-state.js +51 -13
- package/src/tools/esbuild/angular/compilation-state.js.map +1 -1
- package/src/tools/esbuild/angular/compiler-plugin.js +76 -114
- package/src/tools/esbuild/angular/compiler-plugin.js.map +1 -1
- package/src/tools/esbuild/bundler-execution-result.d.ts +1 -0
- package/src/tools/esbuild/bundler-execution-result.js +2 -2
- package/src/tools/esbuild/bundler-execution-result.js.map +1 -1
- package/src/tools/esbuild/cache.d.ts +17 -10
- package/src/tools/esbuild/cache.js +60 -47
- package/src/tools/esbuild/cache.js.map +1 -1
- package/src/tools/esbuild/i18n-inliner-worker.d.ts +47 -55
- package/src/tools/esbuild/i18n-inliner-worker.js +67 -98
- package/src/tools/esbuild/i18n-inliner-worker.js.map +1 -1
- package/src/tools/esbuild/i18n-inliner.d.ts +15 -11
- package/src/tools/esbuild/i18n-inliner.js +227 -122
- package/src/tools/esbuild/i18n-inliner.js.map +1 -1
- package/src/tools/esbuild/i18n-translation-encoder.d.ts +2 -1
- package/src/tools/esbuild/i18n-translation-encoder.js.map +1 -1
- package/src/tools/esbuild/i18n-translation-reader.d.ts +4 -3
- package/src/tools/esbuild/i18n-translation-reader.js.map +1 -1
- package/src/tools/esbuild/index-html-generator.js +1 -1
- package/src/tools/esbuild/index-html-generator.js.map +1 -1
- package/src/tools/esbuild/javascript-transformer-worker.js +8 -4
- package/src/tools/esbuild/javascript-transformer-worker.js.map +1 -1
- package/src/tools/esbuild/javascript-transformer.d.ts +18 -6
- package/src/tools/esbuild/javascript-transformer.js +104 -41
- package/src/tools/esbuild/javascript-transformer.js.map +1 -1
- package/src/tools/esbuild/lmdb-cache-store.js +1 -1
- package/src/tools/esbuild/lmdb-cache-store.js.map +1 -1
- package/src/tools/esbuild/persistent-load-result-cache.js +9 -31
- package/src/tools/esbuild/persistent-load-result-cache.js.map +1 -1
- package/src/tools/esbuild/sourcemap-ignorelist-plugin.js +109 -0
- package/src/tools/esbuild/sourcemap-ignorelist-plugin.js.map +1 -1
- package/src/tools/esbuild/sqlite-cache-store.d.ts +9 -1
- package/src/tools/esbuild/sqlite-cache-store.js +249 -63
- package/src/tools/esbuild/sqlite-cache-store.js.map +1 -1
- package/src/tools/esbuild/stylesheets/sass-language.d.ts +1 -0
- package/src/tools/esbuild/stylesheets/sass-language.js +68 -42
- package/src/tools/esbuild/stylesheets/sass-language.js.map +1 -1
- package/src/tools/esbuild/stylesheets/stylesheet-plugin-factory.d.ts +1 -1
- package/src/tools/esbuild/utils.d.ts +1 -1
- package/src/tools/esbuild/utils.js.map +1 -1
- package/src/tools/esbuild/watcher.js +26 -3
- package/src/tools/esbuild/watcher.js.map +1 -1
- package/src/tools/oxc/oxc-transform.js +76 -118
- package/src/tools/oxc/oxc-transform.js.map +1 -1
- package/src/tools/oxc/traversal.d.ts +32 -0
- package/src/tools/oxc/traversal.js +299 -0
- package/src/tools/oxc/traversal.js.map +1 -0
- package/src/tools/sass/rebasing-importer.d.ts +8 -14
- package/src/tools/sass/rebasing-importer.js +18 -24
- package/src/tools/sass/rebasing-importer.js.map +1 -1
- package/src/tools/sass/sass-service.d.ts +15 -38
- package/src/tools/sass/sass-service.js +132 -187
- package/src/tools/sass/sass-service.js.map +1 -1
- package/src/utils/environment-options.d.ts +12 -0
- package/src/utils/environment-options.js +20 -12
- package/src/utils/environment-options.js.map +1 -1
- package/src/utils/i18n-options.d.ts +2 -1
- package/src/utils/i18n-options.js.map +1 -1
- package/src/utils/index-file/index-html-generator.d.ts +1 -1
- package/src/utils/index-file/index-html-generator.js +9 -13
- package/src/utils/index-file/index-html-generator.js.map +1 -1
- package/src/utils/index-file/inline-critical-css.d.ts +16 -18
- package/src/utils/index-file/inline-critical-css.js +44 -189
- package/src/utils/index-file/inline-critical-css.js.map +1 -1
- package/src/utils/index-file/nonce.d.ts +2 -0
- package/src/utils/index-file/nonce.js +1 -0
- package/src/utils/index-file/nonce.js.map +1 -1
- package/src/utils/normalize-cache.d.ts +11 -1
- package/src/utils/normalize-cache.js +6 -3
- package/src/utils/normalize-cache.js.map +1 -1
- package/src/utils/purge-cache.js +24 -13
- package/src/utils/purge-cache.js.map +1 -1
- package/src/utils/server-rendering/manifest.d.ts +2 -2
- package/src/utils/server-rendering/manifest.js +53 -4
- package/src/utils/server-rendering/manifest.js.map +1 -1
- package/src/utils/server-rendering/prerender.d.ts +2 -1
- package/src/utils/server-rendering/prerender.js +31 -18
- package/src/utils/server-rendering/prerender.js.map +1 -1
- package/src/utils/server-rendering/render-worker.d.ts +6 -4
- package/src/utils/server-rendering/render-worker.js +3 -1
- package/src/utils/server-rendering/render-worker.js.map +1 -1
- package/src/utils/test-files.d.ts +2 -2
- package/src/utils/test-files.js +3 -3
- package/src/utils/test-files.js.map +1 -1
- package/src/tools/angular/compilation/noop-compilation.d.ts +0 -15
- package/src/tools/angular/compilation/noop-compilation.js +0 -27
- package/src/tools/angular/compilation/noop-compilation.js.map +0 -1
- package/src/tools/sass/worker.d.ts +0 -63
- package/src/tools/sass/worker.js +0 -202
- package/src/tools/sass/worker.js.map +0 -1
- /package/src/tools/{esbuild/angular → angular/compilation}/diagnostics.d.ts +0 -0
- /package/src/tools/{esbuild/angular → angular/compilation}/diagnostics.js +0 -0
- /package/src/tools/{esbuild/angular → angular/compilation}/diagnostics.js.map +0 -0
|
@@ -40,7 +40,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
40
40
|
};
|
|
41
41
|
})();
|
|
42
42
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
-
exports.MemoryCache = exports.Cache = void 0;
|
|
43
|
+
exports.MemoryCache = exports.Cache = exports.NamespacedCacheStore = void 0;
|
|
44
44
|
exports.createPersistentCacheStore = createPersistentCacheStore;
|
|
45
45
|
/**
|
|
46
46
|
* @fileoverview
|
|
@@ -48,6 +48,35 @@ exports.createPersistentCacheStore = createPersistentCacheStore;
|
|
|
48
48
|
*/
|
|
49
49
|
const environment_options_1 = require("../../utils/environment-options");
|
|
50
50
|
const error_1 = require("../../utils/error");
|
|
51
|
+
/**
|
|
52
|
+
* A backing data store wrapper that namespaces all keys using length-prefix framing.
|
|
53
|
+
* Prevents key collisions between namespaces regardless of characters (such as colons)
|
|
54
|
+
* in the namespace or key.
|
|
55
|
+
*/
|
|
56
|
+
class NamespacedCacheStore {
|
|
57
|
+
store;
|
|
58
|
+
namespace;
|
|
59
|
+
#prefix;
|
|
60
|
+
constructor(store, namespace) {
|
|
61
|
+
this.store = store;
|
|
62
|
+
this.namespace = namespace;
|
|
63
|
+
this.#prefix = `${namespace.length}:${namespace}:`;
|
|
64
|
+
}
|
|
65
|
+
get(key) {
|
|
66
|
+
return this.store.get(this.#prefix + key);
|
|
67
|
+
}
|
|
68
|
+
has(key) {
|
|
69
|
+
return this.store.has(this.#prefix + key);
|
|
70
|
+
}
|
|
71
|
+
set(key, value) {
|
|
72
|
+
const result = this.store.set(this.#prefix + key, value);
|
|
73
|
+
if (result instanceof Promise) {
|
|
74
|
+
return result.then(() => this);
|
|
75
|
+
}
|
|
76
|
+
return this;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.NamespacedCacheStore = NamespacedCacheStore;
|
|
51
80
|
/**
|
|
52
81
|
* A cache object that allows accessing and storing key/value pairs in
|
|
53
82
|
* an underlying CacheStore. This class is the primary method for consumers
|
|
@@ -55,16 +84,14 @@ const error_1 = require("../../utils/error");
|
|
|
55
84
|
*/
|
|
56
85
|
class Cache {
|
|
57
86
|
store;
|
|
58
|
-
namespace;
|
|
59
87
|
// In-flight creator promises to deduplicate concurrent requests for the same key.
|
|
60
88
|
#requests = new Map();
|
|
61
89
|
// Track how many writes occurred for a key to detect mutations during await gaps.
|
|
62
90
|
#writeCounts = new Map();
|
|
63
91
|
// Count the number of active, pending getOrCreate operations per key to avoid memory leaks.
|
|
64
92
|
#pendingGets = new Map();
|
|
65
|
-
constructor(store
|
|
93
|
+
constructor(store) {
|
|
66
94
|
this.store = store;
|
|
67
|
-
this.namespace = namespace;
|
|
68
95
|
}
|
|
69
96
|
#incrementWrite(key) {
|
|
70
97
|
// Only track write counts if there is a pending getOrCreate operation active for the key.
|
|
@@ -73,17 +100,6 @@ class Cache {
|
|
|
73
100
|
this.#writeCounts.set(key, (this.#writeCounts.get(key) || 0) + 1);
|
|
74
101
|
}
|
|
75
102
|
}
|
|
76
|
-
/**
|
|
77
|
-
* Prefixes a key with the cache namespace if present.
|
|
78
|
-
* @param key A key string to prefix.
|
|
79
|
-
* @returns A prefixed key if a namespace is present. Otherwise the provided key.
|
|
80
|
-
*/
|
|
81
|
-
withNamespace(key) {
|
|
82
|
-
if (this.namespace) {
|
|
83
|
-
return `${this.namespace}:${key}`;
|
|
84
|
-
}
|
|
85
|
-
return key;
|
|
86
|
-
}
|
|
87
103
|
/**
|
|
88
104
|
* Gets the value associated with a provided key if available.
|
|
89
105
|
* Otherwise, creates a value using the factory creator function, puts the value
|
|
@@ -93,22 +109,21 @@ class Cache {
|
|
|
93
109
|
* @returns A value associated with the provided key.
|
|
94
110
|
*/
|
|
95
111
|
async getOrCreate(key, creator) {
|
|
96
|
-
const namespacedKey = this.withNamespace(key);
|
|
97
112
|
// 1. If another call is already running the creator for this key, share its promise.
|
|
98
|
-
let activeRequest = this.#requests.get(
|
|
113
|
+
let activeRequest = this.#requests.get(key);
|
|
99
114
|
if (activeRequest !== undefined) {
|
|
100
115
|
return activeRequest;
|
|
101
116
|
}
|
|
102
117
|
// Increment pending gets count to enable write-tracking for this key.
|
|
103
|
-
const currentPending = this.#pendingGets.get(
|
|
104
|
-
this.#pendingGets.set(
|
|
118
|
+
const currentPending = this.#pendingGets.get(key) || 0;
|
|
119
|
+
this.#pendingGets.set(key, currentPending + 1);
|
|
105
120
|
try {
|
|
106
|
-
const startWriteCount = this.#writeCounts.get(
|
|
121
|
+
const startWriteCount = this.#writeCounts.get(key) || 0;
|
|
107
122
|
// 2. Query the backing store. Since store.get can be async, we yield to the event loop.
|
|
108
|
-
const value = await this.store.get(
|
|
123
|
+
const value = await this.store.get(key);
|
|
109
124
|
// If a write (e.g. put) occurred during the store.get await gap, we must abort
|
|
110
125
|
// the current execution and restart to ensure we return the newly written value.
|
|
111
|
-
if ((this.#writeCounts.get(
|
|
126
|
+
if ((this.#writeCounts.get(key) || 0) !== startWriteCount) {
|
|
112
127
|
return this.getOrCreate(key, creator);
|
|
113
128
|
}
|
|
114
129
|
if (value !== undefined) {
|
|
@@ -116,7 +131,7 @@ class Cache {
|
|
|
116
131
|
}
|
|
117
132
|
// 3. Recheck active request after the await gap in case another concurrent call
|
|
118
133
|
// initiated a creator during the store.get wait.
|
|
119
|
-
activeRequest = this.#requests.get(
|
|
134
|
+
activeRequest = this.#requests.get(key);
|
|
120
135
|
if (activeRequest !== undefined) {
|
|
121
136
|
return activeRequest;
|
|
122
137
|
}
|
|
@@ -124,31 +139,31 @@ class Cache {
|
|
|
124
139
|
activeRequest = Promise.resolve(creator()).then(async (newValue) => {
|
|
125
140
|
// Ensure this request is still the active one before writing back to the store
|
|
126
141
|
// (prevents overwriting newer data if put() was called before resolution).
|
|
127
|
-
if (this.#requests.get(
|
|
128
|
-
this.#incrementWrite(
|
|
129
|
-
await this.store.set(
|
|
130
|
-
this.#requests.delete(
|
|
142
|
+
if (this.#requests.get(key) === activeRequest) {
|
|
143
|
+
this.#incrementWrite(key);
|
|
144
|
+
await this.store.set(key, newValue);
|
|
145
|
+
this.#requests.delete(key);
|
|
131
146
|
}
|
|
132
147
|
return newValue;
|
|
133
148
|
}, (error) => {
|
|
134
149
|
// Clean up the active request if the creator fails.
|
|
135
|
-
if (this.#requests.get(
|
|
136
|
-
this.#requests.delete(
|
|
150
|
+
if (this.#requests.get(key) === activeRequest) {
|
|
151
|
+
this.#requests.delete(key);
|
|
137
152
|
}
|
|
138
153
|
throw error;
|
|
139
154
|
});
|
|
140
|
-
this.#requests.set(
|
|
155
|
+
this.#requests.set(key, activeRequest);
|
|
141
156
|
return activeRequest;
|
|
142
157
|
}
|
|
143
158
|
finally {
|
|
144
159
|
// Clean up write counts and pending gets once all concurrent gets for this key finish.
|
|
145
|
-
const current = this.#pendingGets.get(
|
|
160
|
+
const current = this.#pendingGets.get(key) || 0;
|
|
146
161
|
if (current <= 1) {
|
|
147
|
-
this.#pendingGets.delete(
|
|
148
|
-
this.#writeCounts.delete(
|
|
162
|
+
this.#pendingGets.delete(key);
|
|
163
|
+
this.#writeCounts.delete(key);
|
|
149
164
|
}
|
|
150
165
|
else {
|
|
151
|
-
this.#pendingGets.set(
|
|
166
|
+
this.#pendingGets.set(key, current - 1);
|
|
152
167
|
}
|
|
153
168
|
}
|
|
154
169
|
}
|
|
@@ -158,7 +173,7 @@ class Cache {
|
|
|
158
173
|
* @returns A value associated with the provided key if present. Otherwise, `undefined`.
|
|
159
174
|
*/
|
|
160
175
|
async get(key) {
|
|
161
|
-
const value = await this.store.get(
|
|
176
|
+
const value = await this.store.get(key);
|
|
162
177
|
return value;
|
|
163
178
|
}
|
|
164
179
|
/**
|
|
@@ -168,18 +183,17 @@ class Cache {
|
|
|
168
183
|
* @param value A value to put in the cache.
|
|
169
184
|
*/
|
|
170
185
|
async put(key, value) {
|
|
171
|
-
|
|
172
|
-
this.#
|
|
173
|
-
this
|
|
174
|
-
await this.store.set(namespacedKey, value);
|
|
186
|
+
this.#requests.delete(key);
|
|
187
|
+
this.#incrementWrite(key);
|
|
188
|
+
await this.store.set(key, value);
|
|
175
189
|
}
|
|
176
190
|
/**
|
|
177
|
-
* Clears internal state for a specific
|
|
191
|
+
* Clears internal state for a specific key (requests, write counts, and pending gets).
|
|
178
192
|
*/
|
|
179
|
-
deleteInternal(
|
|
180
|
-
this.#requests.delete(
|
|
181
|
-
this.#writeCounts.delete(
|
|
182
|
-
this.#pendingGets.delete(
|
|
193
|
+
deleteInternal(key) {
|
|
194
|
+
this.#requests.delete(key);
|
|
195
|
+
this.#writeCounts.delete(key);
|
|
196
|
+
this.#pendingGets.delete(key);
|
|
183
197
|
}
|
|
184
198
|
/**
|
|
185
199
|
* Clears the base class internal state (requests, write counts, and pending gets).
|
|
@@ -204,9 +218,8 @@ class MemoryCache extends Cache {
|
|
|
204
218
|
* @returns True if an element in the Map existed and has been removed, or false if the element does not exist.
|
|
205
219
|
*/
|
|
206
220
|
delete(key) {
|
|
207
|
-
|
|
208
|
-
this.
|
|
209
|
-
return this.store.delete(namespacedKey);
|
|
221
|
+
this.deleteInternal(key);
|
|
222
|
+
return this.store.delete(key);
|
|
210
223
|
}
|
|
211
224
|
/**
|
|
212
225
|
* Removes all entries from the cache instance.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.js","sourceRoot":"","sources":["cache.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"cache.js","sourceRoot":"","sources":["cache.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoRH,gEAsDC;AAxUD;;;GAGG;AAEH,yEAA8E;AAC9E,6CAAkD;AAuClD;;;;GAIG;AACH,MAAa,oBAAoB;IAIZ;IACR;IAJF,OAAO,CAAS;IAEzB,YACmB,KAAoB,EAC5B,SAAiB;QADT,UAAK,GAAL,KAAK,CAAe;QAC5B,cAAS,GAAT,SAAS,CAAQ;QAE1B,IAAI,CAAC,OAAO,GAAG,GAAG,SAAS,CAAC,MAAM,IAAI,SAAS,GAAG,CAAC;IACrD,CAAC;IAED,GAAG,CAAC,GAAW;QACb,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI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D,CAAC;QAAC,OAAO,WAAW,EAAE,CAAC;YACrB,IAAA,qBAAa,EAAC,SAAS,CAAC,CAAC;YACzB,IAAA,qBAAa,EAAC,WAAW,CAAC,CAAC;YAE3B,MAAM,IAAI,KAAK,CACb,kDAAkD;gBAChD,eAAe,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI;gBACnD,iBAAiB,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,EACvD,EAAE,KAAK,EAAE,WAAW,EAAE,CACvB,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -5,30 +5,10 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
|
-
/**
|
|
9
|
-
* The options passed to the inliner for each file request
|
|
10
|
-
*/
|
|
11
|
-
interface InlineFileRequest {
|
|
12
|
-
/**
|
|
13
|
-
* The filename that should be processed. The data for the file is provided to the Worker
|
|
14
|
-
* during Worker initialization.
|
|
15
|
-
*/
|
|
16
|
-
filename: string;
|
|
17
|
-
/**
|
|
18
|
-
* The locale specifier that should be used during the inlining process of the file.
|
|
19
|
-
*/
|
|
20
|
-
locale: string;
|
|
21
|
-
/**
|
|
22
|
-
* The serialized translation messages for the locale that should be used during the inlining
|
|
23
|
-
* process of the file. A SharedArrayBuffer or Blob is used so that the messages are shared with
|
|
24
|
-
* the Worker by reference instead of being copied into it for every request.
|
|
25
|
-
*/
|
|
26
|
-
translation?: Blob | SharedArrayBuffer;
|
|
27
|
-
}
|
|
28
8
|
/**
|
|
29
9
|
* The options passed to the inliner for each code request
|
|
30
10
|
*/
|
|
31
|
-
interface InlineCodeRequest {
|
|
11
|
+
export interface InlineCodeRequest {
|
|
32
12
|
/**
|
|
33
13
|
* The code that should be processed.
|
|
34
14
|
*/
|
|
@@ -47,23 +27,45 @@ interface InlineCodeRequest {
|
|
|
47
27
|
* the Worker by reference instead of being copied into it for every request.
|
|
48
28
|
*/
|
|
49
29
|
translation?: Blob | SharedArrayBuffer;
|
|
30
|
+
/**
|
|
31
|
+
* How to handle missing translations.
|
|
32
|
+
*/
|
|
33
|
+
missingTranslation?: 'error' | 'warning' | 'ignore';
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The response returned from a code request.
|
|
37
|
+
*/
|
|
38
|
+
export interface InlineCodeResult {
|
|
39
|
+
output: string;
|
|
40
|
+
messages: {
|
|
41
|
+
type: 'error' | 'warning';
|
|
42
|
+
message: string;
|
|
43
|
+
}[];
|
|
50
44
|
}
|
|
51
45
|
/**
|
|
52
46
|
* The options passed to the inliner for a batch file request
|
|
53
47
|
*/
|
|
54
|
-
interface InlineFileBatchRequest {
|
|
48
|
+
export interface InlineFileBatchRequest {
|
|
55
49
|
/**
|
|
56
|
-
* The filename that should be processed.
|
|
57
|
-
* during Worker initialization.
|
|
50
|
+
* The filename that should be processed.
|
|
58
51
|
*/
|
|
59
52
|
filename: string;
|
|
60
53
|
/**
|
|
61
|
-
* The
|
|
54
|
+
* The file content as a Blob.
|
|
55
|
+
*/
|
|
56
|
+
code: Blob;
|
|
57
|
+
/**
|
|
58
|
+
* Optional sourcemap content as a Blob.
|
|
59
|
+
*/
|
|
60
|
+
map?: Blob;
|
|
61
|
+
/**
|
|
62
|
+
* The locale specifiers and optional translations to use during the inlining process of the file.
|
|
63
|
+
*/
|
|
64
|
+
locales: ReadonlyMap<string, Blob | SharedArrayBuffer | undefined>;
|
|
65
|
+
/**
|
|
66
|
+
* How to handle missing translations.
|
|
62
67
|
*/
|
|
63
|
-
|
|
64
|
-
locale: string;
|
|
65
|
-
translation?: Blob | SharedArrayBuffer;
|
|
66
|
-
})[];
|
|
68
|
+
missingTranslation?: 'error' | 'warning' | 'ignore';
|
|
67
69
|
/**
|
|
68
70
|
* Whether the file data should be treated as ephemeral and not cached long-term in the Worker.
|
|
69
71
|
* Typically true when all remaining locales for the file are processed in a single batch.
|
|
@@ -74,13 +76,18 @@ interface InlineFileBatchRequest {
|
|
|
74
76
|
* not present in this list will be evicted from the Worker's memory cache.
|
|
75
77
|
*/
|
|
76
78
|
activeLocales?: string[];
|
|
79
|
+
/**
|
|
80
|
+
* The current inlining generation counter. When a request with a new generation is received,
|
|
81
|
+
* all long-term worker caches are cleared.
|
|
82
|
+
*/
|
|
83
|
+
generation?: number;
|
|
77
84
|
}
|
|
78
85
|
/**
|
|
79
86
|
* The result for a single locale within a batch file request.
|
|
80
87
|
*/
|
|
81
|
-
interface InlineLocaleResult {
|
|
88
|
+
export interface InlineLocaleResult {
|
|
82
89
|
locale: string;
|
|
83
|
-
code
|
|
90
|
+
code?: string;
|
|
84
91
|
map?: string;
|
|
85
92
|
messages: {
|
|
86
93
|
type: 'error' | 'warning';
|
|
@@ -90,26 +97,18 @@ interface InlineLocaleResult {
|
|
|
90
97
|
/**
|
|
91
98
|
* The response returned from a batch file request.
|
|
92
99
|
*/
|
|
93
|
-
|
|
100
|
+
export type InlineFileBatchResult = {
|
|
94
101
|
file: string;
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Inlines the provided locale and translation into a JavaScript file that contains `$localize` usage.
|
|
99
|
-
* This function is the main entry for the Worker's action that is called by the worker pool.
|
|
100
|
-
*
|
|
101
|
-
* @param request An InlineRequest object representing the options for inlining
|
|
102
|
-
* @returns An object containing the inlined file and optional map content.
|
|
103
|
-
*/
|
|
104
|
-
export default function inlineFile(request: InlineFileRequest): Promise<{
|
|
105
|
-
file: string;
|
|
106
|
-
code: string;
|
|
107
|
-
map: string | undefined;
|
|
102
|
+
unmodified: true;
|
|
108
103
|
messages: {
|
|
109
|
-
type:
|
|
104
|
+
type: 'error' | 'warning';
|
|
110
105
|
message: string;
|
|
111
106
|
}[];
|
|
112
|
-
}
|
|
107
|
+
} | {
|
|
108
|
+
file: string;
|
|
109
|
+
unmodified?: false;
|
|
110
|
+
results: InlineLocaleResult[];
|
|
111
|
+
};
|
|
113
112
|
/**
|
|
114
113
|
* Inlines multiple locales and translations into a JavaScript file that contains `$localize` usage.
|
|
115
114
|
*
|
|
@@ -124,11 +123,4 @@ export declare function inlineFileBatch(request: InlineFileBatchRequest): Promis
|
|
|
124
123
|
* @param request An InlineRequest object representing the options for inlining
|
|
125
124
|
* @returns An object containing the inlined code.
|
|
126
125
|
*/
|
|
127
|
-
export declare function inlineCode(request: InlineCodeRequest): Promise<
|
|
128
|
-
output: string;
|
|
129
|
-
messages: {
|
|
130
|
-
type: "warning" | "error";
|
|
131
|
-
message: string;
|
|
132
|
-
}[];
|
|
133
|
-
}>;
|
|
134
|
-
export {};
|
|
126
|
+
export declare function inlineCode(request: InlineCodeRequest): Promise<InlineCodeResult>;
|