ember-vite-hmr 1.1.0 → 1.3.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.
@@ -0,0 +1 @@
1
+ export { default } from "ember-vite-hmr/initializers/vite-hot-reload";
@@ -0,0 +1 @@
1
+ export { default } from "ember-vite-hmr/services/vite-hot-reload";
@@ -0,0 +1,17 @@
1
+ import '@ember/application/instance';
2
+
3
+ function initialize(application) {
4
+ application.__container__.lookup('service:vite-hot-reload');
5
+ const resolver = application.__registry__.resolver._fallback || application.__registry__.resolver;
6
+ const resolverResolve = resolver.resolve;
7
+ resolver.resolve = function (name) {
8
+ name = name.replace(/--hot-version--.*$/, '');
9
+ return resolverResolve.call(this, name);
10
+ };
11
+ }
12
+ var viteHotReload = {
13
+ initialize
14
+ };
15
+
16
+ export { viteHotReload as default, initialize };
17
+ //# sourceMappingURL=vite-hot-reload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vite-hot-reload.js","sources":["../../src/initializers/vite-hot-reload.ts"],"sourcesContent":["import ApplicationInstance from \"@ember/application/instance\";\n\nexport function initialize(application: ApplicationInstance) {\n application.__container__.lookup('service:vite-hot-reload');\n const resolver =\n (application.__registry__.resolver as any)._fallback ||\n application.__registry__.resolver;\n const resolverResolve = resolver.resolve;\n resolver.resolve = function (name: string) {\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":";;AAEO,SAASA,UAAUA,CAACC,WAAgC,EAAE;AAC3DA,EAAAA,WAAW,CAACC,aAAa,CAACC,MAAM,CAAC,yBAAyB,CAAC,CAAA;AAC3D,EAAA,MAAMC,QAAQ,GACXH,WAAW,CAACI,YAAY,CAACD,QAAQ,CAASE,SAAS,IACpDL,WAAW,CAACI,YAAY,CAACD,QAAQ,CAAA;AACnC,EAAA,MAAMG,eAAe,GAAGH,QAAQ,CAACI,OAAO,CAAA;AACxCJ,EAAAA,QAAQ,CAACI,OAAO,GAAG,UAAUC,IAAY,EAAE;IACzCA,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,oBAAe;AACbT,EAAAA,UAAAA;AACF,CAAC;;;;"}
@@ -160,6 +160,9 @@ class HotAstProcessor {
160
160
  node.original === 'component' ||
161
161
  node.original === 'modifier') {
162
162
  const parent = p.parentNode;
163
+ if (typeof parent.params[0].original !== 'string') {
164
+ return;
165
+ }
163
166
  const original = parent.params[0].original.split('.')[0];
164
167
  if (original &&
165
168
  findBlockParams(original, p))
@@ -0,0 +1,204 @@
1
+ import Service, { service } from '@ember/service';
2
+ import { getOwner } from '@ember/owner';
3
+ import '@ember/routing/router-service';
4
+ import Router from '@ember/routing/route';
5
+ import Controller from '@ember/controller';
6
+ import '@ember/application/instance';
7
+
8
+ function _initializerWarningHelper(descriptor, context) {
9
+ throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.');
10
+ }
11
+ function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
12
+ var desc = {};
13
+ Object.keys(descriptor).forEach(function (key) {
14
+ desc[key] = descriptor[key];
15
+ });
16
+ desc.enumerable = !!desc.enumerable;
17
+ desc.configurable = !!desc.configurable;
18
+ if ('value' in desc || desc.initializer) {
19
+ desc.writable = true;
20
+ }
21
+ desc = decorators.slice().reverse().reduce(function (desc, decorator) {
22
+ return decorator(target, property, desc) || desc;
23
+ }, desc);
24
+ if (context && desc.initializer !== void 0) {
25
+ desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
26
+ desc.initializer = undefined;
27
+ }
28
+ if (desc.initializer === void 0) {
29
+ Object.defineProperty(target, property, desc);
30
+ desc = null;
31
+ }
32
+ return desc;
33
+ }
34
+
35
+ var _dec, _class;
36
+ const ChangeMap = new WeakMap();
37
+ function getLatestChange(obj) {
38
+ while (ChangeMap.has(obj)) {
39
+ obj = ChangeMap.get(obj);
40
+ }
41
+ return obj;
42
+ }
43
+ let modulePrefix;
44
+ let podModulePrefix;
45
+ if (import.meta.hot) {
46
+ const ModuleMap = new Map();
47
+ window.emberHotReloadPlugin = {
48
+ _accepting: 0,
49
+ changed: {},
50
+ subscribers: [],
51
+ version: 1,
52
+ moduleDepCallbacks: {},
53
+ versionMap: {},
54
+ clear(module) {
55
+ this.moduleDepCallbacks[module.id] = {};
56
+ },
57
+ register(module, dep, callback) {
58
+ dep = dep.replace(new RegExp(`^${modulePrefix}/`), './');
59
+ this.moduleDepCallbacks[module.id][dep] = this.moduleDepCallbacks[module.id][dep] || [];
60
+ this.moduleDepCallbacks[module.id][dep].push(callback);
61
+ },
62
+ loadNew(oldModule, newModule) {
63
+ this.versionMap[newModule.id] = newModule.version;
64
+ const entry = Object.values(requirejs.entries).find(module => module.module.exports.default === oldModule.exports.default);
65
+ if (!entry) return;
66
+ entry.module = {
67
+ id: newModule.id,
68
+ exports: newModule.exports,
69
+ version: newModule.version
70
+ };
71
+ },
72
+ __import(moduleUrl) {
73
+ return import( /* @vite-ignore */moduleUrl);
74
+ },
75
+ async canAcceptNew(moduleUrl) {
76
+ this._accepting += 1;
77
+ const m = await this.__import(moduleUrl);
78
+ const module = {
79
+ exports: m,
80
+ id: moduleUrl.split('?')[0],
81
+ version: 0
82
+ };
83
+ this._accepting -= 1;
84
+ if (this._accepting === 0) {
85
+ setTimeout(() => this.notifyNew(), 0);
86
+ }
87
+ 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)$/);
88
+ if (!ok) {
89
+ return false;
90
+ }
91
+ if (ModuleMap.get(module.id)) {
92
+ this.changed[module.id] = {
93
+ old: ModuleMap.get(module.id),
94
+ new: module
95
+ };
96
+ }
97
+ module.version = this.version;
98
+ ModuleMap.set(module.id, module);
99
+ return true;
100
+ },
101
+ notifyNew() {
102
+ this.version += 1;
103
+ Object.values(this.changed).forEach(change => {
104
+ this.loadNew(change.old, change.new);
105
+ this.subscribers.forEach(fn => fn(change.old, change.new));
106
+ });
107
+ this.changed = {};
108
+ },
109
+ subscribe(fn) {
110
+ this.subscribers.push(fn);
111
+ },
112
+ unsubscribe(fn) {
113
+ const idx = this.subscribers.indexOf(fn);
114
+ if (idx >= 0) {
115
+ this.subscribers.splice(idx, 1);
116
+ }
117
+ }
118
+ };
119
+ }
120
+ let ViteHotReloadService = (_dec = service(), (_class = class ViteHotReloadService extends Service {
121
+ router = _initializerWarningHelper();
122
+ init(args) {
123
+ super.init(args);
124
+ if (!window.emberHotReloadPlugin) return;
125
+ const app = getOwner(this).application;
126
+ modulePrefix = app.modulePrefix;
127
+ podModulePrefix = app.podModulePrefix;
128
+ if (import.meta.hot) {
129
+ import.meta.hot.on('vite:beforeUpdate', options => {
130
+ options.updates = options.updates.filter(u => !u.path.startsWith(`/assets/${modulePrefix}.js`));
131
+ });
132
+ }
133
+ this.router._router;
134
+ Object.defineProperty(this.router._router, '_routerMicrolib', {
135
+ set(v) {
136
+ const getRoute = v.getRoute;
137
+ v.getRoute = function (name) {
138
+ const route = getRoute.call(this, `${name}--hot-version--${window.emberHotReloadPlugin.version}`);
139
+ route.fullRouteName = route.fullRouteName.replace(/--hot-version--.*$/, '');
140
+ return route;
141
+ };
142
+ this.___routerMicrolib = v;
143
+ },
144
+ get() {
145
+ return this.___routerMicrolib;
146
+ }
147
+ });
148
+ this.container = getOwner(this)?.__container__;
149
+ window.emberHotReloadPlugin.subscribe((oldModule, newModule) => {
150
+ const types = ['route', 'controller', 'template', 'modifier', 'helper', 'component'];
151
+ Object.keys(this.container.cache).forEach(k => {
152
+ if (types.some(t => k.startsWith(`${t}:`))) {
153
+ delete this.container.cache[k];
154
+ }
155
+ });
156
+ Object.keys(this.container.factoryManagerCache).forEach(k => {
157
+ if (types.some(t => k.startsWith(`${t}:`))) {
158
+ delete this.container.factoryManagerCache[k];
159
+ }
160
+ });
161
+ Object.keys(this.container.registry._resolveCache).forEach(k => {
162
+ if (types.some(t => k.startsWith(`${t}:`))) {
163
+ delete this.container.registry._resolveCache[k];
164
+ }
165
+ });
166
+ Object.keys(this.container.validationCache).forEach(k => {
167
+ if (types.some(t => k.startsWith(`${t}:`))) {
168
+ delete this.container.validationCache[k];
169
+ }
170
+ });
171
+ Object.keys(this.container.registry.registrations).forEach(k => {
172
+ if (types.some(t => k.startsWith(`${t}:`))) {
173
+ delete this.container.registry.registrations[k];
174
+ }
175
+ });
176
+ if (oldModule.exports.default?.prototype && oldModule.exports.default.prototype instanceof Router) {
177
+ this.router.refresh();
178
+ }
179
+ if (oldModule.exports.default?.prototype && oldModule.exports.default.prototype instanceof Controller) {
180
+ this.router.refresh();
181
+ }
182
+ if (oldModule.id.startsWith('./templates/') && !oldModule.id.startsWith('./templates/components/')) {
183
+ this.router.refresh();
184
+ }
185
+ if (oldModule.id.startsWith(`./${podModulePrefix}/`)) {
186
+ this.router.refresh();
187
+ }
188
+ });
189
+ }
190
+ getLatestChange(obj) {
191
+ return getLatestChange(obj);
192
+ }
193
+ }, (_applyDecoratedDescriptor(_class.prototype, "router", [_dec], {
194
+ configurable: true,
195
+ enumerable: true,
196
+ writable: true,
197
+ initializer: null
198
+ })), _class));
199
+ // this service using `Owner.lookup('service:hot-reload')`, as well
200
+ // as to check when you pass the service name as an argument to the decorator,
201
+ // like `@service('hot-reload') declare altName: HotReloadService;`.
202
+
203
+ export { ViteHotReloadService as default };
204
+ //# sourceMappingURL=vite-hot-reload.js.map
@@ -0,0 +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 _accepting: 0,\n changed: {},\n subscribers: [],\n version: 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 this.versionMap[newModule.id] = newModule.version;\n const entry = Object.values(requirejs.entries as Record<string, ReqJSEntry>).find(\n (module) => module.module.exports.default === oldModule.exports.default,\n );\n if (!entry) return;\n entry.module = {\n id: newModule.id,\n exports: newModule.exports,\n version: newModule.version\n };\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]!,\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.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: 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 modulePrefix = app.modulePrefix;\n podModulePrefix = app.podModulePrefix;\n if (import.meta.hot) {\n import.meta.hot.on('vite:beforeUpdate', (options) => {\n options.updates = options.updates.filter(\n (u: any) => !u.path.startsWith(`/assets/${modulePrefix}.js`),\n );\n });\n }\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.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) as any)?.__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: 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}"],"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","ViteHotReloadService","_dec","service","_class","Service","router","_initializerWarningHelper","init","args","app","getOwner","application","on","options","updates","filter","u","path","startsWith","_router","defineProperty","v","getRoute","name","route","call","fullRouteName","___routerMicrolib","container","__container__","types","keys","cache","k","some","t","factoryManagerCache","registry","_resolveCache","validationCache","registrations","prototype","Router","refresh","Controller","_applyDecoratedDescriptor","configurable","enumerable","writable","initializer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QAAA,IAAI,CAAC4D,MAAM,CAACsC,OAAO,EAAE,CAAA;AACvB,OAAA;AACF,KAAC,CAAC,CAAA;AACJ,GAAA;EACAvG,eAAeA,CAACC,GAAQ,EAAE;IACxB,OAAOD,eAAe,CAACC,GAAG,CAAC,CAAA;AAC7B,GAAA;AACF,CAAC,GAAAwG,yBAAA,CAAA1C,MAAA,CAAAsC,SAAA,EAAA,QAAA,EAAA,CAAAxC,IAAA,CAAA,EAAA;EAAA6C,YAAA,EAAA,IAAA;EAAAC,UAAA,EAAA,IAAA;EAAAC,QAAA,EAAA,IAAA;EAAAC,WAAA,EAAA,IAAA;AAAA,CAAA,CAAA,GAAA9C,MAAA,CAAA,EAAA;AAGD;AACA;AACA;;;;"}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=template-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template-registry.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-vite-hmr",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "keywords": [
5
5
  "ember-addon"
6
6
  ],
@@ -58,7 +58,7 @@
58
58
  "supports-color": "^8.1.0",
59
59
  "terser": "^5.7.0",
60
60
  "thread-loader": "^3.0.4",
61
- "vite": "^5.0.12",
61
+ "vite": "^5.2.11",
62
62
  "vitest": "^1.2.2",
63
63
  "ember-cli-htmlbars": "^6.3.0",
64
64
  "@babel/eslint-parser": "^7.19.1",
@@ -82,8 +82,9 @@
82
82
  "@types/fs-extra": "^9.0.12",
83
83
  "@types/lodash": "^4.14.170",
84
84
  "@types/mini-css-extract-plugin": "^1.4.3",
85
- "@types/node": "^15.12.2",
85
+ "@types/node": "^18.19.31",
86
86
  "@types/semver": "^7.3.6",
87
+ "@types/rsvp": "^4.0.9",
87
88
  "babel-plugin-ember-template-compilation": "^2.2.2",
88
89
  "babel-import-util": "2.0.3",
89
90
  "concurrently": "^8.0.1",