@jk2908/solas 0.3.5 → 0.3.6
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
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.6 - 2026-04-24
|
|
4
|
+
|
|
5
|
+
- Fixed broken client-side `<Link />` navigation in Vite dev by excluding Solas browser runtime entry points from `optimizeDeps`, so the browser entry and client-reference router modules share a single `BrowserRouterContext` instance.
|
|
6
|
+
|
|
3
7
|
## 0.3.5 - 2026-04-23
|
|
4
8
|
|
|
5
9
|
- 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.
|
package/dist/index.js
CHANGED
|
@@ -173,6 +173,9 @@ function solas(c) {
|
|
|
173
173
|
async config(viteConfig) {
|
|
174
174
|
await build();
|
|
175
175
|
const pkg = JSON.parse(fsSync.readFileSync(new URL('../package.json', import.meta.url), 'utf-8'));
|
|
176
|
+
if (typeof pkg.name !== 'string' || pkg.name.length === 0) {
|
|
177
|
+
throw new Error(`Missing ${Solas.Config.NAME} package name`);
|
|
178
|
+
}
|
|
176
179
|
if (typeof pkg.version !== 'string' || pkg.version.length === 0) {
|
|
177
180
|
throw new Error(`Missing ${Solas.Config.NAME} package version`);
|
|
178
181
|
}
|
|
@@ -184,11 +187,28 @@ function solas(c) {
|
|
|
184
187
|
viteConfig.define ??= {};
|
|
185
188
|
viteConfig.define['import.meta.env.VITE_APP_URL'] = JSON.stringify(config.url);
|
|
186
189
|
viteConfig.define['import.meta.env.SOLAS_VERSION'] = JSON.stringify(pkg.version);
|
|
190
|
+
viteConfig.optimizeDeps ??= {};
|
|
191
|
+
viteConfig.optimizeDeps.exclude = [
|
|
192
|
+
...new Set([
|
|
193
|
+
...(viteConfig.optimizeDeps.exclude ?? []),
|
|
194
|
+
pkg.name,
|
|
195
|
+
`${pkg.name}/env/browser`,
|
|
196
|
+
`${pkg.name}/router`,
|
|
197
|
+
]),
|
|
198
|
+
];
|
|
187
199
|
viteConfig.resolve ??= {};
|
|
188
|
-
viteConfig.resolve.alias =
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
200
|
+
viteConfig.resolve.alias = Array.isArray(viteConfig.resolve.alias)
|
|
201
|
+
? [
|
|
202
|
+
...viteConfig.resolve.alias,
|
|
203
|
+
{
|
|
204
|
+
find: '.solas',
|
|
205
|
+
replacement: path.resolve(process.cwd(), Solas.Config.GENERATED_DIR),
|
|
206
|
+
},
|
|
207
|
+
]
|
|
208
|
+
: {
|
|
209
|
+
...viteConfig.resolve.alias,
|
|
210
|
+
'.solas': path.resolve(process.cwd(), Solas.Config.GENERATED_DIR),
|
|
211
|
+
};
|
|
192
212
|
},
|
|
193
213
|
configureServer(server) {
|
|
194
214
|
logger.info('[configureServer]', `Watching for changes in ./${Solas.Config.APP_DIR}...`);
|
|
@@ -222,5 +222,5 @@ export function BrowserRouterProvider({ children, setPayload, isNavigating = fal
|
|
|
222
222
|
search: url?.search,
|
|
223
223
|
},
|
|
224
224
|
}), [go, prefetch, isNavigating, url]);
|
|
225
|
-
return _jsx(BrowserRouterContext, { value: value, children: children });
|
|
225
|
+
return _jsx(BrowserRouterContext.Provider, { value: value, children: children });
|
|
226
226
|
}
|
|
@@ -162,7 +162,7 @@ async function writePayload(payload, controller, nonce) {
|
|
|
162
162
|
catch {
|
|
163
163
|
// most rows are text, but keep binary chunks intact when a payload
|
|
164
164
|
// row cannot be decoded as utf-8
|
|
165
|
-
const base64 = JSON.stringify(
|
|
165
|
+
const base64 = JSON.stringify(btoa(String.fromCodePoint(...chunk)));
|
|
166
166
|
writePayloadScript(`Uint8Array.from(atob(${base64}), value => value.codePointAt(0))`, controller, nonce);
|
|
167
167
|
}
|
|
168
168
|
}
|