feat(solid): add @effector/router-solid draft package#45
Draft
sergeysova wants to merge 3 commits into
Draft
Conversation
Add SolidJS bindings for @effector/router, mirroring the @effector/router-react API with Solid primitives (createMemo, Show, Dynamic, effector-solid useUnit). Exposes RouterProvider, Link/useLink, Outlet, createRouteView, createLazyRouteView, createRoutesView, withLayout, useRouter, useIsOpened and useOpenedViews. Reactive helpers return Solid accessors instead of plain values. Supports only the current stable major of SolidJS (1.x) via peerDependencies "solid-js": "^1.9.0". Wire-up: vite-plugin-solid build/test config (hot disabled for vitest), per-package tsconfig with jsxImportSource "solid-js" (root tsconfig excludes it), root devDependencies, ":solid" script and a changeset.
Add a small two-page example (home + post view) exercising the router: - guards /post/:id with chainRoute + an existence-check effect, so the guarded (virtual) route only opens when the post exists; - renders the guarded route in createRoutesView, so a missing post id and a malformed/unknown url both fall through to the `otherwise` 404 fallback; - covers home, existing post, missing post -> 404, bad url -> 404, and recovery from 404 back to a real page.
|
|
🦋 Changeset detectedLatest commit: af2789d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Present the new SolidJS binding alongside the other packages: - root README: packages table, workspace shortcuts, and project structure tree; - docs sidebar: add a "Solid β" section; - docs: add a Solid overview page mirroring the React one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add SolidJS bindings for @effector/router, mirroring the @effector/router-react
API with Solid primitives (createMemo, Show, Dynamic, effector-solid useUnit).
Exposes RouterProvider, Link/useLink, Outlet, createRouteView,
createLazyRouteView, createRoutesView, withLayout, useRouter, useIsOpened and
useOpenedViews. Reactive helpers return Solid accessors instead of plain values.
Supports only the current stable major of SolidJS (1.x) via
peerDependencies "solid-js": "^1.9.0".
Wire-up: vite-plugin-solid build/test config (hot disabled for vitest),
per-package tsconfig with jsxImportSource "solid-js" (root tsconfig excludes it),
root devDependencies, ":solid" script and a changeset.
Type of change
Checklist
pnpm buildpassespnpm typecheckpassespnpm testpasses and I added/updated tests for my changepnpm lintpassespnpm changeset), or an empty one for no-release changes (pnpm changeset --empty)