Skip to content

feat: Solid 2, TanStack Router 2 and @nativescript/vite 8 - #2

Merged
NathanWalker merged 4 commits into
mainfrom
feat/vite-8
Nov 24, 2026
Merged

NathanWalker merged 4 commits into
mainfrom
feat/vite-8

Conversation

@NathanWalker

@NathanWalker NathanWalker commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Moves the demo to the current stack: Solid 2, @tanstack/solid-router 2 (rc), @nativescript/vite 8 and NativeScript 9.1.

All dependencies come from npm. This includes @nativescript/tanstack-router@0.2.1 (NativeScript/tanstack#4, #5) and @nativescript/vite@8.0.24, which applies plugins from dependency nativescript.vite.mjs configs (NativeScript/NativeScript#11669).

Changes

  • Dependencies. Everything is on npm latest except @tanstack/solid-router, which is on 2.0.0-rc.12 because the Solid 2 router has only release candidates so far.
    • Main stack: solid-js / @solidjs/web / @solidjs/universal 2.0.3, @nativescript-community/solid-js 2.0.1, @nativescript/core 9.1.4, @nativescript/vite 8.0.24, @nativescript/tanstack-router 0.2.1.
    • Removed: babel-preset-solid, solid-refresh, babel*, concurrently, wait-on, and the vite override.
    • .npmrc sets legacy-peer-deps=true, because a few of the router rc's own dependencies still declare Solid 1 peer ranges.
  • Scripts. Only ns debug ios|android|visionos remain; the 9.1 CLI runs the Vite dev server itself.
  • Build. vite.config.ts becomes vite.config.mts, composing @nativescript/vite's baseConfig with @solidjs/vite-plugin (universal output).
    • It pins Solid's browser bundles, so the app, renderer and router share one reactive core.
    • It registers the TanStack router plugin, so routeTree.gen.ts regenerates on build.
  • Entry. The app boots through startSolidApp from @nativescript/vite/solid-bootstrap, which handles HMR remounts.
  • Routes. Routes use explicit createFileRoute("/path") ids. routeTree.gen.ts was regenerated, with the same routes in a new order.
  • Solid 2 fixes.
    • useStableLoaderData is a single memo with an optional lazy fallback.
    • Loader fallbacks and the post-list author lookup no longer read signals at the top level, which Solid 2 freezes.
  • iOS.
    • Info.plist adopts the UIScene lifecycle; iOS 27 traps at launch without it.
    • The deployment target is 18.0.
    • The image-cache-it patch is refreshed (SDWebImage 5.21.7).

Verified

  • tsc --noEmit passes, and production Vite builds pass for iOS and Android.
  • The resolved Vite config registers the TanStack router plugin exactly once, and deleting routeTree.gen.ts regenerates an identical file.
  • On an iOS 27 simulator: driven in-process through home, posts, post detail, native back, a ?@modal= user sheet open and close, the virtual and inspector routes, history.back(), about, and a shared-component HMR update. Frame backstack and router history stayed in sync, with no Solid diagnostics or JS errors.
  • Not covered: the interactive swipe-back gesture, because simulator touch injection is unavailable on Xcode 27. Android was not run on device.

Known follow-up

After an HMR edit to a shared (non-route) component, the app returns to /, because a fresh router is created. This is noted in NativeScript/tanstack#4.

- Solid 2 (solid-js, @solidjs/web, @solidjs/universal) with
  @nativescript-community/solid-js 2 and @tanstack/solid-router 2 rc.
- vite.config.mts composes @nativescript/vite's baseConfig with
  @solidjs/vite-plugin, pins Solid's browser bundles, and registers the
  TanStack router plugin so routeTree.gen.ts regenerates.
- Entry boots through startSolidApp for HMR remounts.
- All deps on npm latest (NativeScript 9.1); scripts reduced to ns debug,
  since the 9.1 CLI drives the Vite dev server itself.
- File routes use explicit createFileRoute("/path") ids.
- Components avoid top-level reactive reads (Solid 2 STRICT_READ_UNTRACKED).
- Info.plist adopts the UIScene lifecycle, required by iOS 27.
@NathanWalker
NathanWalker merged commit e229d80 into main Nov 24, 2026
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.

1 participant