This PR introduce support for Solid to be used with TanStack Start.
There are several ongoing refactors that can influence the timing of
when it's most feasible to merge this.
### Status (build and run e2e/solid-start/basic)
- [X] SSR
- [x] API Routes
- [x] Server Functions
- [x] HMR
- [x] Streaming (/stream route)
- [X] Timely hydration
### Ongoing refactors
Refactor to make router packages (aka. client-only features) more
agnostic:
- #3552
- #3540
- #3538
- #3171
Refactor to make start packages (aka. server features) more agnostic:
- #3546
- #3563
- #3565
### Upstream changes to solid-router
- #3592
- #3591
- #3589
- #3616
### Passing E2E test suites
- [x] basic
- [x] website
- [x] scroll-restoration
- [x] server-functions
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Brenley Dueck <brenleydueck@gmail.com>
Co-authored-by: Iha Shin <me@xiniha.dev>
Co-authored-by: Brenley Dueck <brenley@crowdbotics.com>
* copy react-router
* update
* Move forward branch
* cleanup
* cleanup
* add publish
* bump deps
* ci: apply automated fixes
* remove unused imports
* ci: apply automated fixes
* bump vite plugin solid
* fix imports
* ci: apply automated fixes
* remove react lint from solid-router
* fix types
* ci: apply automated fixes
* add structuralSharing
* downgrade vite plugin solid
* fix scroll-restoration in solid-router
* fix Transitioner
* fix imports from ScrollRestoration
* Fix tests
* Fix more tests
* Remove the react $$typeof
* add accessors to useLocation
* add remountDeps
* cleanup
* remove tanstack/store
* format
* add missing call to setupScrollRestoration
* format
* add optional
* align match component
* make matches a signal
* Bump vite-plugin-solid to stable
* add missing await
* Fix unknown error
* Tweak the tests to call functions
* remove unused vars
* fix lockfile
* Down to 25 failures
* Remove .only
* call search()
* remove the structuralSharing
* fix type test
* fix structuralSharing
* comment out structured sharing validation check
* fix typings
* comment out serialization check
* comment out serialization check
* cleanup
* improve types of useSearch
* fix "when setting search params with 2 parallel navigate calls"
* fix useParams
* fix types
* fix useParams types
* cleanup debug
* fix link data loader
* fix data loader signal
* fix type test
* fix Link "when navigating away from a route with a loader that errors"
* setup on() simpler
* make initial load a createRenderEffect
* Fix some link preload tests
* add accessor to UseMatchRoute
* fix: when navigating to /posts with a beforeLoad that returns context
* call parentRouteId
* re-enable invariant
* fix when navigating from /invoices to ./invoiceId and the current route is /posts/$postId/details
* use memo for prev
* remove browserhistory workaround
* fix "after a navigation, should have emitted the "onResolved" event twice"
* skip remount
* add types to useSearch
* fix search middleware
* don't need a getter
* sync react-router
* solid kitchen sink
* add the example to workspace
* lockfile
* fix solid kitchensink name
* add solid template
* fix example
* rename react to solid
* work on example
* add accessor
* fix type tests
* Fix login in example
* Don't destructure
* Fix stuck on pending component
* Fix where loaderData can be undefined
* Use For component
* More refactor
* Hacky way to fix loading spinner
* Fix one test
* Better MatchRoute fix
* Down to 1 failing test
* Fix last test
* cleanup subscription
* lockfile
* eslint
* ci: apply automated fixes
* fix router-core lint
* ci: apply automated fixes
* add e2e test for solid-router
* ci: apply automated fixes
* work on solid-router e2e suites
* fix comment
* use solid-virtualizer
* work on scroll-restauration
* work on scroll-restauration
* skip react-specific useRenderEffect test
* fix errorcomponent being used before it's defined
* set solid target for esbuild
* ci: apply automated fixes
* fix rspack tests
* fix query tets
* add solid-query example
* use memo for post
* add memo for posts
* fix example
* add jsx compiler flags to esbuild commands
* add esbuild-plugin-solid
* Fix some e2e
* ci: apply automated fixes
* port #3423 from react-router
* fix useLoaderData test-d
* add codeSplitGroupings
* Scroll restoration fixes
* add asset headcontent script
* remove solid-router-copy
* fix react use
* fix scroll restoration test
* skip esbuild because it's broken in react-router
* wait for timeout
* update scroll-restoration to match react
* useLocation
* use on() in match
* align useNavigate with react-router
* lockfile
* fix Scripts test
* align __TSR_SSR__ in ScriptOnce
* remove solid-router from publish
* lint
* ci: apply automated fixes
* align to react-router
* port over "exclude props from state equality check to prevent history push for equal url and state"
* align with react-router
* add shouldThrow
* fix typePrimitives
* use searchStr to fix the search middleware
* ci: add solid-router to the labeler
* use patched vite-plugin-solid
* eslint
* ci: apply automated fixes
* use vite-plugin-solid 2.11.2
* remove only modifier
* move vite-plugin-solid peerDep to router-plugin
* use latest vite-plugin-solid
* move vitest to root
* bump vitest
* revert onRendered
* lint
* add to publish
* fix scroll restoration
* ci: apply automated fixes
* align version with react-router
* sync to react-router
* sync with react-router
* sync navigate tests to react-router
* ci: apply automated fixes
* use Solid.JSX.Element consistently instead of Solid.JSXElement
* remove irrelevant test
* ci: apply automated fixes
* remove unused suite
* lint
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Brenley Dueck <brenleydueck@gmail.com>
Co-authored-by: SeanCassiere <33615041+SeanCassiere@users.noreply.github.com>
* feat: scaffold the new `@tanstack/router-plugin` package
* chore: include in the overrides
* feat: more scaffolding
* test: just a random test that'll be removed later
* build: hopefully fixes build
* style: import order
* chore: peer deps for router-plugin
* feat: setup the generator
* refactor: combined needs to be done for the individual plugin
* chore: copy all the babel stuff over from router-vite-plugin
* feat: copy the babel plugin setup from router-plugin
* feat: enfore pre
* refactor: turn the error into its own custom one
* style: eslint
* style: more eslint
* chore: update the readme
* copy the router-vite-plugin into start-vite-plugin
* test: remove the tests we dont need
* export config-name from generator
* undo that last one
* reduce this down
* eliminate the router logic
* undo the touches to the generator and cli
* move this down here
* eslint
* chore: remove deps that are not needed
* test: test for createServerFn being renamed during the destructured import
* fix: handle destructured rename case
* test: handle star imports
* chore: push
* chore: remove this
There are many breaking changes in this release:
- The Router class no longer has many of the methods it had.
- Most of these methods have been moved to the new routerContext, which is served via the useRouter() hook
- React state is being used for all state management, which should set the stage for better transition/suspense support
- Router Context and route context has been renamed to Router Meta and Route Meta
- Loaders are gone. You can still force a route to wait for an async function via `beforeLoad`, which is serial or `load` which is parallel.
- There's a lot of other changes, but I'm too tired to think straight.
* getting started
* Fixed babel settings for solidjs
* Added in typescript conversions from react
* checkpoint
* ssr checkpoint
* wip
* get it working
* move shallow to @tanstack/store
* Got context and matches working
* Got routes loading and rerendering
* Built out example app for solidjs and added in loaders
* Ported over suspense and other hooks
* Added suspense component support
* Pulled in beta and updated to use stores
* fix: test & context requirements
* release: v0.0.1-beta.69
* fix: add redirects, better errorComponents, no trailing slash bug
* release: v0.0.1-beta.70
* Auto rank routes
* fix: oops
* fix: types
* docs: route matching
* docs: more
* Add missing Link import (#388)
* fix: move window focus refetching into tanstack/loaders
* fix: allow client-level window focus refetching config
* update quick-start.md, remove duplicate Link. (#517)
* fix: docs + force release
* fix: remove test
* test: fix em
* release: v0.0.1-beta.71
* fix: force search filters on router creation
* fix: hash history link generation
Fixes#457
* release: v0.0.1-beta.72
* fix: loaders window guards
* release: v0.0.1-beta.73
* docs: fix
* fix: apply stringifyParams to links
* release: v0.0.1-beta.74
* Pulling in branch changes
* Fixed babel settings for solidjs
* Added in typescript conversions from react
* wip
* get it working
* move shallow to @tanstack/store
* Rebasing
* Updated stores and app to match react-router and react-loader
---------
Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com>
Co-authored-by: Tanner Linsley <tannerlinsley@users.noreply.github.com>
Co-authored-by: Mattia Malonni <mattia.malonni@gmail.com>
Co-authored-by: Ahmed Eid <a.eid@yandex.com>
Co-authored-by: Joseph Lozano <me@josephlozano.xyz>
* Added solid actions
* Fixed issue with suspense and noted it. Added TRPC and solid-query example
* Changed the store for reactivity and created kitchen sink example
* Removed console.log
* Updating reactivity fixes
* Updated store to use reconcile
---------
Co-authored-by: Joseph Lozano <me@josephlozano.xyz>
Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com>
Co-authored-by: Tanner Linsley <tannerlinsley@users.noreply.github.com>
Co-authored-by: Mattia Malonni <mattia.malonni@gmail.com>
Co-authored-by: Ahmed Eid <a.eid@yandex.com>