@jk2908/solas 0.3.3 → 0.3.5
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/CHANGELOG.md +8 -0
- package/dist/index.js +0 -7
- package/dist/internal/browser-router/router.js +15 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.5 - 2026-04-23
|
|
4
|
+
|
|
5
|
+
- Fixed client-side navigation to same-origin routes that later resolve to a 404 or error state by committing the target URL to browser history before the RSC payload finishes loading, so broken internal links no longer leave the route unchanged.
|
|
6
|
+
|
|
7
|
+
## 0.3.4 - 2026-04-23
|
|
8
|
+
|
|
9
|
+
- Fixed `hydrateRoot` missing named export error in the browser by removing the erroneous `optimizeDeps.exclude` for `react-dom/client`. Excluding it prevented Vite from pre-bundling the CommonJS wrapper, so the named export was never exposed to browser ESM consumers.
|
|
10
|
+
|
|
3
11
|
## 0.3.3 - 2026-04-23
|
|
4
12
|
|
|
5
13
|
- Fixed HTML missing-route rendering when Solas is installed from npm by serialising `HttpException` and `Error` values into transport-safe objects before they cross the RSC payload boundary, preserving the expected 404 flow instead of crashing during SSR.
|
package/dist/index.js
CHANGED
|
@@ -189,13 +189,6 @@ function solas(c) {
|
|
|
189
189
|
...(viteConfig.resolve.alias ?? {}),
|
|
190
190
|
'.solas': path.resolve(process.cwd(), Solas.Config.GENERATED_DIR),
|
|
191
191
|
};
|
|
192
|
-
viteConfig.optimizeDeps ??= {};
|
|
193
|
-
viteConfig.optimizeDeps.exclude = [
|
|
194
|
-
...(Array.isArray(viteConfig.optimizeDeps.exclude)
|
|
195
|
-
? viteConfig.optimizeDeps.exclude
|
|
196
|
-
: []),
|
|
197
|
-
'react-dom/client',
|
|
198
|
-
];
|
|
199
192
|
},
|
|
200
193
|
configureServer(server) {
|
|
201
194
|
logger.info('[configureServer]', `Watching for changes in ./${Solas.Config.APP_DIR}...`);
|
|
@@ -95,7 +95,8 @@ export function BrowserRouterProvider({ children, setPayload, isNavigating = fal
|
|
|
95
95
|
id.current += 1;
|
|
96
96
|
const navigationId = id.current;
|
|
97
97
|
// fallback for abort/error paths
|
|
98
|
-
|
|
98
|
+
const currentPath = window.location.pathname + window.location.search;
|
|
99
|
+
let path = currentPath;
|
|
99
100
|
const replace = opts?.replace ?? DEFAULT_GO_CONFIG.replace;
|
|
100
101
|
controller.current?.abort();
|
|
101
102
|
controller.current = null;
|
|
@@ -113,6 +114,16 @@ export function BrowserRouterProvider({ children, setPayload, isNavigating = fal
|
|
|
113
114
|
throw new Error('Invalid navigation url');
|
|
114
115
|
// switch to the normalised target once the url is valid
|
|
115
116
|
path = key;
|
|
117
|
+
// internal client navigation should update the route immediately, even
|
|
118
|
+
// if the subsequent fetch resolves to a 404 or other error state
|
|
119
|
+
if (path !== currentPath) {
|
|
120
|
+
if (replace) {
|
|
121
|
+
window.history.replaceState(null, '', path);
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
window.history.pushState(null, '', path);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
116
127
|
// if the target was already prefetched, use the cached response promise
|
|
117
128
|
// and set existing to true so we don't remove it from cache
|
|
118
129
|
// after navigation
|
|
@@ -143,15 +154,12 @@ export function BrowserRouterProvider({ children, setPayload, isNavigating = fal
|
|
|
143
154
|
// the response
|
|
144
155
|
if (navigationId !== id.current)
|
|
145
156
|
return resolvedPath;
|
|
157
|
+
if (resolvedPath !== path) {
|
|
158
|
+
window.history.replaceState(null, '', resolvedPath);
|
|
159
|
+
}
|
|
146
160
|
// this state update is already wrapped in a
|
|
147
161
|
// transition before being passed as props
|
|
148
162
|
setPayload?.(payload);
|
|
149
|
-
if (replace) {
|
|
150
|
-
window.history.replaceState(null, '', resolvedPath);
|
|
151
|
-
}
|
|
152
|
-
else {
|
|
153
|
-
window.history.pushState(null, '', resolvedPath);
|
|
154
|
-
}
|
|
155
163
|
window.dispatchEvent(new CustomEvent(Solas.Events.names.NAVIGATION, {
|
|
156
164
|
detail: { path: resolvedPath },
|
|
157
165
|
}));
|