ember-vite-hmr 0.6.8 → 1.0.0
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/addon-main.cjs +1 -1
- package/dist/lib/babel-plugin.js +61 -233
- package/dist/lib/hmr.d.ts +2 -8
- package/dist/lib/hmr.js +6 -3
- package/package.json +9 -6
- package/dist/_app_/initializers/webpack-hot-reload.js +0 -1
- package/dist/_app_/services/webpack-hot-reload.js +0 -1
- package/dist/initializers/webpack-hot-reload.js +0 -15
- package/dist/initializers/webpack-hot-reload.js.map +0 -1
- package/dist/lib/babel-plugin.d.ts +0 -34
- package/dist/services/webpack-hot-reload.js +0 -202
- package/dist/services/webpack-hot-reload.js.map +0 -1
- package/dist/template-registry.js +0 -2
- package/dist/template-registry.js.map +0 -1
package/addon-main.cjs
CHANGED
package/dist/lib/babel-plugin.js
CHANGED
|
@@ -24,7 +24,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.hotAstProcessor = void 0;
|
|
27
|
-
const core_1 = require("@babel/core");
|
|
28
27
|
const glimmer = __importStar(require("@glimmer/syntax"));
|
|
29
28
|
const babel_import_util_1 = require("babel-import-util");
|
|
30
29
|
const builtInComponents = ['LinkTo'];
|
|
@@ -84,37 +83,45 @@ class HotAstProcessor {
|
|
|
84
83
|
};
|
|
85
84
|
this.counter = 0;
|
|
86
85
|
this.meta = {
|
|
87
|
-
|
|
86
|
+
locals: new Set(),
|
|
88
87
|
importVar: null,
|
|
88
|
+
babelProgram: null,
|
|
89
|
+
importBindings: new Set(),
|
|
89
90
|
};
|
|
91
|
+
this.didCreateImportClass = false;
|
|
90
92
|
this.transform = this.transform.bind(this);
|
|
91
93
|
}
|
|
94
|
+
reset() {
|
|
95
|
+
this.meta.importVar = null;
|
|
96
|
+
this.meta.babelProgram = null;
|
|
97
|
+
this.meta.importBindings = new Set();
|
|
98
|
+
}
|
|
92
99
|
transform(env) {
|
|
93
|
-
if (
|
|
100
|
+
if (process.env['EMBER_VITE_HMR_ENABLED'] !== 'true') {
|
|
94
101
|
return {
|
|
95
|
-
visitor: {}
|
|
96
|
-
};
|
|
97
|
-
const meta = this.meta;
|
|
98
|
-
meta.usedImports = new Set();
|
|
99
|
-
const usedImports = this.meta.usedImports;
|
|
100
|
-
const imports = [...env.locals];
|
|
101
|
-
if (!meta.importVar) {
|
|
102
|
-
return {
|
|
103
|
-
visitor: {},
|
|
102
|
+
visitor: {}
|
|
104
103
|
};
|
|
105
104
|
}
|
|
106
|
-
const
|
|
107
|
-
env.
|
|
108
|
-
|
|
105
|
+
const meta = this.meta;
|
|
106
|
+
const importVar = meta.importVar || env.meta.jsutils.bindExpression('null', null, { nameHint: 'template__imports__' });
|
|
107
|
+
meta.importVar = importVar;
|
|
108
|
+
const findImport = function findImport(specifier) {
|
|
109
|
+
return meta.babelProgram.body.find(b => b.type === 'ImportDeclaration' && b.specifiers.some(s => s.local.name === specifier));
|
|
110
|
+
};
|
|
109
111
|
return {
|
|
110
|
-
visitor:
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
112
|
+
visitor: {
|
|
113
|
+
...this.buildVisitor({
|
|
114
|
+
importVar,
|
|
115
|
+
importBindings: meta.importBindings,
|
|
116
|
+
babelProgram: meta.babelProgram
|
|
117
|
+
}),
|
|
118
|
+
},
|
|
115
119
|
};
|
|
116
120
|
}
|
|
117
|
-
buildVisitor({ importVar,
|
|
121
|
+
buildVisitor({ importVar, importBindings, babelProgram }) {
|
|
122
|
+
const findImport = function findImport(specifier) {
|
|
123
|
+
return babelProgram.body.find(b => b.type === 'ImportDeclaration' && b.specifiers.some(s => s.local.name === specifier));
|
|
124
|
+
};
|
|
118
125
|
const findBlockParams = function (expression, p) {
|
|
119
126
|
if (p.node &&
|
|
120
127
|
p.node.type === 'BlockStatement' &&
|
|
@@ -131,8 +138,9 @@ class HotAstProcessor {
|
|
|
131
138
|
};
|
|
132
139
|
const visitor = {
|
|
133
140
|
PathExpression: (node, p) => {
|
|
134
|
-
|
|
135
|
-
|
|
141
|
+
var _a, _b;
|
|
142
|
+
if ((((_a = p.parentNode) === null || _a === void 0 ? void 0 : _a.type) === 'SubExpression' ||
|
|
143
|
+
((_b = p.parentNode) === null || _b === void 0 ? void 0 : _b.type) === 'MustacheStatement') &&
|
|
136
144
|
p.parentNode.params.includes(node)) {
|
|
137
145
|
return;
|
|
138
146
|
}
|
|
@@ -155,250 +163,70 @@ class HotAstProcessor {
|
|
|
155
163
|
if (original &&
|
|
156
164
|
findBlockParams(original, p))
|
|
157
165
|
return;
|
|
158
|
-
if (original
|
|
166
|
+
if (original === null || original === void 0 ? void 0 : original.includes('.'))
|
|
159
167
|
return;
|
|
160
168
|
if (!original)
|
|
161
169
|
return;
|
|
162
170
|
const param = glimmer.builders.path(`${importVar}.${original}`);
|
|
163
171
|
parent.params.splice(0, 1);
|
|
164
172
|
parent.params.push(param);
|
|
165
|
-
usedImports.add(original);
|
|
166
173
|
return;
|
|
167
174
|
}
|
|
168
175
|
if (importVar) {
|
|
169
|
-
if (
|
|
170
|
-
usedImports.add(node.original);
|
|
176
|
+
if (findImport(node.original)) {
|
|
171
177
|
node.original = `${importVar}.${original}` + node.original.split('.').slice(1).join('.');
|
|
172
178
|
node.parts = node.original.split('.');
|
|
179
|
+
importBindings.add(original);
|
|
173
180
|
}
|
|
174
181
|
return;
|
|
175
182
|
}
|
|
176
183
|
},
|
|
177
184
|
ElementNode: (element, p) => {
|
|
178
|
-
|
|
185
|
+
const original = element.tag.split('.')[0];
|
|
186
|
+
if (findBlockParams(original, p))
|
|
179
187
|
return;
|
|
180
188
|
if (importVar) {
|
|
181
|
-
if (
|
|
182
|
-
|
|
183
|
-
|
|
189
|
+
if (findImport(original)) {
|
|
190
|
+
element.tag = `${importVar}.${original}`;
|
|
191
|
+
importBindings.add(original);
|
|
184
192
|
}
|
|
185
193
|
return;
|
|
186
194
|
}
|
|
187
195
|
},
|
|
188
|
-
Program: {
|
|
189
|
-
exit(program) { },
|
|
190
|
-
},
|
|
191
196
|
};
|
|
192
197
|
return visitor;
|
|
193
198
|
}
|
|
194
|
-
replaceInAst(ast, importVar, imports) {
|
|
195
|
-
const usedImports = new Set();
|
|
196
|
-
const hotReplaced = {
|
|
197
|
-
components: new Set(),
|
|
198
|
-
helpers: new Set(),
|
|
199
|
-
modifiers: new Set(),
|
|
200
|
-
others: new Set(),
|
|
201
|
-
info: {
|
|
202
|
-
components: {},
|
|
203
|
-
helpers: {},
|
|
204
|
-
modifiers: {},
|
|
205
|
-
},
|
|
206
|
-
};
|
|
207
|
-
const visitor = this.buildVisitor({
|
|
208
|
-
importVar,
|
|
209
|
-
imports,
|
|
210
|
-
usedImports,
|
|
211
|
-
});
|
|
212
|
-
glimmer.traverse(ast, visitor);
|
|
213
|
-
return usedImports;
|
|
214
|
-
}
|
|
215
|
-
processAst(contents, importVar, imports) {
|
|
216
|
-
const ast = glimmer.preprocess(contents);
|
|
217
|
-
this.counter = 0;
|
|
218
|
-
this.usedImports = this.replaceInAst(ast, importVar, imports);
|
|
219
|
-
return glimmer.print(ast);
|
|
220
|
-
}
|
|
221
199
|
}
|
|
222
200
|
exports.hotAstProcessor = new HotAstProcessor();
|
|
223
201
|
function hotReplaceAst({ types: t }) {
|
|
224
202
|
let imports = [];
|
|
225
203
|
let importMap = {};
|
|
226
|
-
let tracked;
|
|
227
|
-
let importVar;
|
|
228
|
-
let importsKlass;
|
|
229
|
-
let templateImportSpecifier = '';
|
|
230
|
-
importMap = {};
|
|
231
|
-
imports = [];
|
|
232
204
|
return {
|
|
233
|
-
name: 'hot-reload-imports',
|
|
205
|
+
name: 'a-hot-reload-imports',
|
|
234
206
|
pre(file) {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
for (let specifier of statement.specifiers) {
|
|
238
|
-
imports.push(specifier.local.name);
|
|
239
|
-
importMap[specifier.local.name] = {
|
|
240
|
-
source: statement.source.value,
|
|
241
|
-
specifiers: statement.specifiers,
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}
|
|
207
|
+
exports.hotAstProcessor.reset();
|
|
208
|
+
exports.hotAstProcessor.meta.babelProgram = file.ast.program;
|
|
246
209
|
},
|
|
247
210
|
visitor: {
|
|
248
|
-
Program
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
i.source.value === '@ember/template-compiler');
|
|
268
|
-
if (templateImport && templateImport.type === 'ImportDeclaration') {
|
|
269
|
-
const def = templateImport.specifiers[0];
|
|
270
|
-
templateImportSpecifier = def.local.name;
|
|
271
|
-
}
|
|
272
|
-
tracked = path.scope.generateUidIdentifier('tracked');
|
|
273
|
-
importVar = t.identifier('imports_templates__');
|
|
274
|
-
exports.hotAstProcessor.meta.importVar = importVar;
|
|
275
|
-
node.body.splice(0, 0, t.importDeclaration([t.importSpecifier(tracked, t.identifier('tracked'))], t.stringLiteral('@glimmer/tracking')));
|
|
276
|
-
let usedImports = new Set();
|
|
277
|
-
path.traverse({
|
|
278
|
-
CallExpression(path) {
|
|
279
|
-
const call = path.node;
|
|
280
|
-
if (templateImportSpecifier &&
|
|
281
|
-
call.callee.name ===
|
|
282
|
-
templateImportSpecifier &&
|
|
283
|
-
(call.arguments[0]?.type === 'StringLiteral' ||
|
|
284
|
-
call.arguments[0]?.type === 'TemplateLiteral')) {
|
|
285
|
-
if (call.arguments[0].type === 'StringLiteral') {
|
|
286
|
-
call.arguments[0].value = exports.hotAstProcessor.processAst(call.arguments[0].value, importVar.name, imports);
|
|
287
|
-
exports.hotAstProcessor.usedImports.forEach(usedImports.add, usedImports);
|
|
288
|
-
}
|
|
289
|
-
if (call.arguments[0].type === 'TemplateLiteral' &&
|
|
290
|
-
call.arguments[0].quasis[0]) {
|
|
291
|
-
call.arguments[0].quasis[0].value.raw =
|
|
292
|
-
exports.hotAstProcessor.processAst(call.arguments[0].quasis[0].value.raw, importVar.name, imports);
|
|
293
|
-
exports.hotAstProcessor.usedImports.forEach(usedImports.add, usedImports);
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
},
|
|
297
|
-
});
|
|
298
|
-
const lastImport = [...node.body]
|
|
299
|
-
.reverse()
|
|
300
|
-
.find((x) => x.type === 'ImportDeclaration');
|
|
301
|
-
const idx = node.body.indexOf(lastImport);
|
|
302
|
-
const importsVar = t.variableDeclaration('let', [
|
|
303
|
-
t.variableDeclarator(importVar),
|
|
304
|
-
]);
|
|
305
|
-
importsKlass = t.classExpression(path.scope.generateUidIdentifier('Imports'), null, t.classBody([...usedImports].map((i) => {
|
|
306
|
-
const { source, specifiers } = importMap[i];
|
|
307
|
-
const specifier = specifiers.find((s) => s.local.name === i);
|
|
308
|
-
const specifierName = specifier.imported?.name ||
|
|
309
|
-
specifier.imported?.value ||
|
|
310
|
-
'default';
|
|
311
|
-
const x = state.importUtil.import(path, source, specifierName);
|
|
312
|
-
return t.classProperty(t.identifier(i), x, null, [
|
|
313
|
-
t.decorator(tracked),
|
|
314
|
-
]);
|
|
315
|
-
})));
|
|
316
|
-
const assignment = t.expressionStatement(t.assignmentExpression('=', importVar, t.newExpression(importsKlass, [])));
|
|
317
|
-
const hotAccepts = [];
|
|
318
|
-
for (const imp of [...usedImports]) {
|
|
319
|
-
const { source, specifiers } = importMap[imp];
|
|
320
|
-
const specifier = specifiers.find((s) => s.local.name === imp);
|
|
321
|
-
const specifierName = specifier.imported?.name ||
|
|
322
|
-
specifier.imported?.value ||
|
|
323
|
-
'default';
|
|
324
|
-
const ast = (0, core_1.parse)(`import.meta.hot.accept('${source}', (module) => (${importVar.name}.${imp}=module['${specifierName}']))`);
|
|
325
|
-
const impHot = ast?.program.body[0];
|
|
326
|
-
hotAccepts.push(impHot);
|
|
327
|
-
}
|
|
328
|
-
const ifHot = t.ifStatement(t.memberExpression(t.metaProperty(t.identifier('import'), t.identifier('meta')), t.identifier('hot')), t.blockStatement([assignment, ...hotAccepts]));
|
|
329
|
-
node.body.splice(0, 0, importsVar);
|
|
330
|
-
node.body.push(ifHot);
|
|
331
|
-
},
|
|
332
|
-
exit(path, state) {
|
|
333
|
-
const filename = path.hub.file.opts.filename.split('?')[0];
|
|
334
|
-
if (!filename.includes('rewritten-app')) {
|
|
335
|
-
return;
|
|
336
|
-
}
|
|
337
|
-
if (!filename.endsWith('.hbs')) {
|
|
338
|
-
return;
|
|
339
|
-
}
|
|
340
|
-
path.traverse({
|
|
341
|
-
ImportDeclaration: function (path) {
|
|
342
|
-
path.node.specifiers.forEach(function (s) {
|
|
343
|
-
imports.push(s.local.name);
|
|
344
|
-
importMap[s.local.name] = {
|
|
345
|
-
source: path.node.source.value,
|
|
346
|
-
specifiers: path.node.specifiers,
|
|
347
|
-
};
|
|
348
|
-
});
|
|
349
|
-
},
|
|
350
|
-
});
|
|
351
|
-
const node = path.node;
|
|
352
|
-
const usedImports = exports.hotAstProcessor.meta.usedImports;
|
|
353
|
-
if (usedImports || exports.hotAstProcessor.usedImports) {
|
|
354
|
-
const lastImport = [...node.body]
|
|
355
|
-
.reverse()
|
|
356
|
-
.find((x) => x.type === 'ImportDeclaration');
|
|
357
|
-
const idx = node.body.indexOf(lastImport);
|
|
358
|
-
const assignment = node.body.slice(-1)[0];
|
|
359
|
-
node.body.splice(-1, 1);
|
|
360
|
-
node.body.splice(idx, 0, assignment);
|
|
361
|
-
const hotAccepts = [];
|
|
362
|
-
const handled = new Set();
|
|
363
|
-
for (const imp of [...usedImports, ...exports.hotAstProcessor.meta.usedImports]) {
|
|
364
|
-
const { source, specifiers } = importMap[imp];
|
|
365
|
-
const specifier = specifiers.find((s) => s.local.name === imp);
|
|
366
|
-
const specifierName = specifier.imported?.name ||
|
|
367
|
-
specifier.imported?.value ||
|
|
368
|
-
'default';
|
|
369
|
-
if (handled.has(imp)) {
|
|
370
|
-
continue;
|
|
371
|
-
}
|
|
372
|
-
handled.add(imp);
|
|
373
|
-
state.importUtil.import(path, source, specifierName);
|
|
374
|
-
const ast = (0, core_1.parse)(`import.meta.hot.accept('${source}', (module) => (${importVar.name}.${imp}=module['${specifierName}']))`);
|
|
375
|
-
const impHot = ast?.program.body[0];
|
|
376
|
-
hotAccepts.push(impHot);
|
|
377
|
-
}
|
|
378
|
-
const ifHot = t.ifStatement(t.memberExpression(t.metaProperty(t.identifier('import'), t.identifier('meta')), t.identifier('hot')), t.blockStatement([...hotAccepts]));
|
|
379
|
-
node.body.push(ifHot);
|
|
380
|
-
importsKlass.body.body.length = 0;
|
|
381
|
-
}
|
|
382
|
-
},
|
|
383
|
-
},
|
|
384
|
-
CallExpression: {
|
|
385
|
-
exit(path, state) {
|
|
386
|
-
const filename = path.hub.file.opts.filename.split('?')[0];
|
|
387
|
-
if (filename.endsWith('.hbs')) {
|
|
388
|
-
const usedImports = exports.hotAstProcessor.meta.usedImports;
|
|
389
|
-
[...usedImports].map((i) => {
|
|
390
|
-
if (importsKlass.body.body.find((b) => b.key.name === i)) {
|
|
391
|
-
return;
|
|
392
|
-
}
|
|
393
|
-
const x = t.identifier(i);
|
|
394
|
-
const klassProp = t.classProperty(t.identifier(i), x, null, [
|
|
395
|
-
t.decorator(tracked),
|
|
396
|
-
]);
|
|
397
|
-
importsKlass.body.body.push(klassProp);
|
|
398
|
-
});
|
|
399
|
-
}
|
|
400
|
-
},
|
|
401
|
-
},
|
|
211
|
+
Program(path, state) {
|
|
212
|
+
if (!exports.hotAstProcessor.meta.importVar) {
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
if (process.env['EMBER_VITE_HMR_ENABLED'] !== 'true') {
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
const util = new babel_import_util_1.ImportUtil(t, path);
|
|
219
|
+
const tracked = util.import(path, '@glimmer/tracking', 'tracked');
|
|
220
|
+
const klass = t.classExpression(path.scope.generateUidIdentifier('Imports'), null, t.classBody([]));
|
|
221
|
+
const bindings = [...exports.hotAstProcessor.meta.importBindings].sort();
|
|
222
|
+
for (const local of bindings) {
|
|
223
|
+
klass.body.body.push(t.classProperty(t.identifier(local), t.identifier(local), null, [t.decorator(tracked)]));
|
|
224
|
+
}
|
|
225
|
+
const assign = t.assignmentExpression('=', t.identifier(exports.hotAstProcessor.meta.importVar), klass);
|
|
226
|
+
const varDeclaration = path.node.body.findIndex((e) => e.type === 'VariableDeclaration' && e.declarations[0].id.name === exports.hotAstProcessor.meta.importVar) + 1;
|
|
227
|
+
const lastImportIndex = path.node.body.findLastIndex((e) => e.type === 'ImportDeclaration') + 1;
|
|
228
|
+
path.node.body.splice(Math.max(varDeclaration, lastImportIndex), 0, assign);
|
|
229
|
+
}
|
|
402
230
|
},
|
|
403
231
|
};
|
|
404
232
|
}
|
package/dist/lib/hmr.d.ts
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
enforce: string;
|
|
4
|
-
resolveId(id: any): any;
|
|
5
|
-
transformIndexHtml(html: any): string;
|
|
6
|
-
handleHotUpdate(ctx: any): any;
|
|
7
|
-
transform(source: any, id: any): Promise<any>;
|
|
8
|
-
};
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
export declare function hmr(enableViteHmrForModes?: string[]): Plugin;
|
package/dist/lib/hmr.js
CHANGED
|
@@ -5,16 +5,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.hmr = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
|
-
function hmr() {
|
|
8
|
+
function hmr(enableViteHmrForModes = ['development']) {
|
|
9
9
|
return {
|
|
10
10
|
name: 'hmr-plugin',
|
|
11
11
|
enforce: 'post',
|
|
12
|
+
configResolved(config) {
|
|
13
|
+
process.env['EMBER_VITE_HMR_ENABLED'] = enableViteHmrForModes.includes(config.mode).toString();
|
|
14
|
+
},
|
|
12
15
|
resolveId(id) {
|
|
13
16
|
if (id.startsWith('/@id/embroider_virtual:')) {
|
|
14
|
-
return this.resolve(id.replace('/@id/', ''), process.cwd());
|
|
17
|
+
return this.resolve(id.replace('/@id/', ''), path_1.default.join(process.cwd(), 'package.json'));
|
|
15
18
|
}
|
|
16
19
|
if (id === '/ember-vite-hmr/services/webpack-hot-reload') {
|
|
17
|
-
return this.resolve('ember-vite-hmr/services/webpack-hot-reload', process.cwd());
|
|
20
|
+
return this.resolve('ember-vite-hmr/services/webpack-hot-reload', path_1.default.join(process.cwd(), 'package.json'));
|
|
18
21
|
}
|
|
19
22
|
},
|
|
20
23
|
transformIndexHtml(html) {
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ember-vite-hmr",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"ember-addon"
|
|
6
6
|
],
|
|
7
7
|
"private": false,
|
|
8
|
-
"description": "
|
|
8
|
+
"description": "provides hmr support for ember apps",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "https://github.com/patricklx/ember-vite-hmr"
|
|
@@ -84,7 +84,8 @@
|
|
|
84
84
|
"@types/mini-css-extract-plugin": "^1.4.3",
|
|
85
85
|
"@types/node": "^15.12.2",
|
|
86
86
|
"@types/semver": "^7.3.6",
|
|
87
|
-
"babel-plugin-ember-template-compilation": "^2.2.
|
|
87
|
+
"babel-plugin-ember-template-compilation": "^2.2.2",
|
|
88
|
+
"babel-import-util": "2.0.3",
|
|
88
89
|
"concurrently": "^8.0.1",
|
|
89
90
|
"ember-resolver": "^11.0.1",
|
|
90
91
|
"ember-source": "^5.3.0",
|
|
@@ -100,7 +101,9 @@
|
|
|
100
101
|
"typescript": "^5.1.6"
|
|
101
102
|
},
|
|
102
103
|
"peerDependencies": {
|
|
103
|
-
"@embroider/compat": "*"
|
|
104
|
+
"@embroider/compat": "*",
|
|
105
|
+
"babel-plugin-ember-template-compilation": "^2.2.2",
|
|
106
|
+
"babel-import-util": "2.0.3"
|
|
104
107
|
},
|
|
105
108
|
"engines": {
|
|
106
109
|
"node": "12.* || 14.* || >= 16"
|
|
@@ -113,8 +116,8 @@
|
|
|
113
116
|
"type": "addon",
|
|
114
117
|
"main": "addon-main.cjs",
|
|
115
118
|
"app-js": {
|
|
116
|
-
"./initializers/
|
|
117
|
-
"./services/
|
|
119
|
+
"./initializers/vite-hot-reload.js": "./dist/_app_/initializers/vite-hot-reload.js",
|
|
120
|
+
"./services/vite-hot-reload.js": "./dist/_app_/services/vite-hot-reload.js"
|
|
118
121
|
}
|
|
119
122
|
},
|
|
120
123
|
"exports": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "ember-vite-hmr/initializers/webpack-hot-reload";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "ember-vite-hmr/services/webpack-hot-reload";
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
function initialize(application) {
|
|
2
|
-
application.__container__.lookup('service:webpack-hot-reload');
|
|
3
|
-
const resolver = application.__registry__.resolver._fallback || application.__registry__.resolver;
|
|
4
|
-
const resolverResolve = resolver.resolve;
|
|
5
|
-
resolver.resolve = function (name) {
|
|
6
|
-
name = name.replace(/--hot-version--.*$/, '');
|
|
7
|
-
return resolverResolve.call(this, name);
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
var webpackHotReload = {
|
|
11
|
-
initialize
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export { webpackHotReload as default, initialize };
|
|
15
|
-
//# sourceMappingURL=webpack-hot-reload.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"webpack-hot-reload.js","sources":["../../src/initializers/webpack-hot-reload.ts"],"sourcesContent":["export function initialize(application) {\n application.__container__.lookup('service:webpack-hot-reload');\n const resolver =\n application.__registry__.resolver._fallback ||\n application.__registry__.resolver;\n const resolverResolve = resolver.resolve;\n resolver.resolve = function (name) {\n name = name.replace(/--hot-version--.*$/, '');\n return resolverResolve.call(this, name);\n };\n}\n\nexport default {\n initialize,\n};\n"],"names":["initialize","application","__container__","lookup","resolver","__registry__","_fallback","resolverResolve","resolve","name","replace","call"],"mappings":"AAAO,SAASA,UAAUA,CAACC,WAAW,EAAE;AACtCA,EAAAA,WAAW,CAACC,aAAa,CAACC,MAAM,CAAC,4BAA4B,CAAC,CAAA;AAC9D,EAAA,MAAMC,QAAQ,GACZH,WAAW,CAACI,YAAY,CAACD,QAAQ,CAACE,SAAS,IAC3CL,WAAW,CAACI,YAAY,CAACD,QAAQ,CAAA;AACnC,EAAA,MAAMG,eAAe,GAAGH,QAAQ,CAACI,OAAO,CAAA;AACxCJ,EAAAA,QAAQ,CAACI,OAAO,GAAG,UAAUC,IAAI,EAAE;IACjCA,IAAI,GAAGA,IAAI,CAACC,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAA;AAC7C,IAAA,OAAOH,eAAe,CAACI,IAAI,CAAC,IAAI,EAAEF,IAAI,CAAC,CAAA;GACxC,CAAA;AACH,CAAA;AAEA,uBAAe;AACbT,EAAAA,UAAAA;AACF,CAAC;;;;"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { PluginObj } from '@babel/core';
|
|
2
|
-
import type * as BabelTypesNamespace from '@babel/types';
|
|
3
|
-
import * as glimmer from '@glimmer/syntax';
|
|
4
|
-
export type BabelTypes = typeof BabelTypesNamespace;
|
|
5
|
-
interface ASTPluginEnvironment {
|
|
6
|
-
locals: string[];
|
|
7
|
-
}
|
|
8
|
-
declare class HotAstProcessor {
|
|
9
|
-
options: {
|
|
10
|
-
itsStatic: boolean;
|
|
11
|
-
};
|
|
12
|
-
counter: number;
|
|
13
|
-
meta: {
|
|
14
|
-
usedImports: Set<string>;
|
|
15
|
-
importVar: any;
|
|
16
|
-
};
|
|
17
|
-
usedImports: Set<any>;
|
|
18
|
-
constructor();
|
|
19
|
-
transform(env: ASTPluginEnvironment): {
|
|
20
|
-
visitor: glimmer.NodeVisitor;
|
|
21
|
-
};
|
|
22
|
-
buildVisitor({ importVar, imports, usedImports }: {
|
|
23
|
-
importVar: any;
|
|
24
|
-
imports: any;
|
|
25
|
-
usedImports: any;
|
|
26
|
-
}): glimmer.NodeVisitor;
|
|
27
|
-
replaceInAst(ast: glimmer.ASTv1.Template, importVar?: string, imports?: string[]): Set<unknown>;
|
|
28
|
-
processAst(contents: string, importVar?: string, imports?: string[]): string;
|
|
29
|
-
}
|
|
30
|
-
export declare const hotAstProcessor: HotAstProcessor;
|
|
31
|
-
export default function hotReplaceAst({ types: t }: {
|
|
32
|
-
types: BabelTypes;
|
|
33
|
-
}): PluginObj<import("@babel/core").PluginPass>;
|
|
34
|
-
export {};
|
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
import Service, { service } from '@ember/service';
|
|
2
|
-
import { getOwner } from '@ember/owner';
|
|
3
|
-
import Router from '@ember/routing/route';
|
|
4
|
-
import Controller from '@ember/controller';
|
|
5
|
-
|
|
6
|
-
function _initializerDefineProperty(target, property, descriptor, context) {
|
|
7
|
-
if (!descriptor) return;
|
|
8
|
-
Object.defineProperty(target, property, {
|
|
9
|
-
enumerable: descriptor.enumerable,
|
|
10
|
-
configurable: descriptor.configurable,
|
|
11
|
-
writable: descriptor.writable,
|
|
12
|
-
value: descriptor.initializer ? descriptor.initializer.call(context) : void 0
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
|
|
16
|
-
var desc = {};
|
|
17
|
-
Object.keys(descriptor).forEach(function (key) {
|
|
18
|
-
desc[key] = descriptor[key];
|
|
19
|
-
});
|
|
20
|
-
desc.enumerable = !!desc.enumerable;
|
|
21
|
-
desc.configurable = !!desc.configurable;
|
|
22
|
-
if ('value' in desc || desc.initializer) {
|
|
23
|
-
desc.writable = true;
|
|
24
|
-
}
|
|
25
|
-
desc = decorators.slice().reverse().reduce(function (desc, decorator) {
|
|
26
|
-
return decorator(target, property, desc) || desc;
|
|
27
|
-
}, desc);
|
|
28
|
-
if (context && desc.initializer !== void 0) {
|
|
29
|
-
desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
|
|
30
|
-
desc.initializer = undefined;
|
|
31
|
-
}
|
|
32
|
-
if (desc.initializer === void 0) {
|
|
33
|
-
Object.defineProperty(target, property, desc);
|
|
34
|
-
desc = null;
|
|
35
|
-
}
|
|
36
|
-
return desc;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
var _dec, _class, _descriptor;
|
|
40
|
-
const ChangeMap = new WeakMap();
|
|
41
|
-
function getLatestChange(obj) {
|
|
42
|
-
while (ChangeMap.has(obj)) {
|
|
43
|
-
obj = ChangeMap.get(obj);
|
|
44
|
-
}
|
|
45
|
-
return obj;
|
|
46
|
-
}
|
|
47
|
-
let modulePrefix;
|
|
48
|
-
let podModulePrefix;
|
|
49
|
-
if (import.meta.hot) {
|
|
50
|
-
const ModuleMap = new Map();
|
|
51
|
-
window.emberHotReloadPlugin = {
|
|
52
|
-
_accepting: 0,
|
|
53
|
-
changed: {},
|
|
54
|
-
subscribers: [],
|
|
55
|
-
version: 1,
|
|
56
|
-
moduleDepCallbacks: {},
|
|
57
|
-
versionMap: {},
|
|
58
|
-
clear(module) {
|
|
59
|
-
this.moduleDepCallbacks[module.id] = {};
|
|
60
|
-
},
|
|
61
|
-
register(module, dep, callback) {
|
|
62
|
-
dep = dep.replace(new RegExp(`^${modulePrefix}/`), './');
|
|
63
|
-
this.moduleDepCallbacks[module.id][dep] = this.moduleDepCallbacks[module.id][dep] || [];
|
|
64
|
-
this.moduleDepCallbacks[module.id][dep].push(callback);
|
|
65
|
-
},
|
|
66
|
-
loadNew(oldModule, newModule) {
|
|
67
|
-
this.versionMap[newModule.id] = newModule.version;
|
|
68
|
-
const entry = Object.values(requirejs.entries).find(module => module.module.exports.default === oldModule.exports.default);
|
|
69
|
-
if (!entry) return;
|
|
70
|
-
entry.module = {
|
|
71
|
-
exports: newModule.exports
|
|
72
|
-
};
|
|
73
|
-
},
|
|
74
|
-
__import(moduleUrl) {
|
|
75
|
-
return import( /* @vite-ignore */moduleUrl);
|
|
76
|
-
},
|
|
77
|
-
async canAcceptNew(moduleUrl) {
|
|
78
|
-
this._accepting += 1;
|
|
79
|
-
const m = await this.__import(moduleUrl);
|
|
80
|
-
const module = {
|
|
81
|
-
exports: m,
|
|
82
|
-
id: moduleUrl.split('?')[0]
|
|
83
|
-
};
|
|
84
|
-
this._accepting -= 1;
|
|
85
|
-
if (this._accepting === 0) {
|
|
86
|
-
setTimeout(() => this.notifyNew(), 0);
|
|
87
|
-
}
|
|
88
|
-
let ok = module.id.includes('/routes/') || module.id.includes('/routers/') || module.id.includes('/controllers/') || module.id.match(/controller\.(js|ts)$/) || module.id.match(/route\.(js|ts|gts)$/);
|
|
89
|
-
if (!ok) {
|
|
90
|
-
return false;
|
|
91
|
-
}
|
|
92
|
-
if (ModuleMap.get(module.id)) {
|
|
93
|
-
this.changed[module.id] = {
|
|
94
|
-
old: ModuleMap.get(module.id),
|
|
95
|
-
new: module
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
module.version = this.version;
|
|
99
|
-
ModuleMap.set(module.id, module);
|
|
100
|
-
return true;
|
|
101
|
-
},
|
|
102
|
-
notifyNew() {
|
|
103
|
-
this.version += 1;
|
|
104
|
-
Object.values(this.changed).forEach(change => {
|
|
105
|
-
this.loadNew(change.old, change.new);
|
|
106
|
-
this.subscribers.forEach(fn => fn(change.old, change.new));
|
|
107
|
-
});
|
|
108
|
-
this.changed = {};
|
|
109
|
-
},
|
|
110
|
-
subscribe(fn) {
|
|
111
|
-
this.subscribers.push(fn);
|
|
112
|
-
},
|
|
113
|
-
unsubscribe(fn) {
|
|
114
|
-
const idx = this.subscribers.indexOf(fn);
|
|
115
|
-
if (idx >= 0) {
|
|
116
|
-
this.subscribers.splice(idx, 1);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
let WebpackHotReloadService = (_dec = service(), (_class = class WebpackHotReloadService extends Service {
|
|
122
|
-
constructor(...args) {
|
|
123
|
-
super(...args);
|
|
124
|
-
_initializerDefineProperty(this, "router", _descriptor, this);
|
|
125
|
-
}
|
|
126
|
-
init() {
|
|
127
|
-
super.init();
|
|
128
|
-
if (!window.emberHotReloadPlugin) return;
|
|
129
|
-
modulePrefix = getOwner(this).application.modulePrefix;
|
|
130
|
-
podModulePrefix = getOwner(this).application.podModulePrefix;
|
|
131
|
-
this.router._router;
|
|
132
|
-
Object.defineProperty(this.router._router, '_routerMicrolib', {
|
|
133
|
-
set(v) {
|
|
134
|
-
const getRoute = v.getRoute;
|
|
135
|
-
v.getRoute = function (name) {
|
|
136
|
-
const route = getRoute.call(this, `${name}--hot-version--${window.emberHotReloadPlugin.version}`);
|
|
137
|
-
route.fullRouteName = route.fullRouteName.replace(/--hot-version--.*$/, '');
|
|
138
|
-
return route;
|
|
139
|
-
};
|
|
140
|
-
this.___routerMicrolib = v;
|
|
141
|
-
},
|
|
142
|
-
get() {
|
|
143
|
-
return this.___routerMicrolib;
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
this.container = getOwner(this)?.__container__;
|
|
147
|
-
window.emberHotReloadPlugin.subscribe((oldModule, newModule) => {
|
|
148
|
-
const types = ['route', 'controller', 'template', 'modifier', 'helper', 'component'];
|
|
149
|
-
Object.keys(this.container.cache).forEach(k => {
|
|
150
|
-
if (types.some(t => k.startsWith(`${t}:`))) {
|
|
151
|
-
delete this.container.cache[k];
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
Object.keys(this.container.factoryManagerCache).forEach(k => {
|
|
155
|
-
if (types.some(t => k.startsWith(`${t}:`))) {
|
|
156
|
-
delete this.container.factoryManagerCache[k];
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
Object.keys(this.container.registry._resolveCache).forEach(k => {
|
|
160
|
-
if (types.some(t => k.startsWith(`${t}:`))) {
|
|
161
|
-
delete this.container.registry._resolveCache[k];
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
Object.keys(this.container.validationCache).forEach(k => {
|
|
165
|
-
if (types.some(t => k.startsWith(`${t}:`))) {
|
|
166
|
-
delete this.container.validationCache[k];
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
Object.keys(this.container.registry.registrations).forEach(k => {
|
|
170
|
-
if (types.some(t => k.startsWith(`${t}:`))) {
|
|
171
|
-
delete this.container.registry.registrations[k];
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
if (oldModule.exports.default?.prototype && oldModule.exports.default.prototype instanceof Router) {
|
|
175
|
-
this.router.refresh();
|
|
176
|
-
}
|
|
177
|
-
if (oldModule.exports.default?.prototype && oldModule.exports.default.prototype instanceof Controller) {
|
|
178
|
-
this.router.refresh();
|
|
179
|
-
}
|
|
180
|
-
if (oldModule.id.startsWith('./templates/') && !oldModule.id.startsWith('./templates/components/')) {
|
|
181
|
-
this.router.refresh();
|
|
182
|
-
}
|
|
183
|
-
if (oldModule.id.startsWith(`./${podModulePrefix}/`)) {
|
|
184
|
-
this.router.refresh();
|
|
185
|
-
}
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
getLatestChange(obj) {
|
|
189
|
-
return getLatestChange(obj);
|
|
190
|
-
}
|
|
191
|
-
}, (_descriptor = _applyDecoratedDescriptor(_class.prototype, "router", [_dec], {
|
|
192
|
-
configurable: true,
|
|
193
|
-
enumerable: true,
|
|
194
|
-
writable: true,
|
|
195
|
-
initializer: null
|
|
196
|
-
})), _class));
|
|
197
|
-
// this service using `Owner.lookup('service:hot-reload')`, as well
|
|
198
|
-
// as to check when you pass the service name as an argument to the decorator,
|
|
199
|
-
// like `@service('hot-reload') declare altName: HotReloadService;`.
|
|
200
|
-
|
|
201
|
-
export { WebpackHotReloadService as default };
|
|
202
|
-
//# sourceMappingURL=webpack-hot-reload.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"webpack-hot-reload.js","sources":["../../src/services/webpack-hot-reload.ts"],"sourcesContent":["import Service, { service } from '@ember/service';\nimport { getOwner } from '@ember/owner';\nimport RouterService from '@ember/routing/router-service';\nimport Router from '@ember/routing/route';\nimport Controller from '@ember/controller';\n\nconst ChangeMap = new WeakMap();\n\nfunction getLatestChange(obj) {\n while (ChangeMap.has(obj)) {\n obj = ChangeMap.get(obj);\n }\n return obj;\n}\n\nlet modulePrefix!: string;\nlet podModulePrefix!: string;\nif (import.meta.hot) {\n const ModuleMap = new Map();\n\n window.emberHotReloadPlugin = {\n _accepting: 0,\n changed: {},\n subscribers: [],\n version: 1,\n moduleDepCallbacks: {},\n versionMap: {},\n clear(module) {\n this.moduleDepCallbacks[module.id] = {};\n },\n register(module, dep, callback) {\n dep = dep.replace(new RegExp(`^${modulePrefix}/`), './');\n this.moduleDepCallbacks[module.id][dep] =\n this.moduleDepCallbacks[module.id][dep] || [];\n this.moduleDepCallbacks[module.id][dep].push(callback);\n },\n loadNew(oldModule, newModule) {\n this.versionMap[newModule.id] = newModule.version;\n const entry = Object.values(requirejs.entries).find(\n (module) => module.module.exports.default === oldModule.exports.default,\n );\n if (!entry) return;\n entry.module = {\n exports: newModule.exports,\n };\n },\n\n __import(moduleUrl) {\n return import(/* @vite-ignore */ moduleUrl);\n },\n\n async canAcceptNew(moduleUrl) {\n this._accepting += 1;\n const m = await this.__import(moduleUrl);\n const module = {\n exports: m,\n id: moduleUrl.split('?')[0],\n };\n this._accepting -= 1;\n if (this._accepting === 0) {\n setTimeout(() => this.notifyNew(), 0);\n }\n let ok =\n module.id.includes('/routes/') ||\n module.id.includes('/routers/') ||\n module.id.includes('/controllers/') ||\n module.id.match(/controller\\.(js|ts)$/) ||\n module.id.match(/route\\.(js|ts|gts)$/);\n if (!ok) {\n return false;\n }\n\n if (ModuleMap.get(module.id)) {\n this.changed[module.id] = {\n old: ModuleMap.get(module.id),\n new: module,\n };\n }\n module.version = this.version;\n ModuleMap.set(module.id, module);\n return true;\n },\n notifyNew() {\n this.version += 1;\n Object.values(this.changed).forEach((change) => {\n this.loadNew(change.old, change.new);\n this.subscribers.forEach((fn) => fn(change.old, change.new));\n });\n this.changed = {};\n },\n subscribe(fn) {\n this.subscribers.push(fn);\n },\n unsubscribe(fn) {\n const idx = this.subscribers.indexOf(fn);\n if (idx >= 0) {\n this.subscribers.splice(idx, 1);\n }\n },\n };\n}\n\nexport default class WebpackHotReloadService extends Service {\n declare container: any;\n @service() router!: RouterService;\n\n init() {\n super.init();\n if (!window.emberHotReloadPlugin) return;\n modulePrefix = getOwner(this)!.application.modulePrefix;\n podModulePrefix = getOwner(this)!.application.podModulePrefix;\n this.router._router;\n Object.defineProperty(this.router._router, '_routerMicrolib', {\n set(v) {\n const getRoute = v.getRoute;\n v.getRoute = function (name) {\n const route = getRoute.call(\n this,\n `${name}--hot-version--${window.emberHotReloadPlugin.version}`,\n );\n route.fullRouteName = route.fullRouteName.replace(\n /--hot-version--.*$/,\n '',\n );\n return route;\n };\n this.___routerMicrolib = v;\n },\n get() {\n return this.___routerMicrolib;\n },\n });\n this.container = getOwner(this)?.__container__;\n window.emberHotReloadPlugin.subscribe((oldModule, newModule) => {\n const types = [\n 'route',\n 'controller',\n 'template',\n 'modifier',\n 'helper',\n 'component',\n ];\n Object.keys(this.container.cache).forEach((k) => {\n if (types.some((t) => k.startsWith(`${t}:`))) {\n delete this.container.cache[k];\n }\n });\n Object.keys(this.container.factoryManagerCache).forEach((k) => {\n if (types.some((t) => k.startsWith(`${t}:`))) {\n delete this.container.factoryManagerCache[k];\n }\n });\n Object.keys(this.container.registry._resolveCache).forEach((k) => {\n if (types.some((t) => k.startsWith(`${t}:`))) {\n delete this.container.registry._resolveCache[k];\n }\n });\n Object.keys(this.container.validationCache).forEach((k) => {\n if (types.some((t) => k.startsWith(`${t}:`))) {\n delete this.container.validationCache[k];\n }\n });\n Object.keys(this.container.registry.registrations).forEach((k) => {\n if (types.some((t) => k.startsWith(`${t}:`))) {\n delete this.container.registry.registrations[k];\n }\n });\n if (\n oldModule.exports.default?.prototype &&\n oldModule.exports.default.prototype instanceof Router\n ) {\n this.router.refresh();\n }\n if (\n oldModule.exports.default?.prototype &&\n oldModule.exports.default.prototype instanceof Controller\n ) {\n this.router.refresh();\n }\n if (\n oldModule.id.startsWith('./templates/') &&\n !oldModule.id.startsWith('./templates/components/')\n ) {\n this.router.refresh();\n }\n if (oldModule.id.startsWith(`./${podModulePrefix}/`)) {\n this.router.refresh();\n }\n });\n }\n getLatestChange(obj) {\n return getLatestChange(obj);\n }\n}\n\n// Don't remove this declaration: this is what enables TypeScript to resolve\n// this service using `Owner.lookup('service:hot-reload')`, as well\n// as to check when you pass the service name as an argument to the decorator,\n// like `@service('hot-reload') declare altName: HotReloadService;`.\ndeclare module '@ember/service' {\n interface Registry {\n 'hot-reload': WebpackHotReloadService;\n }\n}\n"],"names":["ChangeMap","WeakMap","getLatestChange","obj","has","get","modulePrefix","podModulePrefix","import","meta","hot","ModuleMap","Map","window","emberHotReloadPlugin","_accepting","changed","subscribers","version","moduleDepCallbacks","versionMap","clear","module","id","register","dep","callback","replace","RegExp","push","loadNew","oldModule","newModule","entry","Object","values","requirejs","entries","find","exports","default","__import","moduleUrl","canAcceptNew","m","split","setTimeout","notifyNew","ok","includes","match","old","new","set","forEach","change","fn","subscribe","unsubscribe","idx","indexOf","splice","WebpackHotReloadService","_dec","service","_class","Service","constructor","args","_initializerDefineProperty","_descriptor","init","getOwner","application","router","_router","defineProperty","v","getRoute","name","route","call","fullRouteName","___routerMicrolib","container","__container__","types","keys","cache","k","some","t","startsWith","factoryManagerCache","registry","_resolveCache","validationCache","registrations","prototype","Router","refresh","Controller","_applyDecoratedDescriptor","configurable","enumerable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