@jk2908/solas 0.3.5 → 0.3.7

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,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.7 - 2026-04-25
4
+
5
+ - Fixed shell rendering so routes without a root `+loading` fallback no longer wrap the entire document in `Suspense`, which removes misplaced `<!--html-->`, `<!--head-->`, and `<!--body-->` markers from streamed HTML.
6
+
7
+ ## 0.3.6 - 2026-04-24
8
+
9
+ - 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.
10
+
3
11
  ## 0.3.5 - 2026-04-23
4
12
 
5
13
  - 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
- ...(viteConfig.resolve.alias ?? {}),
190
- '.solas': path.resolve(process.cwd(), Solas.Config.GENERATED_DIR),
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}...`);
@@ -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(window.btoa(String.fromCodePoint(...chunk)));
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
  }
@@ -99,14 +99,15 @@ export function Tree({ depth, params, error, ui, }) {
99
99
  // now wrap with shell structure: shell renders immediately,
100
100
  // inner streams inside Suspense
101
101
  const ShellLoading = loaders[0];
102
- const Shellunauthorised = unauthorised[0];
102
+ const ShellUnauthorised = unauthorised[0];
103
103
  const ShellForbidden = forbidden[0];
104
104
  const ShellNotFound = notFounds[0];
105
105
  const ShellServerError = serverErrors[0];
106
+ const shell = _jsx(Shell, { params: params, children: inner });
106
107
  return (_jsx(HttpExceptionBoundary, { components: {
107
- 401: Shellunauthorised ? _jsx(Shellunauthorised, { error: UNAUTHORISED_ERROR }) : null,
108
+ 401: ShellUnauthorised ? _jsx(ShellUnauthorised, { error: UNAUTHORISED_ERROR }) : null,
108
109
  403: ShellForbidden ? _jsx(ShellForbidden, { error: FORBIDDEN_ERROR }) : null,
109
110
  404: ShellNotFound ? _jsx(ShellNotFound, { error: NOT_FOUND_ERROR }) : null,
110
111
  500: ShellServerError ? _jsx(ShellServerError, { error: SERVER_ERROR }) : null,
111
- }, children: _jsx(Suspense, { fallback: ShellLoading ? _jsx(ShellLoading, {}) : null, children: _jsx(Shell, { params: params, children: inner }) }) }));
112
+ }, children: ShellLoading ? _jsx(Suspense, { fallback: _jsx(ShellLoading, {}), children: shell }) : shell }));
112
113
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jk2908/solas",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "description": "A React Server Components meta-framework powered by Vite",
5
5
  "keywords": [
6
6
  "framework",