@nativescript/vite 8.0.1-rc.0 → 8.0.2
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/helpers/project.d.ts +0 -19
- package/helpers/project.js +20 -0
- package/helpers/project.js.map +1 -1
- package/hmr/client/css-handler.js +4 -10
- package/hmr/client/css-handler.js.map +1 -1
- package/hmr/entry-runtime.js +2 -12
- package/hmr/entry-runtime.js.map +1 -1
- package/hmr/frameworks/vue/client/index.js +34 -14
- package/hmr/frameworks/vue/client/index.js.map +1 -1
- package/hmr/frameworks/vue/client/navigate-app.d.ts +29 -0
- package/hmr/frameworks/vue/client/navigate-app.js +73 -6
- package/hmr/frameworks/vue/client/navigate-app.js.map +1 -1
- package/hmr/frameworks/vue/client/vue-sfc-update-overlay.d.ts +7 -0
- package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js +19 -0
- package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js.map +1 -1
- package/hmr/frameworks/vue/server/sfc-change-kind.d.ts +50 -0
- package/hmr/frameworks/vue/server/sfc-change-kind.js +92 -0
- package/hmr/frameworks/vue/server/sfc-change-kind.js.map +1 -0
- package/hmr/frameworks/vue/server/strategy.js +37 -2
- package/hmr/frameworks/vue/server/strategy.js.map +1 -1
- package/hmr/server/vite-plugin.js +12 -3
- package/hmr/server/vite-plugin.js.map +1 -1
- package/hmr/shared/protocol.d.ts +9 -0
- package/hmr/shared/protocol.js.map +1 -1
- package/hmr/shared/runtime/restyle-roots.d.ts +22 -0
- package/hmr/shared/runtime/restyle-roots.js +67 -0
- package/hmr/shared/runtime/restyle-roots.js.map +1 -0
- package/package.json +1 -1
- package/shims/react-jsx-runtime.d.ts +4 -4
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-running styling after a CSS hot update.
|
|
3
|
+
*
|
|
4
|
+
* `_onCssStateChange()` walks the view it is called on plus its descendants, so
|
|
5
|
+
* calling it on `Application.getRootView()` covers the app tree — and nothing
|
|
6
|
+
* else. A presented modal is not in that tree: core keeps modal roots in their
|
|
7
|
+
* own list (`_getRootModalViews()`), reachable from any view but never through
|
|
8
|
+
* `eachDescendant` from the app root. Restyling only the app root therefore
|
|
9
|
+
* leaves an open sheet showing the stylesheet it was presented with, and the
|
|
10
|
+
* hot update looks like it silently did nothing.
|
|
11
|
+
*
|
|
12
|
+
* Every CSS applier funnels through here so the three of them (the client
|
|
13
|
+
* handler, the entry runtime's core-realm applier, and the browser-runtime
|
|
14
|
+
* fallback) cannot drift apart on which roots they refresh.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Restyle a root view and every modal presented over it.
|
|
18
|
+
*
|
|
19
|
+
* `seen` lets a caller iterating several Application realms skip roots it has
|
|
20
|
+
* already refreshed; it is populated as roots are visited.
|
|
21
|
+
*/
|
|
22
|
+
export declare function restyleRootAndModals(rootView: unknown, seen?: Set<unknown>): void;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-running styling after a CSS hot update.
|
|
3
|
+
*
|
|
4
|
+
* `_onCssStateChange()` walks the view it is called on plus its descendants, so
|
|
5
|
+
* calling it on `Application.getRootView()` covers the app tree — and nothing
|
|
6
|
+
* else. A presented modal is not in that tree: core keeps modal roots in their
|
|
7
|
+
* own list (`_getRootModalViews()`), reachable from any view but never through
|
|
8
|
+
* `eachDescendant` from the app root. Restyling only the app root therefore
|
|
9
|
+
* leaves an open sheet showing the stylesheet it was presented with, and the
|
|
10
|
+
* hot update looks like it silently did nothing.
|
|
11
|
+
*
|
|
12
|
+
* Every CSS applier funnels through here so the three of them (the client
|
|
13
|
+
* handler, the entry runtime's core-realm applier, and the browser-runtime
|
|
14
|
+
* fallback) cannot drift apart on which roots they refresh.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Re-trigger styling on one view.
|
|
18
|
+
*
|
|
19
|
+
* The className round-trip is the fallback for a view that predates
|
|
20
|
+
* `_onCssStateChange`: assigning a different value and back invalidates the
|
|
21
|
+
* cached style state through the public property.
|
|
22
|
+
*/
|
|
23
|
+
function restyleView(view) {
|
|
24
|
+
if (!view)
|
|
25
|
+
return;
|
|
26
|
+
try {
|
|
27
|
+
if (typeof view._onCssStateChange === 'function') {
|
|
28
|
+
view._onCssStateChange();
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const className = view.className || '';
|
|
32
|
+
view.className = className + ' ';
|
|
33
|
+
view.className = className;
|
|
34
|
+
}
|
|
35
|
+
catch { }
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Restyle a root view and every modal presented over it.
|
|
39
|
+
*
|
|
40
|
+
* `seen` lets a caller iterating several Application realms skip roots it has
|
|
41
|
+
* already refreshed; it is populated as roots are visited.
|
|
42
|
+
*/
|
|
43
|
+
export function restyleRootAndModals(rootView, seen) {
|
|
44
|
+
if (!rootView)
|
|
45
|
+
return;
|
|
46
|
+
if (seen) {
|
|
47
|
+
if (seen.has(rootView))
|
|
48
|
+
return;
|
|
49
|
+
seen.add(rootView);
|
|
50
|
+
}
|
|
51
|
+
const root = rootView;
|
|
52
|
+
restyleView(root);
|
|
53
|
+
let modals = [];
|
|
54
|
+
try {
|
|
55
|
+
modals = typeof root._getRootModalViews === 'function' ? root._getRootModalViews() || [] : [];
|
|
56
|
+
}
|
|
57
|
+
catch { }
|
|
58
|
+
for (const modal of modals) {
|
|
59
|
+
if (seen) {
|
|
60
|
+
if (seen.has(modal))
|
|
61
|
+
continue;
|
|
62
|
+
seen.add(modal);
|
|
63
|
+
}
|
|
64
|
+
restyleView(modal);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=restyle-roots.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"restyle-roots.js","sourceRoot":"","sources":["../../../../../../packages/vite/hmr/shared/runtime/restyle-roots.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AASH;;;;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C;IACjC,CAAC;AACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const Fragment:
|
|
2
|
-
export declare function jsx(type: any, config: any, maybeKey?: any):
|
|
3
|
-
export declare function jsxs(type: any, config: any, maybeKey?: any):
|
|
4
|
-
export declare function jsxDEV(type: any, config: any, maybeKey?: any):
|
|
1
|
+
export declare const Fragment: any;
|
|
2
|
+
export declare function jsx(type: any, config: any, maybeKey?: any): any;
|
|
3
|
+
export declare function jsxs(type: any, config: any, maybeKey?: any): any;
|
|
4
|
+
export declare function jsxDEV(type: any, config: any, maybeKey?: any): any;
|