Skip to content

WIP: Upgrade to solid 2 beta#2091

Draft
brenelz wants to merge 32 commits into
mainfrom
upgrade-to-solid-2-beta
Draft

WIP: Upgrade to solid 2 beta#2091
brenelz wants to merge 32 commits into
mainfrom
upgrade-to-solid-2-beta

Conversation

@brenelz

@brenelz brenelz commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

PR Checklist

Seeing what It take to update SolidStart to use Solid 2.0 beta. The examples work even with solid-router

@netlify

netlify Bot commented Mar 4, 2026

Copy link
Copy Markdown

Deploy Preview for solid-start-landing-page ready!

Name Link
🔨 Latest commit c597710
🔍 Latest deploy log https://app.netlify.com/projects/solid-start-landing-page/deploys/6a4e94f39bd7ff00088d14be
😎 Deploy Preview https://deploy-preview-2091--solid-start-landing-page.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@changeset-bot

changeset-bot Bot commented Mar 4, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: c597710

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Mar 4, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/solidjs/solid-start/@solidjs/start@2091
npm i https://pkg.pr.new/solidjs/solid-start/@solidjs/vite-plugin-nitro-2@2091

commit: c597710

useAssets_(() => renderAsset(asset, nonce));
entity.ssrIdx = ssrRequestAssets.length - 1;
useAssets_(() => renderAsset(asset, nonce) as any);
if (ssrRequestAssets) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im not sure if these changes are correct or needed

// used on native HTML elements during SSR transformation. The previous
// implementation used JSX (<style {...props.attrs}> etc.) which triggered the
// bug. Instead we build the HTML strings directly — these assets are only
// ever rendered during SSR so reactive JSX is unnecessary.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these changes are probably unneeded

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems that they are needed in some capacity

Comment thread packages/start/package.json Outdated
Comment thread packages/start/src/fns/handler.ts
Comment thread packages/start/src/shared/dev-overlay/DevOverlayDialog.tsx Outdated
Comment thread packages/start/package.json Outdated
@lxsmnsyc

Copy link
Copy Markdown
Member

We can probably use ^2.0.0-beta.3 based on my tests

@lxsmnsyc

Copy link
Copy Markdown
Member

needs rebasing

brenelz and others added 10 commits March 21, 2026 15:04
- Update leftover accessor-style children callbacks to beta.15 semantics:
  non-keyed <For> and keyed <Show> now pass raw values, not accessors
  (notes, hackernews, todomvc fixtures + one missed spot in the dev overlay)
- Patch terracotta to shim removed @solidjs/web createDynamic export
- Align @solidjs/signals in apps/tests with solid-js 2.0.0-beta.15

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
# Conflicts:
#	apps/tests/vite.config.ts
#	packages/start/package.json
#	packages/start/src/config/index.ts
#	packages/start/src/fns/handler.ts
#	packages/start/src/fns/server.ts
#	packages/start/src/server/handler.ts
#	pnpm-lock.yaml
- onSettled no longer accepts async callbacks (a returned Promise is an
  invalid cleanup value) — wrap the async work in a void IIFE across the
  test routes, and convert main's new server-env route from
  createEffect(async) to the same pattern
- dev overlay: Errored's fallback now receives an accessor, and signal
  writes inside the boundary's owned scope throw — read the error and
  defer the push to a microtask

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
In Solid 2, createEffect's compute runs during SSR, so the export check
executed on the server — where the "use server" module legitimately still
exports testQuery — baking "true" into the markup. Use onSettled (a
server no-op) like the other server-function routes so the check runs
against the client module, where non-function exports are stripped.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
terracotta next.6 migrated to solid 2.0.0-beta.15 (own createDynamic
helper, JSX types from @solidjs/web), so the pnpm patch shimming the
removed @solidjs/web createDynamic export is no longer needed, and the
dev overlay's Select props no longer need the `as any` cast.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

const lazy = !isServer
? solidLazy
: <T extends Component<any>>(fn: () => Promise<{ default: T }>) => solidLazy(withAssets(fn));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you removing all of my css work? 🙈

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I honestly can't remember. Maybe it had issues. Let me try and add it back

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added it back


import { pageRoutes } from "./routes.ts";

function buildDevManifest(): Record<string, any> {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the most critical change that was made for v2 i think

brenelz and others added 3 commits July 8, 2026 10:25
Bring back the withAssets logic in shared/lazy.ts (id$$ manifest lookup +
useAssets injection with nonce), adapted to beta.15 where lazy() takes a
required moduleUrl in SSR:

- config/lazy.ts: inject vite-plugin-solid's __SOLID_LAZY_MODULE__
  placeholder into user-land lazy() calls before rewriting the solid-js
  import, since the plugin only injects it for "solid-js" imports
- server/handler.ts: resolve unknown moduleUrls in the dev manifest via a
  Proxy fallback so client hydration can preload lazy modules in dev
- css fixture: replace removed createAsync with createMemo, pass an
  explicit moduleUrl for the import.meta.glob lazy, and fix onSettled
  returning a non-cleanup value

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The raw-HTML-string workaround existed for a babel-plugin-jsx-dom-expressions
spread crash that's fixed in 0.50.0-next.14. The remaining blocker was
beta.15's owner-based hydration keys: useAssets thunks run at shell-injection
time with no owner, so ssrElement's getNextContextId call threw and killed the
server process. Wrapping the asset JSX in <NoHydration> provides an owner with
hydration-key generation disabled — correct for head tags, which never hydrate.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants