@ubean/client 0.4.6 → 0.4.8
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/{app-COSjPzyK.js → app-C5YuXGJl.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/{i18n-CAeXKTpy.js → i18n-DPOzFBuG.js} +10 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.js +2 -2
- package/dist/server.js +1 -1
- package/dist/ssr.js +1 -1
- package/package.json +7 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as getI18nRuntimeConfig, l as localizePath, r as createUbeanI18n, s as initClientI18n, t as bindI18nRuntime } from "./i18n-
|
|
1
|
+
import { a as getI18nRuntimeConfig, l as localizePath, r as createUbeanI18n, s as initClientI18n, t as bindI18nRuntime } from "./i18n-DPOzFBuG.js";
|
|
2
2
|
import { computed, createApp, createSSRApp, defineComponent, h, inject, markRaw, provide, reactive, shallowRef, watchEffect } from "vue";
|
|
3
3
|
import { createMemoryHistory, createRouter, createWebHistory, useRoute } from "vue-router";
|
|
4
4
|
import { ClientOnly, ERROR_KEY, ERROR_KEY as ERROR_KEY$1, LAYOUT_CHAIN_KEY, LOADING_KEY, LOADING_KEY as LOADING_KEY$1, LOCALIZE_PATH_KEY, LOCALIZE_PATH_KEY as LOCALIZE_PATH_KEY$1, LayoutChainRenderer, LayoutChainRenderer as LayoutChainRenderer$1, Link, PAGE_KEY, PAGE_KEY as PAGE_KEY$1, PageView, SSR_KEY, SSR_KEY as SSR_KEY$1, SlotView, TRANSITION_KEY, TRANSITION_KEY as TRANSITION_KEY$1, initCachedViewsFromRoutes, ubeanVue, useViewTransition } from "@ubean/vue";
|
package/dist/app.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as createUbeanRouter, S as definePage, _ as useSeoMeta, a as LOADING_KEY, b as defineMeta, c as Link, d as SSR_KEY, f as SlotView, g as ubeanVue, h as createUbeanSSRApp, i as LAYOUT_CHAIN_KEY, l as PAGE_KEY, m as createUbeanClientApp, n as ERROR_KEY, o as LOCALIZE_PATH_KEY, p as TRANSITION_KEY, r as Head, s as LayoutChainRenderer, t as ClientOnly, u as PageView, v as useUnheadHead, w as usePage, x as defineMiddleware, y as useViewTransition } from "./app-
|
|
1
|
+
import { C as createUbeanRouter, S as definePage, _ as useSeoMeta, a as LOADING_KEY, b as defineMeta, c as Link, d as SSR_KEY, f as SlotView, g as ubeanVue, h as createUbeanSSRApp, i as LAYOUT_CHAIN_KEY, l as PAGE_KEY, m as createUbeanClientApp, n as ERROR_KEY, o as LOCALIZE_PATH_KEY, p as TRANSITION_KEY, r as Head, s as LayoutChainRenderer, t as ClientOnly, u as PageView, v as useUnheadHead, w as usePage, x as defineMiddleware, y as useViewTransition } from "./app-C5YuXGJl.js";
|
|
2
2
|
export { ClientOnly, ERROR_KEY, Head, LAYOUT_CHAIN_KEY, LOADING_KEY, LOCALIZE_PATH_KEY, LayoutChainRenderer, Link, PAGE_KEY, PageView, SSR_KEY, SlotView, TRANSITION_KEY, createUbeanClientApp, createUbeanRouter, createUbeanSSRApp, defineMeta, defineMiddleware, definePage, ubeanVue, useUnheadHead as useHead, usePage, useSeoMeta, useViewTransition };
|
|
@@ -108,6 +108,13 @@ function writeLocaleCookie(code) {
|
|
|
108
108
|
* Framework setLocale: load messages, switch composer locale, write cookie,
|
|
109
109
|
* navigate to the localized path (`no_prefix` skips navigation).
|
|
110
110
|
*
|
|
111
|
+
* Server-side (no `window`) the navigation is skipped: the render URL is the
|
|
112
|
+
* source of truth during SSR/SSG, and `router.replace` on the shared
|
|
113
|
+
* memory-history router — often a stale instance from a previous render —
|
|
114
|
+
* cancels in-flight initial navigations. Combined with a navigation guard
|
|
115
|
+
* calling `setLocale`, this used to create a self-sustaining replace loop
|
|
116
|
+
* that starved the event loop (docs SSG build hang, 2026-09-10).
|
|
117
|
+
*
|
|
111
118
|
* Uses the runtime bound by `bindI18nRuntime` (not Vue composables) so it is
|
|
112
119
|
* safe to call from click handlers.
|
|
113
120
|
*/
|
|
@@ -123,7 +130,7 @@ async function setLocale(code) {
|
|
|
123
130
|
}) : Promise.resolve();
|
|
124
131
|
const cfg = state.config;
|
|
125
132
|
let navPromise = Promise.resolve();
|
|
126
|
-
if (cfg && cfg.strategy !== "no_prefix") {
|
|
133
|
+
if (cfg && cfg.strategy !== "no_prefix" && typeof window !== "undefined") {
|
|
127
134
|
const router = state.router;
|
|
128
135
|
const currentPath = (router?.currentRoute.value.path || router?.currentRoute.value.fullPath?.split("?")[0] || (typeof window !== "undefined" ? window.location.pathname : "/")).split("?")[0];
|
|
129
136
|
const target = switchLocalePath(code, currentPath, routingFrom(cfg));
|
|
@@ -135,6 +142,8 @@ function getLocale() {
|
|
|
135
142
|
try {
|
|
136
143
|
return String(useI18n().locale.value);
|
|
137
144
|
} catch {
|
|
145
|
+
const composer = getRuntimeState().i18n?.global;
|
|
146
|
+
if (composer) return String(composer.locale.value);
|
|
138
147
|
return getRuntimeConfigState()?.defaultLocale || "en";
|
|
139
148
|
}
|
|
140
149
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -137,6 +137,13 @@ export declare function installUbeanI18n(app: App, i18n: I18n): void;
|
|
|
137
137
|
* Framework setLocale: load messages, switch composer locale, write cookie,
|
|
138
138
|
* navigate to the localized path (`no_prefix` skips navigation).
|
|
139
139
|
*
|
|
140
|
+
* Server-side (no `window`) the navigation is skipped: the render URL is the
|
|
141
|
+
* source of truth during SSR/SSG, and `router.replace` on the shared
|
|
142
|
+
* memory-history router — often a stale instance from a previous render —
|
|
143
|
+
* cancels in-flight initial navigations. Combined with a navigation guard
|
|
144
|
+
* calling `setLocale`, this used to create a self-sustaining replace loop
|
|
145
|
+
* that starved the event loop (docs SSG build hang, 2026-09-10).
|
|
146
|
+
*
|
|
140
147
|
* Uses the runtime bound by `bindI18nRuntime` (not Vue composables) so it is
|
|
141
148
|
* safe to call from click handlers.
|
|
142
149
|
*/
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as createUbeanRouter, S as definePage, _ as useSeoMeta, b as defineMeta, h as createUbeanSSRApp, m as createUbeanClientApp, r as Head, v as useUnheadHead, w as usePage, x as defineMiddleware } from "./app-
|
|
2
|
-
import { a as getI18nRuntimeConfig, c as installUbeanI18n, d as switchLocalePath, f as useLocaleHead, h as useSwitchLocalePath, i as extractLocaleFromPath, l as localizePath, m as useLocaleRoute, n as configureI18nRuntime, o as getLocale, p as useLocalePath, r as createUbeanI18n, s as initClientI18n, u as setLocale } from "./i18n-
|
|
1
|
+
import { C as createUbeanRouter, S as definePage, _ as useSeoMeta, b as defineMeta, h as createUbeanSSRApp, m as createUbeanClientApp, r as Head, v as useUnheadHead, w as usePage, x as defineMiddleware } from "./app-C5YuXGJl.js";
|
|
2
|
+
import { a as getI18nRuntimeConfig, c as installUbeanI18n, d as switchLocalePath, f as useLocaleHead, h as useSwitchLocalePath, i as extractLocaleFromPath, l as localizePath, m as useLocaleRoute, n as configureI18nRuntime, o as getLocale, p as useLocalePath, r as createUbeanI18n, s as initClientI18n, u as setLocale } from "./i18n-DPOzFBuG.js";
|
|
3
3
|
import { applyAppConfig, createDefaultAppConfig, defineApp, mergeAppConfig } from "./define-app.js";
|
|
4
4
|
import { computed, getCurrentInstance, markRaw, onMounted, onScopeDispose, onUnmounted, ref, shallowRef, watch } from "vue";
|
|
5
5
|
import { ClientOnly, ERROR_KEY, ErrorBoundary, LAYOUT_CHAIN_KEY, LOADING_KEY, LOCALIZE_PATH_KEY, LayoutChainRenderer, Link, PAGE_KEY, PageView, SSR_KEY, SlotView, TRANSITION_KEY, clearPageTransition, disablePageCache, enablePageCache, excludePageCache, getCacheEnabled, getCachedViewNames, getExcludedViewNames, getNamedPageWrapper, getNavigationType, getPageTransitionName, getReloadCounter, includePageCache, initCachedViewsFromRoutes, invalidatePageCache, isActiveRoute, isCacheEnabled, isPageCached, isPageExcluded, isReloading, reloadPage, resetNamedPageWrappers, resetRouteCache, resolveRoute, setPageTransition, supportsViewTransitions, ubeanVue, useCacheViews, usePageTransition, useReloadSignal, useViewTransition, useViewTransitionState, withViewTransition } from "@ubean/vue";
|
package/dist/server.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { C as createUbeanRouter, S as definePage, _ as useSeoMeta, a as LOADING_KEY, b as defineMeta, c as Link, d as SSR_KEY, f as SlotView, g as ubeanVue, h as createUbeanSSRApp, i as LAYOUT_CHAIN_KEY, l as PAGE_KEY, m as createUbeanClientApp, n as ERROR_KEY, o as LOCALIZE_PATH_KEY, p as TRANSITION_KEY, r as Head, s as LayoutChainRenderer, t as ClientOnly, u as PageView, v as useUnheadHead, w as usePage, x as defineMiddleware, y as useViewTransition } from "./app-
|
|
1
|
+
import { C as createUbeanRouter, S as definePage, _ as useSeoMeta, a as LOADING_KEY, b as defineMeta, c as Link, d as SSR_KEY, f as SlotView, g as ubeanVue, h as createUbeanSSRApp, i as LAYOUT_CHAIN_KEY, l as PAGE_KEY, m as createUbeanClientApp, n as ERROR_KEY, o as LOCALIZE_PATH_KEY, p as TRANSITION_KEY, r as Head, s as LayoutChainRenderer, t as ClientOnly, u as PageView, v as useUnheadHead, w as usePage, x as defineMiddleware, y as useViewTransition } from "./app-C5YuXGJl.js";
|
|
2
2
|
import { createHead as createServerHead } from "@unhead/vue/server";
|
|
3
3
|
export { ClientOnly, ERROR_KEY, Head, LAYOUT_CHAIN_KEY, LOADING_KEY, LOCALIZE_PATH_KEY, LayoutChainRenderer, Link, PAGE_KEY, PageView, SSR_KEY, SlotView, TRANSITION_KEY, createServerHead, createUbeanClientApp, createUbeanRouter, createUbeanSSRApp, defineMeta, defineMiddleware, definePage, ubeanVue, useUnheadHead as useHead, usePage, useSeoMeta, useViewTransition };
|
package/dist/ssr.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as configureI18nRuntime, r as createUbeanI18n } from "./i18n-
|
|
1
|
+
import { n as configureI18nRuntime, r as createUbeanI18n } from "./i18n-DPOzFBuG.js";
|
|
2
2
|
import { applyAppConfig } from "./define-app.js";
|
|
3
3
|
import { createSSRApp, defineComponent, h, provide, reactive } from "vue";
|
|
4
4
|
import { SSR_CONTENT_MARKER, STATE_DATA_ID, STATE_MARKER, __clearDataPayload, __clearDeferred, __resolveDataPayload, __resolveDeferred, __serializeDataPayload, __serializeDeferred, safeJsonStringify } from "@ubean/pages";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ubean/client",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.8",
|
|
4
4
|
"description": "Framework client runtime for ubean — layered over the lean @ubean/vue kernel, adding app factories, unhead, i18n, data layer, islands hydration and SSR state helpers",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@ubean/i18n": "0.4.
|
|
36
|
-
"@ubean/islands": "0.4.
|
|
37
|
-
"@ubean/pages": "0.4.
|
|
38
|
-
"@ubean/shared": "0.4.
|
|
39
|
-
"@ubean/vue": "0.4.
|
|
35
|
+
"@ubean/i18n": "0.4.8",
|
|
36
|
+
"@ubean/islands": "0.4.8",
|
|
37
|
+
"@ubean/pages": "0.4.8",
|
|
38
|
+
"@ubean/shared": "0.4.8",
|
|
39
|
+
"@ubean/vue": "0.4.8",
|
|
40
40
|
"@unhead/vue": "^3.4.0",
|
|
41
41
|
"@vue/server-renderer": "^3.5.42",
|
|
42
42
|
"vue": "^3.5.42",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"vite-plus": "0.3.1"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"@ubean/seo": "0.4.
|
|
52
|
+
"@ubean/seo": "0.4.8"
|
|
53
53
|
},
|
|
54
54
|
"peerDependenciesMeta": {
|
|
55
55
|
"@ubean/seo": {
|