one 1.1.298 → 1.1.300
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/cleanUrl.js +1 -1
- package/dist/cjs/cleanUrl.js.map +1 -1
- package/dist/cjs/cleanUrl.native.js +1 -1
- package/dist/cjs/cleanUrl.native.js.map +1 -1
- package/dist/cjs/cli/runAndroid.js +34 -0
- package/dist/cjs/cli/runAndroid.js.map +6 -0
- package/dist/cjs/cli/runAndroid.native.js +39 -0
- package/dist/cjs/cli/runAndroid.native.js.map +6 -0
- package/dist/cjs/cli/runIos.js +34 -0
- package/dist/cjs/cli/runIos.js.map +6 -0
- package/dist/cjs/cli/runIos.native.js +39 -0
- package/dist/cjs/cli/runIos.native.js.map +6 -0
- package/dist/cjs/cli.js +23 -1
- package/dist/cjs/cli.js.map +1 -1
- package/dist/cjs/cli.native.js +25 -1
- package/dist/cjs/cli.native.js.map +2 -2
- package/dist/cjs/createHandleRequest.js +2 -2
- package/dist/cjs/createHandleRequest.js.map +1 -1
- package/dist/cjs/createHandleRequest.native.js +2 -2
- package/dist/cjs/createHandleRequest.native.js.map +2 -2
- package/dist/cjs/vite/createFileSystemRouter.js +1 -1
- package/dist/cjs/vite/createFileSystemRouter.js.map +1 -1
- package/dist/cjs/vite/createFileSystemRouter.native.js +1 -1
- package/dist/cjs/vite/createFileSystemRouter.native.js.map +1 -1
- package/dist/cjs/vite/replaceLoader.js +7 -1
- package/dist/cjs/vite/replaceLoader.js.map +1 -1
- package/dist/cjs/vite/replaceLoader.native.js +7 -1
- package/dist/cjs/vite/replaceLoader.native.js.map +1 -1
- package/dist/esm/Root.native.js +110 -104
- package/dist/esm/Root.native.js.map +6 -1
- package/dist/esm/Route.native.js +12 -10
- package/dist/esm/Route.native.js.map +6 -1
- package/dist/esm/cleanUrl.js +1 -1
- package/dist/esm/cleanUrl.js.map +1 -1
- package/dist/esm/cleanUrl.mjs +1 -1
- package/dist/esm/cleanUrl.mjs.map +1 -1
- package/dist/esm/cleanUrl.native.js +13 -14
- package/dist/esm/cleanUrl.native.js.map +6 -1
- package/dist/esm/cli/label-process.native.js +5 -4
- package/dist/esm/cli/label-process.native.js.map +6 -1
- package/dist/esm/cli/main.native.js +8 -13
- package/dist/esm/cli/main.native.js.map +6 -1
- package/dist/esm/cli/prebuild.native.js +5 -5
- package/dist/esm/cli/prebuild.native.js.map +6 -1
- package/dist/esm/cli/run.native.js +21 -28
- package/dist/esm/cli/run.native.js.map +6 -1
- package/dist/esm/cli/runAndroid.js +10 -0
- package/dist/esm/cli/runAndroid.js.map +6 -0
- package/dist/esm/cli/runAndroid.mjs +10 -0
- package/dist/esm/cli/runAndroid.mjs.map +1 -0
- package/dist/esm/cli/runAndroid.native.js +10 -0
- package/dist/esm/cli/runAndroid.native.js.map +6 -0
- package/dist/esm/cli/runIos.js +10 -0
- package/dist/esm/cli/runIos.js.map +6 -0
- package/dist/esm/cli/runIos.mjs +10 -0
- package/dist/esm/cli/runIos.mjs.map +1 -0
- package/dist/esm/cli/runIos.native.js +10 -0
- package/dist/esm/cli/runIos.native.js.map +6 -0
- package/dist/esm/cli.js +23 -1
- package/dist/esm/cli.js.map +1 -1
- package/dist/esm/cli.mjs +33 -1
- package/dist/esm/cli.mjs.map +1 -1
- package/dist/esm/cli.native.js +143 -148
- package/dist/esm/cli.native.js.map +6 -1
- package/dist/esm/clientLoaderResolver.native.js +9 -6
- package/dist/esm/clientLoaderResolver.native.js.map +6 -1
- package/dist/esm/config.native.js +12 -11
- package/dist/esm/config.native.js.map +6 -1
- package/dist/esm/constants.native.js +7 -5
- package/dist/esm/constants.native.js.map +6 -1
- package/dist/esm/createApp.native.js +13 -9
- package/dist/esm/createApp.native.js.map +6 -1
- package/dist/esm/createHandleRequest.js +2 -2
- package/dist/esm/createHandleRequest.js.map +1 -1
- package/dist/esm/createHandleRequest.mjs +2 -2
- package/dist/esm/createHandleRequest.mjs.map +1 -1
- package/dist/esm/createHandleRequest.native.js +57 -66
- package/dist/esm/createHandleRequest.native.js.map +6 -1
- package/dist/esm/createRoute.native.js +16 -16
- package/dist/esm/createRoute.native.js.map +6 -1
- package/dist/esm/fallbackViews/Sitemap.native.js +6 -3
- package/dist/esm/fallbackViews/Sitemap.native.js.map +6 -1
- package/dist/esm/fallbackViews/Unmatched.native.js +5 -3
- package/dist/esm/fallbackViews/Unmatched.native.js.map +6 -1
- package/dist/esm/fork/NavigationContainer.native.js +24 -31
- package/dist/esm/fork/NavigationContainer.native.js.map +6 -1
- package/dist/esm/fork/createMemoryHistory.native.js +99 -115
- package/dist/esm/fork/createMemoryHistory.native.js.map +6 -1
- package/dist/esm/fork/extractPathFromURL.native.js +16 -15
- package/dist/esm/fork/extractPathFromURL.native.js.map +6 -1
- package/dist/esm/fork/findFocusedRoute.native.js +6 -5
- package/dist/esm/fork/findFocusedRoute.native.js.map +6 -1
- package/dist/esm/fork/getPathFromState.native.js +127 -140
- package/dist/esm/fork/getPathFromState.native.js.map +6 -1
- package/dist/esm/fork/getStateFromPath.native.js +292 -288
- package/dist/esm/fork/getStateFromPath.native.js.map +6 -1
- package/dist/esm/fork/useLinking.native.js +70 -61
- package/dist/esm/fork/useLinking.native.js.map +6 -1
- package/dist/esm/fork/validatePathConfig.native.js +15 -9
- package/dist/esm/fork/validatePathConfig.native.js.map +6 -1
- package/dist/esm/getLinkingConfig.native.js +11 -6
- package/dist/esm/getLinkingConfig.native.js.map +6 -1
- package/dist/esm/getReactNavigationConfig.native.js +28 -20
- package/dist/esm/getReactNavigationConfig.native.js.map +6 -1
- package/dist/esm/getRoutes.native.js +249 -229
- package/dist/esm/getRoutes.native.js.map +6 -1
- package/dist/esm/getURL.native.js +4 -4
- package/dist/esm/getURL.native.js.map +6 -1
- package/dist/esm/head/Head.android.js +5 -3
- package/dist/esm/head/Head.android.js.map +6 -1
- package/dist/esm/head/Head.ios.js +144 -132
- package/dist/esm/head/Head.ios.js.map +6 -1
- package/dist/esm/head/Head.native.js +7 -7
- package/dist/esm/head/Head.native.js.map +6 -1
- package/dist/esm/head/HeadModule.native.js +6 -6
- package/dist/esm/head/HeadModule.native.js.map +6 -1
- package/dist/esm/head/index.native.js +2 -2
- package/dist/esm/head/index.native.js.map +6 -1
- package/dist/esm/head/types.native.js +1 -2
- package/dist/esm/head/types.native.js.map +6 -1
- package/dist/esm/head/url.native.js +10 -8
- package/dist/esm/head/url.native.js.map +6 -1
- package/dist/esm/hooks.native.js +53 -34
- package/dist/esm/hooks.native.js.map +6 -1
- package/dist/esm/imperative-api.native.js +9 -6
- package/dist/esm/imperative-api.native.js.map +6 -1
- package/dist/esm/import-mode/index.android.js +4 -3
- package/dist/esm/import-mode/index.android.js.map +6 -1
- package/dist/esm/import-mode/index.ios.js +4 -3
- package/dist/esm/import-mode/index.ios.js.map +6 -1
- package/dist/esm/import-mode/index.native.js +3 -1
- package/dist/esm/import-mode/index.native.js.map +6 -1
- package/dist/esm/index.native.js +65 -27
- package/dist/esm/index.native.js.map +6 -1
- package/dist/esm/interfaces/router.native.js +4 -2
- package/dist/esm/interfaces/router.native.js.map +6 -1
- package/dist/esm/layouts/Drawer.native.js +7 -6
- package/dist/esm/layouts/Drawer.native.js.map +6 -1
- package/dist/esm/layouts/Stack.native.js +7 -6
- package/dist/esm/layouts/Stack.native.js.map +6 -1
- package/dist/esm/layouts/Tabs.native.js +42 -39
- package/dist/esm/layouts/Tabs.native.js.map +6 -1
- package/dist/esm/layouts/withLayoutContext.native.js +51 -48
- package/dist/esm/layouts/withLayoutContext.native.js.map +6 -1
- package/dist/esm/link/Link.native.js +62 -53
- package/dist/esm/link/Link.native.js.map +6 -1
- package/dist/esm/link/Redirect.native.js +8 -9
- package/dist/esm/link/Redirect.native.js.map +6 -1
- package/dist/esm/link/href.native.js +28 -27
- package/dist/esm/link/href.native.js.map +6 -1
- package/dist/esm/link/linking.native.js +51 -40
- package/dist/esm/link/linking.native.js.map +6 -1
- package/dist/esm/link/path.native.js +28 -19
- package/dist/esm/link/path.native.js.map +6 -1
- package/dist/esm/link/useLinkTo.native.js +22 -20
- package/dist/esm/link/useLinkTo.native.js.map +6 -1
- package/dist/esm/link/useLoadedNavigation.native.js +30 -23
- package/dist/esm/link/useLoadedNavigation.native.js.map +6 -1
- package/dist/esm/matchers.native.js +16 -3
- package/dist/esm/matchers.native.js.map +6 -1
- package/dist/esm/platform.native.js +4 -2
- package/dist/esm/platform.native.js.map +6 -1
- package/dist/esm/polyfills-mobile.native.js +4 -5
- package/dist/esm/polyfills-mobile.native.js.map +6 -1
- package/dist/esm/polyfills-server.native.js +1 -1
- package/dist/esm/polyfills-server.native.js.map +6 -1
- package/dist/esm/render.native.js +3 -1
- package/dist/esm/render.native.js.map +6 -1
- package/dist/esm/router/RouterStore.native.js +1 -2
- package/dist/esm/router/RouterStore.native.js.map +6 -1
- package/dist/esm/router/constants.native.js +4 -2
- package/dist/esm/router/constants.native.js.map +6 -1
- package/dist/esm/router/getNormalizedStatePath.native.js +18 -17
- package/dist/esm/router/getNormalizedStatePath.native.js.map +6 -1
- package/dist/esm/router/lastAction.native.js +10 -9
- package/dist/esm/router/lastAction.native.js.map +6 -1
- package/dist/esm/router/router.native.js +135 -114
- package/dist/esm/router/router.native.js.map +6 -1
- package/dist/esm/router/serverLocationContext.native.js +4 -2
- package/dist/esm/router/serverLocationContext.native.js.map +6 -1
- package/dist/esm/router/useInitializeOneRouter.native.js +8 -5
- package/dist/esm/router/useInitializeOneRouter.native.js.map +6 -1
- package/dist/esm/serve.native.js +77 -104
- package/dist/esm/serve.native.js.map +6 -1
- package/dist/esm/server/createRoutesManifest.native.js +14 -11
- package/dist/esm/server/createRoutesManifest.native.js.map +6 -1
- package/dist/esm/server/getServerManifest.native.js +61 -67
- package/dist/esm/server/getServerManifest.native.js.map +6 -1
- package/dist/esm/server-render.native.js +9 -10
- package/dist/esm/server-render.native.js.map +6 -1
- package/dist/esm/sortRoutes.native.js +27 -17
- package/dist/esm/sortRoutes.native.js.map +6 -1
- package/dist/esm/typed-routes/generateRouteTypes.native.js +10 -11
- package/dist/esm/typed-routes/generateRouteTypes.native.js.map +6 -1
- package/dist/esm/typed-routes/getTypedRoutesDeclarationFile.native.js +38 -37
- package/dist/esm/typed-routes/getTypedRoutesDeclarationFile.native.js.map +6 -1
- package/dist/esm/types.native.js +1 -2
- package/dist/esm/types.native.js.map +6 -1
- package/dist/esm/useFocusEffect.native.js +25 -22
- package/dist/esm/useFocusEffect.native.js.map +6 -1
- package/dist/esm/useLoader.native.js +50 -50
- package/dist/esm/useLoader.native.js.map +6 -1
- package/dist/esm/useNavigation.native.js +23 -19
- package/dist/esm/useNavigation.native.js.map +6 -1
- package/dist/esm/useScreens.native.js +143 -160
- package/dist/esm/useScreens.native.js.map +6 -1
- package/dist/esm/useViteRoutes.native.js +25 -28
- package/dist/esm/useViteRoutes.native.js.map +6 -1
- package/dist/esm/utils/assertIsReady.native.js +6 -3
- package/dist/esm/utils/assertIsReady.native.js.map +6 -1
- package/dist/esm/utils/dynamicImport.native.js +5 -3
- package/dist/esm/utils/dynamicImport.native.js.map +6 -1
- package/dist/esm/utils/existsAsync.native.js +6 -4
- package/dist/esm/utils/existsAsync.native.js.map +6 -1
- package/dist/esm/utils/getPageExport.native.js +12 -11
- package/dist/esm/utils/getPageExport.native.js.map +6 -1
- package/dist/esm/utils/globDir.native.js +5 -3
- package/dist/esm/utils/globDir.native.js.map +6 -1
- package/dist/esm/utils/hashString.native.js +4 -2
- package/dist/esm/utils/hashString.native.js.map +6 -1
- package/dist/esm/utils/isResponse.native.js +4 -2
- package/dist/esm/utils/isResponse.native.js.map +6 -1
- package/dist/esm/utils/isStatus.native.js +4 -2
- package/dist/esm/utils/isStatus.native.js.map +6 -1
- package/dist/esm/utils/promiseWithResolvers.native.js +7 -7
- package/dist/esm/utils/promiseWithResolvers.native.js.map +6 -1
- package/dist/esm/utils/rand.native.js +5 -3
- package/dist/esm/utils/rand.native.js.map +6 -1
- package/dist/esm/utils/redirect.native.js +7 -5
- package/dist/esm/utils/redirect.native.js.map +6 -1
- package/dist/esm/utils/removeSearch.native.js +4 -2
- package/dist/esm/utils/removeSearch.native.js.map +6 -1
- package/dist/esm/utils/removeUndefined.native.js +6 -3
- package/dist/esm/utils/removeUndefined.native.js.map +6 -1
- package/dist/esm/utils/requireResolve.native.js +4 -2
- package/dist/esm/utils/requireResolve.native.js.map +6 -1
- package/dist/esm/utils/url.native.js +6 -2
- package/dist/esm/utils/url.native.js.map +6 -1
- package/dist/esm/utils/weakKey.native.js +11 -10
- package/dist/esm/utils/weakKey.native.js.map +6 -1
- package/dist/esm/utils/weakMemo.native.js +8 -8
- package/dist/esm/utils/weakMemo.native.js.map +6 -1
- package/dist/esm/views/EmptyRoute.native.js +5 -3
- package/dist/esm/views/EmptyRoute.native.js.map +6 -1
- package/dist/esm/views/ErrorBoundary.native.js +5 -8
- package/dist/esm/views/ErrorBoundary.native.js.map +6 -1
- package/dist/esm/views/LoadProgressBar.native.js +58 -57
- package/dist/esm/views/LoadProgressBar.native.js.map +6 -1
- package/dist/esm/views/Navigator.native.js +54 -71
- package/dist/esm/views/Navigator.native.js.map +6 -1
- package/dist/esm/views/PreloadLinks.native.js +3 -1
- package/dist/esm/views/PreloadLinks.native.js.map +6 -1
- package/dist/esm/views/RootErrorBoundary.native.js +39 -29
- package/dist/esm/views/RootErrorBoundary.native.js.map +6 -1
- package/dist/esm/views/Screen.native.js +12 -12
- package/dist/esm/views/Screen.native.js.map +6 -1
- package/dist/esm/views/ScrollRestoration.native.js +27 -27
- package/dist/esm/views/ScrollRestoration.native.js.map +6 -1
- package/dist/esm/views/Try.native.js +40 -37
- package/dist/esm/views/Try.native.js.map +6 -1
- package/dist/esm/vite/build.native.js +260 -295
- package/dist/esm/vite/build.native.js.map +6 -1
- package/dist/esm/vite/clientTreeShakePlugin.native.js +34 -33
- package/dist/esm/vite/clientTreeShakePlugin.native.js.map +6 -1
- package/dist/esm/vite/constants.native.js +6 -4
- package/dist/esm/vite/constants.native.js.map +6 -1
- package/dist/esm/vite/createFileSystemRouter.js +1 -1
- package/dist/esm/vite/createFileSystemRouter.js.map +1 -1
- package/dist/esm/vite/createFileSystemRouter.mjs +1 -1
- package/dist/esm/vite/createFileSystemRouter.mjs.map +1 -1
- package/dist/esm/vite/createFileSystemRouter.native.js +100 -131
- package/dist/esm/vite/createFileSystemRouter.native.js.map +6 -1
- package/dist/esm/vite/customNodeExternals.native.js +9 -10
- package/dist/esm/vite/customNodeExternals.native.js.map +6 -1
- package/dist/esm/vite/ensureTsConfig.native.js +7 -5
- package/dist/esm/vite/ensureTsConfig.native.js.map +6 -1
- package/dist/esm/vite/findDepsToOptimize.native.js +27 -19
- package/dist/esm/vite/findDepsToOptimize.native.js.map +6 -1
- package/dist/esm/vite/fixDependenciesPlugin.native.js +5 -3
- package/dist/esm/vite/fixDependenciesPlugin.native.js.map +6 -1
- package/dist/esm/vite/generateTypesForRoutes.native.js +9 -9
- package/dist/esm/vite/generateTypesForRoutes.native.js.map +6 -1
- package/dist/esm/vite/getManifest.native.js +6 -4
- package/dist/esm/vite/getManifest.native.js.map +6 -1
- package/dist/esm/vite/headers.native.js +11 -5
- package/dist/esm/vite/headers.native.js.map +6 -1
- package/dist/esm/vite/loadEnv.native.js +7 -6
- package/dist/esm/vite/loadEnv.native.js.map +6 -1
- package/dist/esm/vite/makePluginWebOnly.native.js +9 -5
- package/dist/esm/vite/makePluginWebOnly.native.js.map +6 -1
- package/dist/esm/vite/one.native.js +142 -127
- package/dist/esm/vite/one.native.js.map +6 -1
- package/dist/esm/vite/removeReactNativeWebAnimatedPlugin.native.js +14 -11
- package/dist/esm/vite/removeReactNativeWebAnimatedPlugin.native.js.map +6 -1
- package/dist/esm/vite/replaceLoader.js +7 -1
- package/dist/esm/vite/replaceLoader.js.map +1 -1
- package/dist/esm/vite/replaceLoader.mjs +5 -1
- package/dist/esm/vite/replaceLoader.mjs.map +1 -1
- package/dist/esm/vite/replaceLoader.native.js +13 -10
- package/dist/esm/vite/replaceLoader.native.js.map +6 -1
- package/dist/esm/vite/resolveAPIRequest.native.js +44 -47
- package/dist/esm/vite/resolveAPIRequest.native.js.map +6 -1
- package/dist/esm/vite/server.native.js +5 -4
- package/dist/esm/vite/server.native.js.map +6 -1
- package/dist/esm/vite/types.native.js +1 -2
- package/dist/esm/vite/types.native.js.map +6 -1
- package/dist/esm/vite/virtualEntryPlugin.native.js +21 -16
- package/dist/esm/vite/virtualEntryPlugin.native.js.map +6 -1
- package/dist/esm/vite/vitePluginSsrCss.native.js +61 -50
- package/dist/esm/vite/vitePluginSsrCss.native.js.map +6 -1
- package/dist/esm/vite.native.js +19 -10
- package/dist/esm/vite.native.js.map +6 -1
- package/dist/esm/zero/getQueryKey.native.js +5 -3
- package/dist/esm/zero/getQueryKey.native.js.map +6 -1
- package/dist/esm/zero/isZeroQuery.native.js +4 -2
- package/dist/esm/zero/isZeroQuery.native.js.map +6 -1
- package/dist/esm/zero/resolveQuery.native.js +9 -8
- package/dist/esm/zero/resolveQuery.native.js.map +6 -1
- package/dist/esm/zero/subscribeToQuery.native.js +5 -3
- package/dist/esm/zero/subscribeToQuery.native.js.map +6 -1
- package/dist/esm/zero/types.native.js +1 -2
- package/dist/esm/zero/types.native.js.map +6 -1
- package/dist/esm/zero/useQuery.native.js +12 -12
- package/dist/esm/zero/useQuery.native.js.map +6 -1
- package/dist/esm/zero/useQueryZero.native.js +24 -20
- package/dist/esm/zero/useQueryZero.native.js.map +6 -1
- package/dist/esm/zero.native.js +9 -5
- package/dist/esm/zero.native.js.map +6 -1
- package/package.json +7 -7
- package/src/cleanUrl.ts +1 -1
- package/src/cli/runAndroid.ts +6 -0
- package/src/cli/runIos.ts +6 -0
- package/src/cli.ts +27 -1
- package/src/createHandleRequest.ts +7 -0
- package/src/vite/createFileSystemRouter.tsx +1 -2
- package/src/vite/replaceLoader.ts +7 -1
- package/types/cli/runAndroid.d.ts +2 -0
- package/types/cli/runAndroid.d.ts.map +1 -0
- package/types/cli/runIos.d.ts +2 -0
- package/types/cli/runIos.d.ts.map +1 -0
- package/types/createHandleRequest.d.ts.map +1 -1
- package/types/vite/createFileSystemRouter.d.ts.map +1 -1
- package/types/vite/replaceLoader.d.ts.map +1 -1
@@ -3,7 +3,11 @@ function replaceLoader({
|
|
3
3
|
loaderData
|
4
4
|
}) {
|
5
5
|
const stringifiedData = JSON.stringify(loaderData);
|
6
|
-
return code.includes("__vxrn__loader__") ? code.replace(/["']__vxrn__loader__['"]/,
|
6
|
+
return code.includes("__vxrn__loader__") ? code.replace(/["']__vxrn__loader__['"]/,
|
7
|
+
// make sure this ' ' is added in front,
|
8
|
+
// minifiers will do `return"something"
|
9
|
+
// but if its null then it becomes returnnull
|
10
|
+
" " + stringifiedData.replace(/\$/g, "$$$$")) : code + `
|
7
11
|
export const loader = () => (${stringifiedData})`;
|
8
12
|
}
|
9
13
|
export { replaceLoader };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["replaceLoader","code","loaderData","stringifiedData","JSON","stringify","includes","replace"],"sources":["../../../src/vite/replaceLoader.ts"],"sourcesContent":[null],"mappings":"AAAO,SAASA,cAAc;EAC5BC,IAAA;EACAC;AACF,GAGG;EACD,MAAMC,eAAA,GAAkBC,IAAA,CAAKC,SAAA,CAAUH,UAAU;
|
1
|
+
{"version":3,"names":["replaceLoader","code","loaderData","stringifiedData","JSON","stringify","includes","replace"],"sources":["../../../src/vite/replaceLoader.ts"],"sourcesContent":[null],"mappings":"AAAO,SAASA,cAAc;EAC5BC,IAAA;EACAC;AACF,GAGG;EACD,MAAMC,eAAA,GAAkBC,IAAA,CAAKC,SAAA,CAAUH,UAAU;EAejD,OAZOD,IAAA,CAAKK,QAAA,CAAS,kBAAkB,IAG9BL,IAAA,CAAKM,OAAA,CACV;EAAA;EAAA;EAAA;EAIA,MAAMJ,eAAA,CAAgBI,OAAA,CAAQ,OAAO,MAAM,CAC7C,IARSN,IAAA,GAAO;AAAA,+BAAkCE,eAAe;AAYrE","ignoreList":[]}
|
@@ -1,14 +1,17 @@
|
|
1
1
|
function replaceLoader(param) {
|
2
|
-
var {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
2
|
+
var { code, loaderData } = param, stringifiedData = JSON.stringify(loaderData), out = function() {
|
3
|
+
return code.includes("__vxrn__loader__") ? code.replace(
|
4
|
+
/["']__vxrn__loader__['"]/,
|
5
|
+
// make sure this ' ' is added in front,
|
6
|
+
// minifiers will do `return"something"
|
7
|
+
// but if its null then it becomes returnnull
|
8
|
+
" " + stringifiedData.replace(/\$/g, "$$$$")
|
9
|
+
) : code + `
|
9
10
|
export const loader = () => (${stringifiedData})`;
|
10
|
-
|
11
|
+
}();
|
11
12
|
return out;
|
12
13
|
}
|
13
|
-
export {
|
14
|
-
|
14
|
+
export {
|
15
|
+
replaceLoader
|
16
|
+
};
|
17
|
+
//# sourceMappingURL=replaceLoader.js.map
|
@@ -1 +1,6 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../src/vite/Users/n8/one/packages/one/src/vite/replaceLoader.ts"],
|
4
|
+
"mappings": "AAAO,SAASA,cAAc,OAM7B;MAN6B,EAC5BC,MACAC,WAAU,IAFkB,OAOtBC,kBAAkBC,KAAKC,UAAUH,UAAAA,GAEjCI,MAAO,WAAA;AACX,WAAKL,KAAKM,SAAS,kBAAA,IAGZN,KAAKO;MACV;;;;MAIA,MAAML,gBAAgBK,QAAQ,OAAO,MAAA;IAAA,IAP9BP,OAAO;+BAAkCE,eAAAA;EASpD,EAAA;AAEA,SAAOG;AACT;",
|
5
|
+
"names": ["replaceLoader", "code", "loaderData", "stringifiedData", "JSON", "stringify", "out", "includes", "replace"]
|
6
|
+
}
|
@@ -1,56 +1,51 @@
|
|
1
|
-
import { isResponse } from "../utils/isResponse
|
2
|
-
import { asyncHeadersCache, mergeHeaders, requestAsyncLocalStore } from "./headers
|
1
|
+
import { isResponse } from "../utils/isResponse";
|
2
|
+
import { asyncHeadersCache, mergeHeaders, requestAsyncLocalStore } from "./headers";
|
3
3
|
function resolveAPIRequest(asyncImport, request, params) {
|
4
|
-
if (asyncImport)
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
requestType = request.method || "GET",
|
12
|
-
handler
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
var response = await handler(request, {
|
4
|
+
if (asyncImport)
|
5
|
+
return new Promise(function(res, rej) {
|
6
|
+
var id = {
|
7
|
+
_id: Math.random()
|
8
|
+
};
|
9
|
+
requestAsyncLocalStore.run(id, async function() {
|
10
|
+
try {
|
11
|
+
var imported = await asyncImport(), requestType = request.method || "GET", handler = imported[requestType] || imported.default;
|
12
|
+
if (!handler) {
|
13
|
+
console.warn(`No handler found for request ${requestType}`);
|
14
|
+
return;
|
15
|
+
}
|
16
|
+
var response = await handler(request, {
|
18
17
|
params
|
19
|
-
}),
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
18
|
+
}), asyncHeaders = asyncHeadersCache.get(id);
|
19
|
+
if (asyncHeaders)
|
20
|
+
try {
|
21
|
+
response instanceof Response ? mergeHeaders(response.headers, asyncHeaders) : response && typeof response == "object" ? response = Response.json(response, {
|
22
|
+
headers: asyncHeaders
|
23
|
+
}) : response = new Response(response, {
|
24
|
+
headers: asyncHeaders
|
25
|
+
});
|
26
|
+
} catch (err) {
|
27
|
+
if (`${err}`.includes("immutable")) {
|
28
|
+
var body = response.body ? await streamToString(response.body) : "";
|
29
|
+
response = new Response(body, {
|
30
|
+
headers: response.headers,
|
31
|
+
status: response.status,
|
32
|
+
statusText: response.statusText
|
33
|
+
}), mergeHeaders(response.headers, asyncHeaders);
|
34
|
+
} else
|
35
|
+
console.error(` [one] error adding headers: ${err}`);
|
36
|
+
}
|
37
|
+
res(response);
|
27
38
|
} catch (err) {
|
28
|
-
|
29
|
-
var body = response.body ? await streamToString(response.body) : "";
|
30
|
-
response = new Response(body, {
|
31
|
-
headers: response.headers,
|
32
|
-
status: response.status,
|
33
|
-
statusText: response.statusText
|
34
|
-
}), mergeHeaders(response.headers, asyncHeaders);
|
35
|
-
} else console.error(` [one] error adding headers: ${err}`);
|
39
|
+
isResponse(err) ? res(err) : rej(err);
|
36
40
|
}
|
37
|
-
|
38
|
-
} catch (err) {
|
39
|
-
isResponse(err) ? res(err) : rej(err);
|
40
|
-
}
|
41
|
+
});
|
41
42
|
});
|
42
|
-
});
|
43
43
|
}
|
44
44
|
async function streamToString(stream) {
|
45
|
-
var reader = stream.getReader(),
|
46
|
-
decoder = new TextDecoder(),
|
47
|
-
result = "";
|
45
|
+
var reader = stream.getReader(), decoder = new TextDecoder(), result = "";
|
48
46
|
try {
|
49
|
-
for (
|
50
|
-
var {
|
51
|
-
done,
|
52
|
-
value
|
53
|
-
} = await reader.read();
|
47
|
+
for (; ; ) {
|
48
|
+
var { done, value } = await reader.read();
|
54
49
|
if (done) break;
|
55
50
|
result += decoder.decode(value, {
|
56
51
|
stream: !0
|
@@ -63,5 +58,7 @@ async function streamToString(stream) {
|
|
63
58
|
}
|
64
59
|
return result;
|
65
60
|
}
|
66
|
-
export {
|
67
|
-
|
61
|
+
export {
|
62
|
+
resolveAPIRequest
|
63
|
+
};
|
64
|
+
//# sourceMappingURL=resolveAPIRequest.js.map
|
@@ -1 +1,6 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../src/vite/Users/n8/one/packages/one/src/vite/resolveAPIRequest.ts"],
|
4
|
+
"mappings": "AAAA,SAASA,kBAAkB;AAC3B,SAASC,mBAAmBC,cAAcC,8BAA8B;AAEjE,SAASC,kBACdC,aACAC,SACAC,QAA8B;AAE9B,MAAKF;AAEL,WAAO,IAAIG,QAAQ,SAACC,KAAKC,KAAAA;AACvB,UAAMC,KAAK;QAAEC,KAAKC,KAAKC,OAAM;MAAG;AAChCX,6BAAuBY,IAAIJ,IAAI,iBAAA;AAC7B,YAAI;AACF,cAAMK,WAAW,MAAMX,YAAAA,GACjBY,cAAcX,QAAQY,U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OAAO;AACdd,YAAQc,MAAM,6BAA6BA,KAAAA;EAC7C,UAAA;AACEE,WAAOS,YAAW;EACpB;AAEA,SAAOL;AACT;",
|
5
|
+
"names": ["isResponse", "asyncHeadersCache", "mergeHeaders", "requestAsyncLocalStore", "resolveAPIRequest", "asyncImport", "request", "params", "Promise", "res", "rej", "id", "_id", "Math", "random", "run", "imported", "requestType", "method", "handler", "default", "console", "warn", "response", "asyncHeaders", "get", "Response", "headers", "json", "err", "includes", "body", "streamToString", "status", "statusText", "error", "stream", "reader", "getReader", "decoder", "TextDecoder", "result", "done", "value", "read", "decode", "releaseLock"]
|
6
|
+
}
|
@@ -1,17 +1,18 @@
|
|
1
1
|
import { parentPort } from "node:worker_threads";
|
2
2
|
import { fileURLToPath } from "node:url";
|
3
3
|
import { ESModulesEvaluator, ModuleRunner, RemoteRunnerTransport } from "vite/module-runner";
|
4
|
-
if (!parentPort)
|
4
|
+
if (!parentPort)
|
5
|
+
throw new Error("No parent port");
|
5
6
|
var runner = new ModuleRunner({
|
6
7
|
root: fileURLToPath(new URL("./", import.meta.url)),
|
7
8
|
transport: new RemoteRunnerTransport({
|
8
|
-
send: function
|
9
|
+
send: function(data) {
|
9
10
|
return parentPort.postMessage(data);
|
10
11
|
},
|
11
|
-
onMessage: function
|
12
|
+
onMessage: function(listener) {
|
12
13
|
return parentPort.on("message", listener);
|
13
14
|
},
|
14
15
|
timeout: 5e3
|
15
16
|
})
|
16
17
|
}, new ESModulesEvaluator());
|
17
|
-
//# sourceMappingURL=server.
|
18
|
+
//# sourceMappingURL=server.js.map
|
@@ -1 +1,6 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../src/vite/Users/n8/one/packages/one/src/vite/server.ts"],
|
4
|
+
"mappings": "AAAA,SAASA,kBAAkB;AAC3B,SAASC,qBAAqB;AAC9B,SAASC,oBAAoBC,cAAcC,6BAA6B;AAExE,IAAI,CAACJ;AACH,QAAM,IAAIK,MAAM,gBAAgB;AAGlC,IAAMC,SAAS,IAAIH,aACjB;EACEI,MAAMN,cAAc,IAAIO,IAAI,MAAM,YAAYC,GAAG,CAAA;EACjDC,WAAW,IAAIN,sBAAsB;IACnCO,MAAM,SAACC,MAAAA;aAASZ,WAAYa,YAAYD,IAAAA;;IACxCE,WAAW,SAACC,UAAAA;aAAaf,WAAYgB,GAAG,WAAWD,QAAAA;;IACnDE,SAAS;EACX,CAAA;AACF,GACA,IAAIf,mBAAAA,CAAAA;",
|
5
|
+
"names": ["parentPort", "fileURLToPath", "ESModulesEvaluator", "ModuleRunner", "RemoteRunnerTransport", "Error", "runner", "root", "URL", "url", "transport", "send", "data", "postMessage", "onMessage", "listener", "on", "timeout"]
|
6
|
+
}
|
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
//# sourceMappingURL=types.native.js.map
|
1
|
+
//# sourceMappingURL=types.js.map
|
@@ -1,12 +1,5 @@
|
|
1
1
|
import { isNativeEnvironment } from "vxrn";
|
2
|
-
var virtualEntryIdName = "one-entry",
|
3
|
-
virtualEntryId = `virtual:${virtualEntryIdName}`,
|
4
|
-
virtalEntryIdClient = `/@id/__x00__virtual:${virtualEntryIdName}`,
|
5
|
-
resolvedVirtualEntryId = "\0" + virtualEntryId,
|
6
|
-
virtualEntryIdNativeName = `${virtualEntryIdName}-native`,
|
7
|
-
virtualEntryIdNative = `virtual:${virtualEntryIdNativeName}`,
|
8
|
-
resolvedVirtualEntryIdNative = "\0" + virtualEntryIdNativeName,
|
9
|
-
USE_One_SETUP_FILE = `
|
2
|
+
var virtualEntryIdName = "one-entry", virtualEntryId = `virtual:${virtualEntryIdName}`, virtalEntryIdClient = `/@id/__x00__virtual:${virtualEntryIdName}`, resolvedVirtualEntryId = "\0" + virtualEntryId, virtualEntryIdNativeName = `${virtualEntryIdName}-native`, virtualEntryIdNative = `virtual:${virtualEntryIdNativeName}`, resolvedVirtualEntryIdNative = "\0" + virtualEntryIdNativeName, USE_One_SETUP_FILE = `
|
10
3
|
if (process.env.One_SETUP_FILE) {
|
11
4
|
import(/* @vite-ignore */ process.env.One_SETUP_FILE)
|
12
5
|
}
|
@@ -17,13 +10,17 @@ function createVirtualEntry(options) {
|
|
17
10
|
name: "one-virtual-entry",
|
18
11
|
enforce: "pre",
|
19
12
|
resolveId(id) {
|
20
|
-
if (id === virtualEntryId)
|
21
|
-
|
13
|
+
if (id === virtualEntryId)
|
14
|
+
return resolvedVirtualEntryId;
|
15
|
+
if (id === virtualEntryIdNative)
|
16
|
+
return resolvedVirtualEntryIdNative;
|
22
17
|
},
|
23
18
|
load(id) {
|
24
19
|
if (id === resolvedVirtualEntryId) {
|
25
|
-
var prependCode = isNativeEnvironment(this.environment) ? "" : (
|
26
|
-
|
20
|
+
var prependCode = isNativeEnvironment(this.environment) ? "" : (
|
21
|
+
/* `import()` will not work on native */
|
22
|
+
USE_One_SETUP_FILE
|
23
|
+
);
|
27
24
|
return `
|
28
25
|
${prependCode}
|
29
26
|
|
@@ -36,8 +33,10 @@ export default createApp({
|
|
36
33
|
`;
|
37
34
|
}
|
38
35
|
if (id === resolvedVirtualEntryIdNative) {
|
39
|
-
var prependCode1 = isNativeEnvironment(this.environment) ? "" : (
|
40
|
-
|
36
|
+
var prependCode1 = isNativeEnvironment(this.environment) ? "" : (
|
37
|
+
/* `import()` will not work on native */
|
38
|
+
USE_One_SETUP_FILE
|
39
|
+
);
|
41
40
|
return `
|
42
41
|
${prependCode1}
|
43
42
|
|
@@ -52,5 +51,11 @@ export default createApp({
|
|
52
51
|
}
|
53
52
|
};
|
54
53
|
}
|
55
|
-
export {
|
56
|
-
|
54
|
+
export {
|
55
|
+
createVirtualEntry,
|
56
|
+
virtalEntryIdClient,
|
57
|
+
virtualEntryId,
|
58
|
+
virtualEntryIdName,
|
59
|
+
virtualEntryIdNative
|
60
|
+
};
|
61
|
+
//# sourceMappingURL=virtualEntryPlugin.js.map
|
@@ -1 +1,6 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../src/vite/Users/n8/one/packages/one/src/vite/virtualEntryPlugin.ts"],
|
4
|
+
"mappings": "AACA,SAASA,2BAA2B;AAE7B,IAAMC,qBAAqB,aACrBC,iBAAiB,WAAWD,kBAAAA,IAC5BE,sBAAsB,uBAAuBF,kBAAAA,IACpDG,yBAAyB,OAAOF,gBAEhCG,2BAA2B,GAAGJ,kBAAAA,WACvBK,uBAAuB,WAAWD,wBAAAA,IACzCE,+BAA+B,OAAOF,0BAEtCG,qBAAqB;;;;;AAMpB,SAASC,mBAAmBC,SAAyB;AAC1D,MAAMC,aAAa,IAAID,QAAQE,IAAI;AAEnC,SAAO;IACLC,MAAM;IACNC,SAAS;IAETC,UAAUC,IAAE;AACV,UAAIA,OAAOd;AACT,eAAOE;AAET,UAAIY,OAAOV;AACT,eAAOC;IAEX;IAEAU,KAAKD,IAAE;AACL,UAAIA,OAAOZ,wBAAwB;AACjC,YAAMc,cAAclB,oBAAoB,KAAKmB,WAAW,IACpD;;UACAX;;AACJ,eAAO;EACbU,WAAAA;;;;cAIYP,UAAAA;;8BAEgBA,UAAAA;;;MAGxB;AAEA,UAAIK,OAAOT,8BAA8B;AACvC,YAAMW,eAAclB,oBAAoB,KAAKmB,WAAW,IACpD;;UACAX;;AACJ,eAAO;EACbU,YAAAA;;;;cAIYP,UAAAA;;8BAEgBA,UAAAA;;;MAGxB;IACF;EACF;AACF;",
|
5
|
+
"names": ["isNativeEnvironment", "virtualEntryIdName", "virtualEntryId", "virtalEntryIdClient", "resolvedVirtualEntryId", "virtualEntryIdNativeName", "virtualEntryIdNative", "resolvedVirtualEntryIdNative", "USE_One_SETUP_FILE", "createVirtualEntry", "options", "appDirGlob", "root", "name", "enforce", "resolveId", "id", "load", "prependCode", "environment"]
|
6
|
+
}
|
@@ -1,12 +1,11 @@
|
|
1
1
|
var VIRTUAL_ENTRY = "virtual:ssr-css.css";
|
2
2
|
function vitePluginSsrCss(pluginOpts) {
|
3
|
-
var server,
|
4
|
-
virtualHref = "/@id/__x00__" + VIRTUAL_ENTRY;
|
3
|
+
var server, virtualHref = "/@id/__x00__" + VIRTUAL_ENTRY;
|
5
4
|
return {
|
6
5
|
name: "vite-plugin-ssr-css",
|
7
6
|
apply: "serve",
|
8
7
|
configureServer(server_) {
|
9
|
-
server = server_, server.middlewares.use(async function
|
8
|
+
server = server_, server.middlewares.use(async function(req, res, next) {
|
10
9
|
var _req_url;
|
11
10
|
if (!((_req_url = req.url) === null || _req_url === void 0) && _req_url.includes(virtualHref)) {
|
12
11
|
invalidateModule(server, "\0" + VIRTUAL_ENTRY + "?direct");
|
@@ -24,30 +23,32 @@ function vitePluginSsrCss(pluginOpts) {
|
|
24
23
|
},
|
25
24
|
async load(id, _options) {
|
26
25
|
if (id.startsWith("\0" + VIRTUAL_ENTRY)) {
|
27
|
-
var url = new URL(id.slice(1), "https://test.local"),
|
28
|
-
code = await collectStyle(server, pluginOpts.entries);
|
26
|
+
var url = new URL(id.slice(1), "https://test.local"), code = await collectStyle(server, pluginOpts.entries);
|
29
27
|
return url.searchParams.has("direct") || (code = `export default ${JSON.stringify(code)}`), code;
|
30
28
|
}
|
31
29
|
},
|
32
30
|
// also expose via transformIndexHtml
|
33
31
|
transformIndexHtml: {
|
34
|
-
handler: async function
|
35
|
-
return [
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
tag: "script",
|
45
|
-
injectTo: "head",
|
46
|
-
attrs: {
|
47
|
-
type: "module"
|
32
|
+
handler: async function() {
|
33
|
+
return [
|
34
|
+
{
|
35
|
+
tag: "link",
|
36
|
+
injectTo: "head",
|
37
|
+
attrs: {
|
38
|
+
rel: "stylesheet",
|
39
|
+
href: virtualHref,
|
40
|
+
"data-ssr-css": !0
|
41
|
+
}
|
48
42
|
},
|
49
|
-
|
50
|
-
|
43
|
+
{
|
44
|
+
tag: "script",
|
45
|
+
injectTo: "head",
|
46
|
+
attrs: {
|
47
|
+
type: "module"
|
48
|
+
},
|
49
|
+
children: (
|
50
|
+
/* js */
|
51
|
+
`
|
51
52
|
import { createHotContext } from "/@vite/client";
|
52
53
|
const hot = createHotContext("/__clear_ssr_css");
|
53
54
|
hot.on("vite:afterUpdate", () => {
|
@@ -55,8 +56,10 @@ function vitePluginSsrCss(pluginOpts) {
|
|
55
56
|
.querySelectorAll("[data-ssr-css]")
|
56
57
|
.forEach(node => node.remove());
|
57
58
|
});
|
58
|
-
`
|
59
|
-
|
59
|
+
`
|
60
|
+
)
|
61
|
+
}
|
62
|
+
];
|
60
63
|
}
|
61
64
|
}
|
62
65
|
};
|
@@ -66,49 +69,57 @@ function invalidateModule(server, id) {
|
|
66
69
|
mod && server.moduleGraph.invalidateModule(mod);
|
67
70
|
}
|
68
71
|
async function collectStyle(server, entries) {
|
69
|
-
var urls = await collectStyleUrls(server, entries),
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
72
|
+
var urls = await collectStyleUrls(server, entries), codes = await Promise.all(urls.map(async function(url) {
|
73
|
+
var res = await server.transformRequest(url + "?direct"), code = res?.code || "", prefix = `/* [collectStyle] ${url} */`;
|
74
|
+
try {
|
75
|
+
var { transform } = await import("lightningcss"), processed = transform({
|
76
|
+
filename: "code.css",
|
77
|
+
code: Buffer.from(code),
|
78
|
+
...server.config.css.lightningcss
|
79
|
+
}).code.toString();
|
80
|
+
return [
|
81
|
+
prefix,
|
82
|
+
processed
|
83
|
+
];
|
84
|
+
} catch (err) {
|
85
|
+
return console.error(` [one] Error post-processing CSS, leaving un-processed: ${err}`), [
|
86
|
+
prefix,
|
87
|
+
code
|
88
|
+
];
|
89
|
+
}
|
90
|
+
}));
|
88
91
|
return codes.flat().filter(Boolean).join(`
|
89
92
|
|
90
93
|
`);
|
91
94
|
}
|
92
95
|
async function collectStyleUrls(server, entries) {
|
93
|
-
var visited = /* @__PURE__ */new Set();
|
96
|
+
var visited = /* @__PURE__ */ new Set();
|
94
97
|
async function traverse(url) {
|
95
98
|
var [, id] = await server.moduleGraph.resolveUrl(url);
|
96
99
|
if (!visited.has(id)) {
|
97
100
|
visited.add(id);
|
98
101
|
var mod = server.moduleGraph.getModuleById(id);
|
99
|
-
mod &&
|
102
|
+
mod && await Promise.all([
|
103
|
+
...mod.importedModules
|
104
|
+
].map(function(childMod) {
|
100
105
|
return traverse(childMod.url);
|
101
|
-
}))
|
106
|
+
}));
|
102
107
|
}
|
103
108
|
}
|
104
|
-
return await Promise.all(entries.map(function
|
109
|
+
return await Promise.all(entries.map(function(e) {
|
105
110
|
return server.transformRequest(e);
|
106
|
-
})), await Promise.all(entries.map(function
|
111
|
+
})), await Promise.all(entries.map(function(url) {
|
107
112
|
return traverse(url);
|
108
|
-
})), [
|
113
|
+
})), [
|
114
|
+
...visited
|
115
|
+
].filter(function(url) {
|
109
116
|
return url.match(CSS_LANGS_RE);
|
110
117
|
});
|
111
118
|
}
|
112
119
|
var CSS_LANGS_RE = /\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/;
|
113
|
-
export {
|
114
|
-
|
120
|
+
export {
|
121
|
+
VIRTUAL_ENTRY,
|
122
|
+
collectStyle,
|
123
|
+
vitePluginSsrCss
|
124
|
+
};
|
125
|
+
//# sourceMappingURL=vitePluginSsrCss.js.map
|
@@ -1 +1,6 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../src/vite/Users/n8/one/packages/one/src/vite/vitePluginSsrCss.ts"],
|
4
|
+
"mappings": "AAKO,IAAMA,gBAAgB;AAEtB,SAASC,iBAAiBC,YAAiC;AAChE,MAAIC,QAGEC,cAAc,iBAAiBJ;AAErC,SAAO;IACLK,MAAM;IACNC,OAAO;IACPC,gBAAgBC,SAAO;A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AQmC,IAAI,SAAC0B,GAAAA;WAAM7E,OAAOoD,iBAAiByB,CAAAA;OAG7D,MAAM5B,QAAQC,IAAIlC,QAAQmC,IAAI,SAACxC,KAAAA;WAAQ6D,SAAS7D,GAAAA;OAGzC;OAAI2D;IAASH,OAAO,SAACxD,KAAAA;WAAQA,IAAImE,MAAMC,YAAAA;;AAChD;AAGA,IAAMA,eAAe;",
|
5
|
+
"names": ["VIRTUAL_ENTRY", "vitePluginSsrCss", "pluginOpts", "server", "virtualHref", "name", "apply", "configureServer", "server_", "middlewares", "use", "req", "res", "next", "url", "includes", "invalidateModule", "code", "collectStyle", "entries", "setHeader", "write", "end", "resolveId", "source", "_importer", "_options", "startsWith", "undefined", "load", "id", "URL", "slice", "searchParams", "has", "JSON", "stringify", "transformIndexHtml", "handler", "tag", "injectTo", "attrs", "rel", "href", "type", "children", "mod", "moduleGraph", "getModuleById", "urls", "collectStyleUrls", "codes", "Promise", "all", "map", "transformRequest", "prefix", "transform", "processed", "filename", "Buffer", "from", "config", "css", "lightningcss", "toString", "err", "console", "error", "flat", "filter", "Boolean", "join", "visited", "Set", "traverse", "resolveUrl", "add", "importedModules", "childMod", "e", "match", "CSS_LANGS_RE"]
|
6
|
+
}
|
package/dist/esm/vite.native.js
CHANGED
@@ -1,10 +1,19 @@
|
|
1
|
-
import { clientTreeShakePlugin } from "./vite/clientTreeShakePlugin
|
2
|
-
import { createFileSystemRouter } from "./vite/createFileSystemRouter
|
3
|
-
import { vitePluginSsrCss } from "./vite/vitePluginSsrCss
|
4
|
-
import { removeReactNativeWebAnimatedPlugin } from "./vite/removeReactNativeWebAnimatedPlugin
|
5
|
-
import { makePluginWebOnly } from "./vite/makePluginWebOnly
|
6
|
-
import { setCurrentRequestHeaders } from "./vite/headers
|
7
|
-
import { build } from "./vite/build
|
8
|
-
import { one } from "./vite/one
|
9
|
-
export {
|
10
|
-
|
1
|
+
import { clientTreeShakePlugin } from "./vite/clientTreeShakePlugin";
|
2
|
+
import { createFileSystemRouter } from "./vite/createFileSystemRouter";
|
3
|
+
import { vitePluginSsrCss } from "./vite/vitePluginSsrCss";
|
4
|
+
import { removeReactNativeWebAnimatedPlugin } from "./vite/removeReactNativeWebAnimatedPlugin";
|
5
|
+
import { makePluginWebOnly } from "./vite/makePluginWebOnly";
|
6
|
+
import { setCurrentRequestHeaders } from "./vite/headers";
|
7
|
+
import { build } from "./vite/build";
|
8
|
+
import { one } from "./vite/one";
|
9
|
+
export {
|
10
|
+
build,
|
11
|
+
clientTreeShakePlugin,
|
12
|
+
createFileSystemRouter,
|
13
|
+
makePluginWebOnly,
|
14
|
+
one,
|
15
|
+
removeReactNativeWebAnimatedPlugin,
|
16
|
+
setCurrentRequestHeaders,
|
17
|
+
vitePluginSsrCss
|
18
|
+
};
|
19
|
+
//# sourceMappingURL=vite.js.map
|
@@ -1 +1,6 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../src/Users/n8/one/packages/one/src/vite.ts"],
|
4
|
+
"mappings": "AACA,SAASA,6BAA6B;AACtC,SAASC,8BAA8B;AACvC,SAASC,wBAAwB;AACjC,SAASC,0CAA0C;AACnD,SAASC,yBAAyB;AAElC,SAASC,gCAAgC;AAEzC,SAASC,aAAa;AACtB,SAASC,WAAW;",
|
5
|
+
"names": ["clientTreeShakePlugin", "createFileSystemRouter", "vitePluginSsrCss", "removeReactNativeWebAnimatedPlugin", "makePluginWebOnly", "setCurrentRequestHeaders", "build", "one"]
|
6
|
+
}
|
@@ -1,6 +1,8 @@
|
|
1
|
-
import { hashString } from "../utils/hashString
|
1
|
+
import { hashString } from "../utils/hashString";
|
2
2
|
function getQueryKey(query) {
|
3
3
|
return hashString(JSON.stringify(query.ast));
|
4
4
|
}
|
5
|
-
export {
|
6
|
-
|
5
|
+
export {
|
6
|
+
getQueryKey
|
7
|
+
};
|
8
|
+
//# sourceMappingURL=getQueryKey.js.map
|
@@ -1 +1,6 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../src/zero/Users/n8/one/packages/one/src/zero/getQueryKey.ts"],
|
4
|
+
"mappings": "AAAA,SAASA,kBAAkB;AAEpB,SAASC,YAAYC,OAAmB;AAC7C,SAAOF,WAAWG,KAAKC,UAAUF,MAAMG,GAAG,CAAA;AAC5C;",
|
5
|
+
"names": ["hashString", "getQueryKey", "query", "JSON", "stringify", "ast"]
|
6
|
+
}
|
@@ -1 +1,6 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../src/zero/Users/n8/one/packages/one/src/zero/isZeroQuery.ts"],
|
4
|
+
"mappings": "AACO,SAASA,YAAYC,KAAQ;AAGlC,SAFI,GAACA,OACD,OAAOA,OAAQ,YACf,CAACA,IAAIC,OAAO,CAACD,IAAIC,IAAIC;AAE3B;",
|
5
|
+
"names": ["isZeroQuery", "obj", "ast", "table"]
|
6
|
+
}
|
@@ -1,11 +1,10 @@
|
|
1
1
|
async function resolveZeroQuery(query) {
|
2
|
-
var view = query.materialize(),
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
return new Promise(function (res, rej) {
|
2
|
+
var view = query.materialize(), tm = setTimeout(function() {
|
3
|
+
console.warn(" Warning: query slow to resolve, ensure Zero server is running", JSON.stringify(query.ast, null, 2));
|
4
|
+
}, 2e3);
|
5
|
+
return new Promise(function(res, rej) {
|
7
6
|
try {
|
8
|
-
var unsubscribe = view.addListener(function
|
7
|
+
var unsubscribe = view.addListener(function(snapshot) {
|
9
8
|
unsubscribe(), clearTimeout(tm), res(snapshot);
|
10
9
|
});
|
11
10
|
view.hydrate();
|
@@ -14,5 +13,7 @@ async function resolveZeroQuery(query) {
|
|
14
13
|
}
|
15
14
|
});
|
16
15
|
}
|
17
|
-
export {
|
18
|
-
|
16
|
+
export {
|
17
|
+
resolveZeroQuery
|
18
|
+
};
|
19
|
+
//# sourceMappingURL=resolveQuery.js.map
|
@@ -1 +1,6 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../src/zero/Users/n8/one/packages/one/src/zero/resolveQuery.ts"],
|
4
|
+
"mappings": "AAGA,eAAsBA,iBAAiBC,OAAY;AACjD,MAAMC,OAAOD,MAAME,YAAW,GAGxBC,KAAKC,WAAW,WAAA;AACpBC,YAAQC,KACN,kEACAC,KAAKC,UAAUR,MAAMS,KAAK,MAAM,CAAA,CAAA;EAEpC,GAAG,GAAA;AAEH,SAAO,IAAIC,QAAQ,SAACC,KAAKC,KAAAA;AACvB,QAAI;AACF,UAAMC,cAAcZ,KAAKa,YAAY,SAACC,UAAAA;AACpCF,oBAAAA,GACAG,aAAab,EAAAA,GACbQ,IAAII,QAAAA;MACN,CAAA;AAEAd,WAAKgB,QAAO;IACd,SAASC,KAAK;AACZF,mBAAab,EAAAA,GACbS,IAAIM,GAAAA;IACN;EACF,CAAA;AACF;",
|
5
|
+
"names": ["resolveZeroQuery", "query", "view", "materialize", "tm", "setTimeout", "console", "warn", "JSON", "stringify", "ast", "Promise", "res", "rej", "unsubscribe", "addListener", "snapshot", "clearTimeout", "hydrate", "err"]
|
6
|
+
}
|