ember-vite-hmr 2.0.2 → 2.0.3
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/dist/instance-initializers/setup-hmr-manager.js +1 -0
- package/dist/instance-initializers/setup-hmr-manager.js.map +1 -1
- package/dist/instance-initializers/vite-hot-reload.js +1 -0
- package/dist/instance-initializers/vite-hot-reload.js.map +1 -1
- package/dist/lib/babel-plugin.js +30 -48
- package/dist/lib/hmr.js +140 -98
- package/dist/services/vite-hot-reload.js +3 -2
- package/dist/services/vite-hot-reload.js.map +1 -1
- package/package.json +46 -46
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-hmr-manager.js","sources":[
|
|
1
|
+
{"version":3,"file":"setup-hmr-manager.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite-hot-reload.js","sources":[
|
|
1
|
+
{"version":3,"file":"vite-hot-reload.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/lib/babel-plugin.js
CHANGED
|
@@ -15,17 +15,26 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.hotAstProcessor = void 0;
|
|
27
37
|
exports.default = hotReplaceAst;
|
|
28
|
-
const core_1 = require("@babel/core");
|
|
29
38
|
const glimmer = __importStar(require("@glimmer/syntax"));
|
|
30
39
|
const babel_import_util_1 = require("babel-import-util");
|
|
31
40
|
const builtInComponents = ['LinkTo'];
|
|
@@ -230,16 +239,16 @@ function hotReplaceAst(babel) {
|
|
|
230
239
|
},
|
|
231
240
|
visitor: {
|
|
232
241
|
Program(path, state) {
|
|
233
|
-
var _a
|
|
234
|
-
if (!exports.hotAstProcessor.meta.importVar) {
|
|
235
|
-
return;
|
|
236
|
-
}
|
|
242
|
+
var _a;
|
|
237
243
|
if (process.env['EMBER_VITE_HMR_ENABLED'] !== 'true') {
|
|
238
244
|
return;
|
|
239
245
|
}
|
|
240
246
|
if ((_a = state.filename) === null || _a === void 0 ? void 0 : _a.includes('node_modules')) {
|
|
241
247
|
return;
|
|
242
248
|
}
|
|
249
|
+
if (!exports.hotAstProcessor.meta.importVar || exports.hotAstProcessor.meta.importBindings.size === 0) {
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
243
252
|
const util = new babel_import_util_1.ImportUtil(babel, path);
|
|
244
253
|
const tracked = util.import(path, '@glimmer/tracking', 'tracked');
|
|
245
254
|
const GlimmerComponent = util.import(path, '@glimmer/component', 'default');
|
|
@@ -258,42 +267,15 @@ function hotReplaceAst(babel) {
|
|
|
258
267
|
const lastImportIndex = // @ts-ignore
|
|
259
268
|
path.node.body.findLastIndex((e) => e.type === 'ImportDeclaration') + 1;
|
|
260
269
|
path.node.body.splice(Math.max(varDeclaration, lastImportIndex), 0, assign);
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
continue;
|
|
271
|
-
}
|
|
272
|
-
const source = importDeclaration.source.value;
|
|
273
|
-
const specifier = importDeclaration.specifiers.find((s) => s.local.name === imp);
|
|
274
|
-
const specifierName = ((_b = specifier.imported) === null || _b === void 0 ? void 0 : _b.name) ||
|
|
275
|
-
((_c = specifier.imported) === null || _c === void 0 ? void 0 : _c.value) ||
|
|
276
|
-
'default';
|
|
277
|
-
const sourceId = source.replace(/@embroider\/virtual/g, 'embroider_virtual');
|
|
278
|
-
const ast = (0, core_1.parse)(`
|
|
279
|
-
(async () => {
|
|
280
|
-
const c = await import('/ember-vite-hmr/virtual/component:${sourceId}:${specifierName}.gjs');
|
|
281
|
-
${exports.hotAstProcessor.meta.importVar}.${imp} = c.default;
|
|
282
|
-
})()
|
|
283
|
-
import.meta.hot.accept('/ember-vite-hmr/virtual/component:${sourceId}:${specifierName}.gjs', (c) => {
|
|
284
|
-
${exports.hotAstProcessor.meta.importVar}.${imp} = c['${specifierName}'];
|
|
285
|
-
});
|
|
286
|
-
import.meta.hot.accept('${source}');
|
|
287
|
-
`, {
|
|
288
|
-
babelrc: false,
|
|
289
|
-
configFile: false,
|
|
290
|
-
});
|
|
291
|
-
const importVirtual = ast.program.body;
|
|
292
|
-
const ifInstanceOfComponent = t.ifStatement(t.binaryExpression('instanceof', t.memberExpression(t.identifier(imp), t.identifier('prototype')), GlimmerComponent), t.blockStatement([...importVirtual]));
|
|
293
|
-
ifHotStatements.push(ifInstanceOfComponent);
|
|
294
|
-
}
|
|
295
|
-
const ifHot = t.ifStatement(t.memberExpression(t.metaProperty(t.identifier('import'), t.identifier('meta')), t.identifier('hot')), t.blockStatement([...ifHotStatements]));
|
|
296
|
-
path.node.body.push(ifHot);
|
|
270
|
+
// Export metadata about tracked imports for hmr.ts to use
|
|
271
|
+
const importMetadata = t.variableDeclaration('const', [
|
|
272
|
+
t.variableDeclarator(t.identifier('__hmr_import_metadata__'), t.objectExpression([
|
|
273
|
+
t.objectProperty(t.identifier('importVar'), t.stringLiteral(exports.hotAstProcessor.meta.importVar)),
|
|
274
|
+
t.objectProperty(t.identifier('bindings'), t.arrayExpression(bindings.map((b) => t.stringLiteral(b)))),
|
|
275
|
+
])),
|
|
276
|
+
]);
|
|
277
|
+
const exportMetadata = t.exportNamedDeclaration(importMetadata, []);
|
|
278
|
+
path.node.body.push(exportMetadata);
|
|
297
279
|
path.scope.crawl();
|
|
298
280
|
},
|
|
299
281
|
},
|
package/dist/lib/hmr.js
CHANGED
|
@@ -101,6 +101,11 @@ function difference(a, b) {
|
|
|
101
101
|
}
|
|
102
102
|
return diff;
|
|
103
103
|
}
|
|
104
|
+
// Helper function to normalize paths consistently across platforms
|
|
105
|
+
function normalizePath(inputPath) {
|
|
106
|
+
// Always convert backslashes to forward slashes
|
|
107
|
+
return inputPath.replace(/\\/g, '/');
|
|
108
|
+
}
|
|
104
109
|
const virtualPrefix = '/ember-vite-hmr/virtual/component:';
|
|
105
110
|
function hmr(enableViteHmrForModes = ['development']) {
|
|
106
111
|
let conf;
|
|
@@ -118,24 +123,38 @@ function hmr(enableViteHmrForModes = ['development']) {
|
|
|
118
123
|
.toString();
|
|
119
124
|
},
|
|
120
125
|
resolveId(id, importer, meta) {
|
|
121
|
-
|
|
122
|
-
importer
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
126
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
127
|
+
if (importer === null || importer === void 0 ? void 0 : importer.startsWith(virtualPrefix)) {
|
|
128
|
+
importer = path_1.default.join(process.cwd(), 'package.json');
|
|
129
|
+
return this.resolve(id, importer, meta);
|
|
130
|
+
}
|
|
131
|
+
if (id.startsWith(virtualPrefix)) {
|
|
132
|
+
let [imp, specifier] = id
|
|
133
|
+
.split('?')[0]
|
|
134
|
+
.slice(virtualPrefix.length)
|
|
135
|
+
.split('::');
|
|
136
|
+
if (imp === null || imp === void 0 ? void 0 : imp.startsWith('.')) {
|
|
137
|
+
const r = yield this.resolve(imp, importer);
|
|
138
|
+
return id.replace(`${imp}::${specifier}`, `${r.id}::${specifier}`);
|
|
139
|
+
}
|
|
140
|
+
return id;
|
|
141
|
+
}
|
|
142
|
+
if (id === '/ember-vite-hmr/services/vite-hot-reload') {
|
|
143
|
+
return this.resolve('ember-vite-hmr/services/vite-hot-reload', path_1.default.join(process.cwd(), 'package.json'), meta);
|
|
144
|
+
}
|
|
145
|
+
});
|
|
131
146
|
},
|
|
132
147
|
load(id) {
|
|
133
148
|
return __awaiter(this, void 0, void 0, function* () {
|
|
134
149
|
if (id.startsWith(virtualPrefix)) {
|
|
150
|
+
if (!server) {
|
|
151
|
+
// During build, server is not available
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
135
154
|
let [imp, specifier] = id
|
|
136
155
|
.split('?')[0]
|
|
137
156
|
.slice(virtualPrefix.length, -'.gts'.length)
|
|
138
|
-
.split('
|
|
157
|
+
.split('::');
|
|
139
158
|
imp = imp.replace('embroider_virtual', '@embroider/virtual');
|
|
140
159
|
let filename = imp;
|
|
141
160
|
if (filename.includes('__vpc__')) {
|
|
@@ -206,8 +225,7 @@ function hmr(enableViteHmrForModes = ['development']) {
|
|
|
206
225
|
if (process.env['EMBER_VITE_HMR_ENABLED'] !== 'true') {
|
|
207
226
|
return source;
|
|
208
227
|
}
|
|
209
|
-
const resourcePath = id.
|
|
210
|
-
let didReplaceSources = false;
|
|
228
|
+
const resourcePath = normalizePath(id.split('?')[0]);
|
|
211
229
|
const name = require(`${process.cwd()}/package.json`).name;
|
|
212
230
|
if (resourcePath.includes(`${name}/app/app.js`)) {
|
|
213
231
|
source += `\n
|
|
@@ -224,96 +242,120 @@ function hmr(enableViteHmrForModes = ['development']) {
|
|
|
224
242
|
if (resourcePath.includes('ember-vite-hmr/virtual/components')) {
|
|
225
243
|
return source;
|
|
226
244
|
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
const resolveDep = (dep) => __awaiter(this, void 0, void 0, function* () {
|
|
230
|
-
const resolved = yield this.resolve(dep, resourcePath, {});
|
|
231
|
-
let id = resolved === null || resolved === void 0 ? void 0 : resolved.id;
|
|
232
|
-
if (!id)
|
|
233
|
-
return;
|
|
234
|
-
let appRoot = conf.root + '/app/';
|
|
235
|
-
if (id.startsWith(appRoot) && !id.startsWith('embroider_virtual:')) {
|
|
236
|
-
id = 'app/' + id.split(appRoot)[1];
|
|
237
|
-
}
|
|
238
|
-
if (id.startsWith('embroider_virtual:')) {
|
|
239
|
-
id = '@id/' + id;
|
|
240
|
-
}
|
|
241
|
-
if (path_1.default.resolve(id).replace(/\\/g, '/') === id &&
|
|
242
|
-
path_1.default.isAbsolute(id)) {
|
|
243
|
-
if (!id.startsWith('/')) {
|
|
244
|
-
id = '/' + id;
|
|
245
|
-
}
|
|
246
|
-
id = '/@fs' + id;
|
|
247
|
-
}
|
|
248
|
-
if (!id.startsWith('/') && !id.startsWith('.')) {
|
|
249
|
-
id = '/' + id;
|
|
250
|
-
}
|
|
251
|
-
return id;
|
|
252
|
-
});
|
|
253
|
-
const result = [
|
|
254
|
-
...source.matchAll(/import.meta.hot.accept\(['"]([^'"]+)['"]/g),
|
|
255
|
-
];
|
|
256
|
-
for (const resultElement of result) {
|
|
257
|
-
const dep = resultElement[1];
|
|
258
|
-
let possibleVirtual = { dep, specifier: null };
|
|
259
|
-
if (dep.includes(virtualPrefix)) {
|
|
260
|
-
const [imp, specifier] = dep.slice(virtualPrefix.length).split(':');
|
|
261
|
-
possibleVirtual.dep = imp;
|
|
262
|
-
possibleVirtual.specifier = specifier;
|
|
263
|
-
}
|
|
264
|
-
let id = yield resolveDep(possibleVirtual.dep);
|
|
265
|
-
if (!id)
|
|
266
|
-
continue;
|
|
267
|
-
if (dep === id)
|
|
268
|
-
continue;
|
|
269
|
-
if (possibleVirtual.dep !== dep) {
|
|
270
|
-
id = virtualPrefix + id + ':' + possibleVirtual.specifier;
|
|
271
|
-
}
|
|
272
|
-
didReplaceSources = true;
|
|
273
|
-
map[dep] = id;
|
|
274
|
-
}
|
|
245
|
+
if (resourcePath.includes('node_modules')) {
|
|
246
|
+
return source;
|
|
275
247
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
248
|
+
// Add hot reload statements for tracked imports (only non-node_modules)
|
|
249
|
+
// Use babel visitor to extract __hmr_import_metadata__
|
|
250
|
+
const result = (0, core_1.parseSync)(source, {
|
|
251
|
+
filename: resourcePath,
|
|
252
|
+
ast: true,
|
|
253
|
+
code: false,
|
|
254
|
+
configFile: false,
|
|
255
|
+
babelrc: false,
|
|
256
|
+
plugins: [
|
|
257
|
+
['@babel/plugin-syntax-typescript', { isTSX: true }],
|
|
258
|
+
['@babel/plugin-proposal-decorators', { version: '2022-03' }],
|
|
259
|
+
],
|
|
282
260
|
});
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
IfStatement = IfStatement.parentPath;
|
|
261
|
+
if (result) {
|
|
262
|
+
let importVar = null;
|
|
263
|
+
let bindings = [];
|
|
264
|
+
const importStatements = [];
|
|
265
|
+
const traverse = require('@babel/traverse').default;
|
|
266
|
+
// First pass: Extract metadata
|
|
267
|
+
traverse(result, {
|
|
268
|
+
ExportNamedDeclaration(path) {
|
|
269
|
+
var _a, _b, _c;
|
|
270
|
+
const declaration = path.node.declaration;
|
|
271
|
+
// Check if this is: export const __hmr_import_metadata__ = {...}
|
|
272
|
+
if ((declaration === null || declaration === void 0 ? void 0 : declaration.type) === 'VariableDeclaration' &&
|
|
273
|
+
((_c = (_b = (_a = declaration.declarations) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.id) === null || _c === void 0 ? void 0 : _c.name) === '__hmr_import_metadata__') {
|
|
274
|
+
const init = declaration.declarations[0].init;
|
|
275
|
+
if ((init === null || init === void 0 ? void 0 : init.type) === 'ObjectExpression') {
|
|
276
|
+
// Extract importVar and bindings from the object
|
|
277
|
+
for (const prop of init.properties) {
|
|
278
|
+
if (prop.type === 'ObjectProperty' && prop.key.type === 'Identifier') {
|
|
279
|
+
if (prop.key.name === 'importVar' && prop.value.type === 'StringLiteral') {
|
|
280
|
+
importVar = prop.value.value;
|
|
281
|
+
}
|
|
282
|
+
else if (prop.key.name === 'bindings' && prop.value.type === 'ArrayExpression') {
|
|
283
|
+
bindings = prop.value.elements
|
|
284
|
+
.filter((el) => (el === null || el === void 0 ? void 0 : el.type) === 'StringLiteral')
|
|
285
|
+
.map((el) => el.value);
|
|
309
286
|
}
|
|
310
|
-
IfStatement.remove();
|
|
311
287
|
}
|
|
312
|
-
}
|
|
313
|
-
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
});
|
|
293
|
+
// Second pass: Find matching imports (only if we have bindings to match)
|
|
294
|
+
if (importVar && bindings.length > 0) {
|
|
295
|
+
traverse(result, {
|
|
296
|
+
ImportDeclaration(path) {
|
|
297
|
+
const importSource = path.node.source.value;
|
|
298
|
+
for (const specifier of path.node.specifiers) {
|
|
299
|
+
const local = specifier.local.name;
|
|
300
|
+
if (bindings.includes(local)) {
|
|
301
|
+
let specifierName = 'default';
|
|
302
|
+
if (specifier.type === 'ImportDefaultSpecifier') {
|
|
303
|
+
specifierName = 'default';
|
|
304
|
+
}
|
|
305
|
+
else if (specifier.type === 'ImportSpecifier') {
|
|
306
|
+
// For named imports, use the imported name
|
|
307
|
+
specifierName = specifier.imported.name;
|
|
308
|
+
}
|
|
309
|
+
else if (specifier.type === 'ImportNamespaceSpecifier') {
|
|
310
|
+
specifierName = '*';
|
|
311
|
+
}
|
|
312
|
+
importStatements.push({
|
|
313
|
+
local,
|
|
314
|
+
source: importSource,
|
|
315
|
+
specifier: specifierName,
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
}
|
|
314
319
|
},
|
|
315
|
-
|
|
316
|
-
}
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
// Process metadata if we found importVar (even with empty bindings)
|
|
323
|
+
if (importVar) {
|
|
324
|
+
// Generate hot reload code for each import (only if we have bindings)
|
|
325
|
+
const hotReloadStatements = [];
|
|
326
|
+
for (const imp of importStatements) {
|
|
327
|
+
// Resolve the import to check if it's from node_modules
|
|
328
|
+
const resolved = yield this.resolve(imp.source, resourcePath, {});
|
|
329
|
+
if ((resolved === null || resolved === void 0 ? void 0 : resolved.id) && normalizePath(resolved.id).includes('node_modules')) {
|
|
330
|
+
// Skip node_modules imports
|
|
331
|
+
continue;
|
|
332
|
+
}
|
|
333
|
+
const sourceId = imp.source.replace(/@embroider\/virtual/g, 'embroider_virtual');
|
|
334
|
+
const virtualPath = `/ember-vite-hmr/virtual/component:${sourceId}::${imp.specifier}.gjs`;
|
|
335
|
+
hotReloadStatements.push(`
|
|
336
|
+
(async () => {
|
|
337
|
+
const GlimmerComponent = (await import('@glimmer/component')).default;
|
|
338
|
+
if (${imp.local}.prototype instanceof GlimmerComponent) {
|
|
339
|
+
const c = await import('${virtualPath}');
|
|
340
|
+
${importVar}.${imp.local} = c.default;
|
|
341
|
+
import.meta.hot.accept('${virtualPath}', (c) => {
|
|
342
|
+
${importVar}.${imp.local} = c['${imp.specifier}'];
|
|
343
|
+
});
|
|
344
|
+
import.meta.hot.accept('${imp.source}');
|
|
345
|
+
}
|
|
346
|
+
})();`);
|
|
347
|
+
}
|
|
348
|
+
// Always remove the metadata export
|
|
349
|
+
source = source.replace(/export const __hmr_import_metadata__[^;]+;/, '');
|
|
350
|
+
// Add HMR code if we have any statements OR if we have bindings (even if all were skipped)
|
|
351
|
+
if (hotReloadStatements.length > 0 || bindings.length > 0) {
|
|
352
|
+
const hotReloadCode = `
|
|
353
|
+
if (import.meta.hot) {
|
|
354
|
+
${hotReloadStatements.join('\n')}
|
|
355
|
+
}`;
|
|
356
|
+
source = source + hotReloadCode;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
317
359
|
}
|
|
318
360
|
const supportedPaths = ['routers', 'controllers', 'routes', 'templates'];
|
|
319
361
|
const supportedFileNames = [
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
import Service, { service } from '@ember/service';
|
|
2
3
|
import { getOwner } from '@ember/owner';
|
|
3
4
|
import Route from '@ember/routing/route';
|
|
@@ -9,14 +10,14 @@ function _applyDecoratedDescriptor(i, e, r, n, l) {
|
|
|
9
10
|
a[i] = n[i];
|
|
10
11
|
}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = true), a = r.slice().reverse().reduce(function (r, n) {
|
|
11
12
|
return n(i, e, r) || r;
|
|
12
|
-
}, a),
|
|
13
|
+
}, a), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a;
|
|
13
14
|
}
|
|
14
15
|
function _initializerDefineProperty(e, i, r, l) {
|
|
15
16
|
r && Object.defineProperty(e, i, {
|
|
16
17
|
enumerable: r.enumerable,
|
|
17
18
|
configurable: r.configurable,
|
|
18
19
|
writable: r.writable,
|
|
19
|
-
value: r.initializer ? r.initializer.call(l) :
|
|
20
|
+
value: r.initializer ? r.initializer.call(l) : void 0
|
|
20
21
|
});
|
|
21
22
|
}
|
|
22
23
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite-hot-reload.js","sources":["../../src/services/vite-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';\nimport ApplicationInstance from '@ember/application/instance';\n\nconst ChangeMap = new WeakMap();\n\nfunction getLatestChange(obj: any) {\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 Resolver: null,\n _accepting: 0,\n changed: {},\n subscribers: [],\n version: 1,\n routerVersion: 1,\n moduleDepCallbacks: {},\n versionMap: {},\n\n clear(module: Module) {\n this.moduleDepCallbacks[module.id] = {};\n },\n register(module: Module, dep: string, callback: Function) {\n dep = dep.replace(new RegExp(`^${modulePrefix}/`), './');\n this.moduleDepCallbacks[module.id]![dep] =\n this.moduleDepCallbacks[module.id]![dep] || ([] as Function[]);\n this.moduleDepCallbacks[module.id]![dep]!.push(callback);\n },\n loadNew(oldModule: Module, newModule: Module) {\n ModuleMap.set(newModule.id, newModule);\n this.versionMap[newModule.id] = newModule.version;\n const entry = Object.entries(\n this.Resolver.explicitModules as Record<string, any>,\n ).find(([name, module]) => module.default === oldModule.exports.default);\n if (!entry) return;\n this.Resolver.explicitModules[entry[0]] = newModule.exports;\n },\n\n __import(moduleUrl: string) {\n return import(/* @vite-ignore */ moduleUrl);\n },\n\n async canAcceptNew(moduleUrl: string) {\n this._accepting += 1;\n const m = await this.__import(moduleUrl);\n const module: Module = {\n exports: m,\n id: moduleUrl.split('?')[0]!.replace(/http:\\/\\/.*:[^\\/]*\\//, ''),\n version: 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.includes('/templates/') ||\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 (module.id.includes('templates') && module.id.includes('components')) {\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 } else {\n ModuleMap.set(module.id, module);\n }\n module.version = this.version;\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: any) => 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 ViteHotReloadService extends Service {\n declare container: any;\n @service() router!: RouterService;\n\n init(args: any) {\n super.init(args);\n if (!window.emberHotReloadPlugin) return;\n const app = (getOwner(this) as ApplicationInstance)!.application as any;\n window.emberHotReloadPlugin.Resolver = app.Resolver;\n modulePrefix = app.modulePrefix;\n podModulePrefix = app.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: string) {\n const route = getRoute.call(\n this,\n `${name}--hot-version--${window.emberHotReloadPlugin.routerVersion}`,\n );\n route.fullRouteName = `${name}`.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) as any)?.__container__;\n window.emberHotReloadPlugin.subscribe((oldModule, newModule) => {\n let changed = false;\n if (\n oldModule.exports.default?.prototype &&\n oldModule.exports.default.prototype instanceof Router\n ) {\n changed = true;\n }\n if (\n oldModule.exports.default?.prototype &&\n oldModule.exports.default.prototype instanceof Controller\n ) {\n changed = true;\n }\n if (\n oldModule.id.startsWith('app/templates/') &&\n !oldModule.id.startsWith('app/templates/components/')\n ) {\n changed = true;\n }\n if (oldModule.id.startsWith(`./${podModulePrefix}/`)) {\n changed = true;\n }\n if (!changed) return;\n window.emberHotReloadPlugin.routerVersion += 1;\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('app/templates/') &&\n !oldModule.id.startsWith('app/templates/components/')\n ) {\n this.router.refresh();\n }\n if (oldModule.id.startsWith(`./${podModulePrefix}/`)) {\n this.router.refresh();\n }\n });\n }\n getLatestChange(obj: any) {\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': ViteHotReloadService;\n }\n}\n"],"names":["ChangeMap","WeakMap","getLatestChange","obj","has","get","modulePrefix","podModulePrefix","import","meta","hot","ModuleMap","Map","window","emberHotReloadPlugin","Resolver","_accepting","changed","subscribers","version","routerVersion","moduleDepCallbacks","versionMap","clear","module","id","register","dep","callback","replace","RegExp","push","loadNew","oldModule","newModule","set","entry","Object","entries","explicitModules","find","name","default","exports","__import","moduleUrl","canAcceptNew","m","split","setTimeout","notifyNew","ok","includes","match","old","new","values","forEach","change","fn","subscribe","unsubscribe","idx","indexOf","splice","ViteHotReloadService","_dec","service","_class","Service","constructor","args","_initializerDefineProperty","_descriptor","init","app","getOwner","application","router","_router","defineProperty","v","getRoute","route","call","fullRouteName","___routerMicrolib","container","__container__","prototype","Router","Controller","startsWith","types","keys","cache","k","some","t","factoryManagerCache","registry","_resolveCache","validationCache","registrations","refresh","_applyDecoratedDescriptor","configurable","enumerable","writable","initializer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAMA,SAAS,GAAG,IAAIC,OAAO,EAAE;AAE/B,SAASC,eAAeA,CAACC,GAAQ,EAAE;AACjC,EAAA,OAAOH,SAAS,CAACI,GAAG,CAACD,GAAG,CAAC,EAAE;AACzBA,IAAAA,GAAG,GAAGH,SAAS,CAACK,GAAG,CAACF,GAAG,CAAC;AAC1B;AACA,EAAA,OAAOA,GAAG;AACZ;AAEA,IAAIG,YAAqB;AACzB,IAAIC,eAAwB;AAC5B,IAAIC,MAAM,CAACC,IAAI,CAACC,GAAG,EAAE;AACnB,EAAA,MAAMC,SAAS,GAAG,IAAIC,GAAG,EAAE;EAE3BC,MAAM,CAACC,oBAAoB,GAAG;AAC5BC,IAAAA,QAAQ,EAAE,IAAI;AACdC,IAAAA,UAAU,EAAE,CAAC;IACbC,OAAO,EAAE,EAAE;AACXC,IAAAA,WAAW,EAAE,EAAE;AACfC,IAAAA,OAAO,EAAE,CAAC;AACVC,IAAAA,aAAa,EAAE,CAAC;IAChBC,kBAAkB,EAAE,EAAE;IACtBC,UAAU,EAAE,EAAE;IAEdC,KAAKA,CAACC,MAAc,EAAE;MACpB,IAAI,CAACH,kBAAkB,CA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vB,IAAA,CAAA,EAAA;EAAAwC,YAAA,EAAA,IAAA;EAAAC,UAAA,EAAA,IAAA;EAAAC,QAAA,EAAA,IAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,EAAAzC,MAAA;AAGD;AACA;AACA;;;;"}
|
|
1
|
+
{"version":3,"file":"vite-hot-reload.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ember-vite-hmr",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"ember-addon"
|
|
6
6
|
],
|
|
@@ -39,74 +39,74 @@
|
|
|
39
39
|
"prepack": "pnpm build || echo 'its okay'"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@babel/core": "^7.
|
|
43
|
-
"@babel/plugin-transform-typescript": "^7.
|
|
44
|
-
"@babel/traverse": "^7.
|
|
42
|
+
"@babel/core": "^7.28.0",
|
|
43
|
+
"@babel/plugin-transform-typescript": "^7.28.5",
|
|
44
|
+
"@babel/traverse": "^7.28.5",
|
|
45
45
|
"@babel/types": "^7.24.0",
|
|
46
|
-
"@embroider/addon-shim": "^1.
|
|
47
|
-
"@glimmer/syntax": "^0.
|
|
48
|
-
"@types/supports-color": "^
|
|
46
|
+
"@embroider/addon-shim": "^1.10.0",
|
|
47
|
+
"@glimmer/syntax": "^0.95.0",
|
|
48
|
+
"@types/supports-color": "^10.0.0",
|
|
49
49
|
"babel-import-util": "^3.0.0",
|
|
50
|
-
"babel-loader": "^
|
|
50
|
+
"babel-loader": "^10.0.0",
|
|
51
51
|
"babel-preset-env": "^1.7.0",
|
|
52
|
-
"semver": "^7.7.
|
|
52
|
+
"semver": "^7.7.3"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@babel/eslint-parser": "^7.
|
|
55
|
+
"@babel/eslint-parser": "^7.28.5",
|
|
56
56
|
"@babel/plugin-proposal-class-properties": "^7.16.7",
|
|
57
|
-
"@babel/plugin-proposal-decorators": "^7.
|
|
58
|
-
"@babel/plugin-transform-class-static-block": "^7.
|
|
59
|
-
"@babel/runtime": "^7.
|
|
60
|
-
"@embroider/addon-dev": "^
|
|
61
|
-
"@embroider/compat": "^
|
|
62
|
-
"@embroider/core": "^
|
|
57
|
+
"@babel/plugin-proposal-decorators": "^7.28.0",
|
|
58
|
+
"@babel/plugin-transform-class-static-block": "^7.28.3",
|
|
59
|
+
"@babel/runtime": "^7.28.4",
|
|
60
|
+
"@embroider/addon-dev": "^8.1.0",
|
|
61
|
+
"@embroider/compat": "^4.1.8",
|
|
62
|
+
"@embroider/core": "^4.2.5",
|
|
63
63
|
"@glint/core": "^1.2.0",
|
|
64
|
-
"@glint/environment-ember-loose": "^1.2
|
|
64
|
+
"@glint/environment-ember-loose": "^1.5.2",
|
|
65
65
|
"@glint/environment-ember-template-imports": "^1.2.0",
|
|
66
|
-
"@glint/template": "^1.
|
|
66
|
+
"@glint/template": "^1.7.0",
|
|
67
67
|
"@rollup/plugin-babel": "^6.0.3",
|
|
68
|
-
"@tsconfig/ember": "^3.0.
|
|
68
|
+
"@tsconfig/ember": "^3.0.11",
|
|
69
69
|
"@types/babel__core": "^7.20.3",
|
|
70
|
-
"@types/babel__traverse": "^7.
|
|
70
|
+
"@types/babel__traverse": "^7.28.0",
|
|
71
71
|
"@types/csso": "^5.0.4",
|
|
72
72
|
"@types/debug": "^4.1.5",
|
|
73
73
|
"@types/fs-extra": "^11.0.4",
|
|
74
|
-
"@types/lodash": "^4.
|
|
74
|
+
"@types/lodash": "^4.17.20",
|
|
75
75
|
"@types/mini-css-extract-plugin": "^2.5.1",
|
|
76
|
-
"@types/node": "^
|
|
76
|
+
"@types/node": "^24.1.0",
|
|
77
77
|
"@types/rsvp": "^4.0.9",
|
|
78
|
-
"@types/semver": "^7.7.
|
|
79
|
-
"assert-never": "^1.
|
|
78
|
+
"@types/semver": "^7.7.1",
|
|
79
|
+
"assert-never": "^1.4.0",
|
|
80
80
|
"babel-import-util": "^3.0.0",
|
|
81
|
-
"babel-plugin-ember-template-compilation": "^
|
|
82
|
-
"concurrently": "^9.
|
|
81
|
+
"babel-plugin-ember-template-compilation": "^3.0.1",
|
|
82
|
+
"concurrently": "^9.2.1",
|
|
83
83
|
"content-tag": "^2.0.1",
|
|
84
84
|
"ember-cli-htmlbars": "^6.3.0",
|
|
85
|
-
"ember-resolver": "^13.
|
|
85
|
+
"ember-resolver": "^13.1.1",
|
|
86
86
|
"ember-source": "^6.6.0",
|
|
87
|
-
"@glimmer/component": "^
|
|
88
|
-
"ember-template-lint": "^
|
|
89
|
-
"eslint": "^9.
|
|
87
|
+
"@glimmer/component": "^2.0.0",
|
|
88
|
+
"ember-template-lint": "^7.9.3",
|
|
89
|
+
"eslint": "^9.38.0",
|
|
90
90
|
"eslint-config-prettier": "^10.1.8",
|
|
91
|
-
"eslint-plugin-ember": "^12.
|
|
92
|
-
"eslint-plugin-n": "^17.
|
|
93
|
-
"eslint-plugin-prettier": "^5.
|
|
94
|
-
"execa": "^9.
|
|
95
|
-
"fs-extra": "^11.2
|
|
96
|
-
"playwright-chromium": "^1.
|
|
97
|
-
"prettier": "^3.
|
|
98
|
-
"prettier-plugin-ember-template-tag": "^2.0
|
|
99
|
-
"puppeteer-chromium-resolver": "^
|
|
100
|
-
"rollup": "^4.
|
|
91
|
+
"eslint-plugin-ember": "^12.7.4",
|
|
92
|
+
"eslint-plugin-n": "^17.23.1",
|
|
93
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
94
|
+
"execa": "^9.6.0",
|
|
95
|
+
"fs-extra": "^11.3.2",
|
|
96
|
+
"playwright-chromium": "^1.56.1",
|
|
97
|
+
"prettier": "^3.6.2",
|
|
98
|
+
"prettier-plugin-ember-template-tag": "^2.1.0",
|
|
99
|
+
"puppeteer-chromium-resolver": "^24.0.2",
|
|
100
|
+
"rollup": "^4.52.5",
|
|
101
101
|
"source-map-url": "^0.4.1",
|
|
102
|
-
"strip-ansi": "^7.1.
|
|
102
|
+
"strip-ansi": "^7.1.2",
|
|
103
103
|
"style-loader": "^4.0.0",
|
|
104
|
-
"supports-color": "^
|
|
105
|
-
"terser": "^5.
|
|
104
|
+
"supports-color": "^10.2.2",
|
|
105
|
+
"terser": "^5.44.0",
|
|
106
106
|
"thread-loader": "^4.0.2",
|
|
107
|
-
"typescript": "^5.
|
|
108
|
-
"vite": "^7.
|
|
109
|
-
"vitest": "^2.
|
|
107
|
+
"typescript": "^5.9.3",
|
|
108
|
+
"vite": "^7.1.11",
|
|
109
|
+
"vitest": "^3.2.4"
|
|
110
110
|
},
|
|
111
111
|
"peerDependencies": {
|
|
112
112
|
"@embroider/compat": "*",
|