@wrikka/solid-framework 0.0.0-stage → 0.15.0
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/README.md +104 -3
- package/dist/vite.d.ts +661 -0
- package/dist/vite.d.ts.map +1 -0
- package/dist/vite.js +10 -0
- package/dist/vite.js.map +1 -0
- package/package.json +247 -5
- package/src/actions/index.ts +5 -0
- package/src/actions/modules/action/adapters/http/handler.ts +80 -0
- package/src/actions/modules/action/application/index.ts +1 -0
- package/src/actions/modules/action/application/usecases/create-action.ts +92 -0
- package/src/actions/modules/action/application/usecases/index.ts +2 -0
- package/src/actions/modules/action/application/usecases/registry.ts +20 -0
- package/src/actions/modules/action/index.ts +2 -0
- package/src/actions/presentation/index.ts +1 -0
- package/src/actions/presentation/useSubmission.ts +46 -0
- package/src/actions/types/index.ts +35 -0
- package/src/app/index.ts +126 -0
- package/src/app/modules/ai/domain/operations/handler.ts +46 -0
- package/src/app/modules/ai/domain/operations/llms.ts +54 -0
- package/src/app/modules/ai/domain/operations/mcp.ts +134 -0
- package/src/app/modules/ai/index.ts +3 -0
- package/src/app/modules/api-docs/domain/operations/openapi.ts +113 -0
- package/src/app/modules/api-docs/index.ts +1 -0
- package/src/app/modules/app-def/index.ts +225 -0
- package/src/app/modules/auth/application/usecases/auth.ts +161 -0
- package/src/app/modules/auth/application/usecases/oauth.ts +105 -0
- package/src/app/modules/auth/index.ts +2 -0
- package/src/app/modules/cache/adapters/edge-kv.ts +55 -0
- package/src/app/modules/cache/adapters/fs.ts +58 -0
- package/src/app/modules/cache/adapters/memory.ts +13 -0
- package/src/app/modules/cache/domain/operations/tags.ts +114 -0
- package/src/app/modules/cache/index.ts +7 -0
- package/src/app/modules/cache/ports/store.ts +14 -0
- package/src/app/modules/config/domain/index.ts +1 -0
- package/src/app/modules/config/domain/models/config.ts +72 -0
- package/src/app/modules/config/domain/models/index.ts +1 -0
- package/src/app/modules/config/index.ts +1 -0
- package/src/app/modules/content/domain/operations/collection.ts +109 -0
- package/src/app/modules/content/index.ts +8 -0
- package/src/app/modules/content/presentation/Markdown.tsx +78 -0
- package/src/app/modules/conventions/domain/index.ts +1 -0
- package/src/app/modules/conventions/domain/operations/index.ts +1 -0
- package/src/app/modules/conventions/domain/operations/scan.ts +73 -0
- package/src/app/modules/conventions/index.ts +1 -0
- package/src/app/modules/db/application/usecases/db.ts +49 -0
- package/src/app/modules/db/index.ts +1 -0
- package/src/app/modules/deploy/adapters/aws-lambda.ts +54 -0
- package/src/app/modules/deploy/adapters/bun.ts +15 -0
- package/src/app/modules/deploy/adapters/cloudflare.ts +15 -0
- package/src/app/modules/deploy/adapters/deno.ts +15 -0
- package/src/app/modules/deploy/adapters/netlify.ts +18 -0
- package/src/app/modules/deploy/adapters/node.ts +63 -0
- package/src/app/modules/deploy/adapters/vercel.ts +22 -0
- package/src/app/modules/deploy/domain/models/preset.ts +38 -0
- package/src/app/modules/deploy/domain/operations/presets.ts +92 -0
- package/src/app/modules/deploy/index.ts +9 -0
- package/src/app/modules/draft/domain/operations/draft-mode.ts +125 -0
- package/src/app/modules/draft/index.ts +1 -0
- package/src/app/modules/env/domain/operations/create-env.ts +156 -0
- package/src/app/modules/env/index.ts +1 -0
- package/src/app/modules/file-routes/application/usecases/api-client.ts +120 -0
- package/src/app/modules/file-routes/domain/errors.ts +61 -0
- package/src/app/modules/file-routes/domain/index.ts +63 -0
- package/src/app/modules/file-routes/domain/models/index.ts +1 -0
- package/src/app/modules/file-routes/domain/models/route.ts +38 -0
- package/src/app/modules/file-routes/domain/operations/actions.ts +107 -0
- package/src/app/modules/file-routes/domain/operations/api.ts +87 -0
- package/src/app/modules/file-routes/domain/operations/codegen.ts +76 -0
- package/src/app/modules/file-routes/domain/operations/content.ts +61 -0
- package/src/app/modules/file-routes/domain/operations/defer.ts +245 -0
- package/src/app/modules/file-routes/domain/operations/index.ts +65 -0
- package/src/app/modules/file-routes/domain/operations/loader.ts +138 -0
- package/src/app/modules/file-routes/domain/operations/manifest.ts +229 -0
- package/src/app/modules/file-routes/domain/operations/match.ts +75 -0
- package/src/app/modules/file-routes/domain/operations/static-params.ts +58 -0
- package/src/app/modules/file-routes/domain/operations/typed.ts +127 -0
- package/src/app/modules/file-routes/index.ts +143 -0
- package/src/app/modules/file-routes/presentation/DevtoolsOverlay.tsx +234 -0
- package/src/app/modules/file-routes/presentation/FileRoutes.ts +254 -0
- package/src/app/modules/file-routes/presentation/Form.tsx +122 -0
- package/src/app/modules/file-routes/presentation/Link.tsx +132 -0
- package/src/app/modules/file-routes/presentation/ServerComponent.tsx +100 -0
- package/src/app/modules/file-routes/presentation/content-page.tsx +26 -0
- package/src/app/modules/file-routes/presentation/dev-events.ts +112 -0
- package/src/app/modules/file-routes/presentation/index.ts +98 -0
- package/src/app/modules/file-routes/presentation/loader-cache.ts +96 -0
- package/src/app/modules/file-routes/presentation/loader-data.ts +207 -0
- package/src/app/modules/file-routes/presentation/location.ts +217 -0
- package/src/app/modules/file-routes/presentation/normalize-route.ts +155 -0
- package/src/app/modules/file-routes/presentation/page-tree.ts +211 -0
- package/src/app/modules/file-routes/presentation/route-contexts.ts +89 -0
- package/src/app/modules/file-routes/presentation/route-def.ts +154 -0
- package/src/app/modules/file-routes/presentation/route-fallbacks.ts +66 -0
- package/src/app/modules/file-routes/presentation/route-modules.ts +138 -0
- package/src/app/modules/file-routes/presentation/slot.tsx +43 -0
- package/src/app/modules/file-routes/presentation/status.ts +13 -0
- package/src/app/modules/file-routes/presentation/use-action.ts +81 -0
- package/src/app/modules/file-routes/presentation/use-optimistic.ts +50 -0
- package/src/app/modules/file-routes/presentation/use-preload.ts +38 -0
- package/src/app/modules/file-routes/presentation/use-route.ts +254 -0
- package/src/app/modules/flash/domain/operations/flash.ts +70 -0
- package/src/app/modules/flash/index.ts +1 -0
- package/src/app/modules/fonts/domain/operations/font.ts +91 -0
- package/src/app/modules/fonts/index.ts +1 -0
- package/src/app/modules/i18n/domain/operations/i18n-middleware.ts +76 -0
- package/src/app/modules/i18n/domain/operations/locale.ts +39 -0
- package/src/app/modules/i18n/index.ts +3 -0
- package/src/app/modules/i18n/presentation/use-locale.ts +16 -0
- package/src/app/modules/middleware/domain/operations/request-id.ts +33 -0
- package/src/app/modules/middleware/domain/operations/run.ts +29 -0
- package/src/app/modules/middleware/index.ts +7 -0
- package/src/app/modules/route-rules/domain/index.ts +1 -0
- package/src/app/modules/route-rules/domain/operations/ab-variant.ts +58 -0
- package/src/app/modules/route-rules/domain/operations/index.ts +4 -0
- package/src/app/modules/route-rules/domain/operations/match.ts +51 -0
- package/src/app/modules/route-rules/domain/operations/rate-limit.ts +63 -0
- package/src/app/modules/route-rules/domain/operations/security.ts +67 -0
- package/src/app/modules/route-rules/index.ts +1 -0
- package/src/app/modules/runtime-config/application/index.ts +1 -0
- package/src/app/modules/runtime-config/application/usecases/index.ts +1 -0
- package/src/app/modules/runtime-config/application/usecases/runtime-config.ts +42 -0
- package/src/app/modules/runtime-config/index.ts +1 -0
- package/src/app/modules/seo/domain/operations/og.ts +66 -0
- package/src/app/modules/seo/domain/operations/site.ts +106 -0
- package/src/app/modules/seo/index.ts +2 -0
- package/src/app/modules/server-entry/application/index.ts +1 -0
- package/src/app/modules/server-entry/application/usecases/create-app-server.ts +205 -0
- package/src/app/modules/server-entry/application/usecases/devtools-handler.ts +31 -0
- package/src/app/modules/server-entry/application/usecases/image-handler.ts +38 -0
- package/src/app/modules/server-entry/application/usecases/index.ts +3 -0
- package/src/app/modules/server-entry/application/usecases/ops-handler.ts +55 -0
- package/src/app/modules/server-entry/application/usecases/prerender-cache.ts +59 -0
- package/src/app/modules/server-entry/application/usecases/route-render.ts +276 -0
- package/src/app/modules/server-entry/application/usecases/routed-entry.ts +194 -0
- package/src/app/modules/server-entry/application/usecases/static-handler.ts +20 -0
- package/src/app/modules/server-entry/application/usecases/zone-handler.ts +37 -0
- package/src/app/modules/server-entry/index.ts +1 -0
- package/src/app/modules/session/index.ts +77 -0
- package/src/app/modules/static/domain/operations/serve.ts +88 -0
- package/src/app/modules/static/index.ts +1 -0
- package/src/app/presentation/App.tsx +34 -0
- package/src/app/presentation/define-config.ts +11 -0
- package/src/app/presentation/index.ts +3 -0
- package/src/app/presentation/providers.ts +80 -0
- package/src/app/types/index.ts +273 -0
- package/src/assets/adapters/sharp.ts +83 -0
- package/src/assets/index.ts +6 -0
- package/src/assets/modules/assets/domain/index.ts +1 -0
- package/src/assets/modules/assets/domain/operations/image.ts +67 -0
- package/src/assets/modules/assets/domain/operations/index.ts +2 -0
- package/src/assets/modules/assets/domain/operations/manifest.ts +29 -0
- package/src/assets/modules/assets/index.ts +1 -0
- package/src/assets/presentation/Image.tsx +90 -0
- package/src/assets/presentation/index.ts +1 -0
- package/src/assets/types/index.ts +21 -0
- package/src/cli/bin.ts +8 -0
- package/src/cli/commands.ts +145 -0
- package/src/cli/doctor.ts +111 -0
- package/src/cli/index.ts +3 -0
- package/src/cli/infra.ts +38 -0
- package/src/cli/migrate.ts +119 -0
- package/src/cli/nav.ts +164 -0
- package/src/cli/ops.ts +135 -0
- package/src/cli/routes.ts +240 -0
- package/src/cli/scaffold.ts +217 -0
- package/src/devtools/App.tsx +14 -0
- package/src/devtools/adapters/connector.ts +23 -0
- package/src/devtools/adapters/index.ts +4 -0
- package/src/devtools/index.ts +26 -0
- package/src/devtools/modules/component-inspector/application/index.ts +4 -0
- package/src/devtools/modules/component-inspector/application/usecases/component-inspector.ts +67 -0
- package/src/devtools/modules/component-inspector/application/usecases/index.ts +5 -0
- package/src/devtools/modules/component-inspector/application/usecases/useComponentInspector.ts +52 -0
- package/src/devtools/modules/component-inspector/domain/events/component-events.ts +37 -0
- package/src/devtools/modules/component-inspector/domain/events/index.ts +4 -0
- package/src/devtools/modules/component-inspector/domain/index.ts +7 -0
- package/src/devtools/modules/component-inspector/domain/models/component-node.ts +30 -0
- package/src/devtools/modules/component-inspector/domain/models/component-tree.ts +20 -0
- package/src/devtools/modules/component-inspector/domain/models/index.ts +5 -0
- package/src/devtools/modules/component-inspector/domain/operations/component-operations.ts +63 -0
- package/src/devtools/modules/component-inspector/domain/operations/index.ts +4 -0
- package/src/devtools/modules/component-inspector/index.ts +7 -0
- package/src/devtools/modules/devtools/application/index.ts +4 -0
- package/src/devtools/modules/devtools/application/usecases/devtools.ts +60 -0
- package/src/devtools/modules/devtools/application/usecases/index.ts +5 -0
- package/src/devtools/modules/devtools/application/usecases/useDevtools.ts +47 -0
- package/src/devtools/modules/devtools/domain/events/devtools-events.ts +56 -0
- package/src/devtools/modules/devtools/domain/events/index.ts +4 -0
- package/src/devtools/modules/devtools/domain/index.ts +8 -0
- package/src/devtools/modules/devtools/domain/models/devtools-state.ts +15 -0
- package/src/devtools/modules/devtools/domain/models/index.ts +4 -0
- package/src/devtools/modules/devtools/domain/operations/devtools-operations.ts +27 -0
- package/src/devtools/modules/devtools/domain/operations/index.ts +4 -0
- package/src/devtools/modules/devtools/domain/validators/devtools-validators.ts +36 -0
- package/src/devtools/modules/devtools/domain/validators/index.ts +4 -0
- package/src/devtools/modules/devtools/index.ts +7 -0
- package/src/devtools/modules/devtools/ports/connector.ts +10 -0
- package/src/devtools/modules/devtools/ports/index.ts +4 -0
- package/src/devtools/modules/timeline/application/index.ts +4 -0
- package/src/devtools/modules/timeline/application/usecases/index.ts +5 -0
- package/src/devtools/modules/timeline/application/usecases/timeline.ts +61 -0
- package/src/devtools/modules/timeline/application/usecases/useTimeline.ts +37 -0
- package/src/devtools/modules/timeline/domain/events/index.ts +4 -0
- package/src/devtools/modules/timeline/domain/events/timeline-events.ts +34 -0
- package/src/devtools/modules/timeline/domain/index.ts +7 -0
- package/src/devtools/modules/timeline/domain/models/index.ts +4 -0
- package/src/devtools/modules/timeline/domain/models/timeline-event.ts +27 -0
- package/src/devtools/modules/timeline/domain/operations/index.ts +4 -0
- package/src/devtools/modules/timeline/domain/operations/timeline-operations.ts +28 -0
- package/src/devtools/modules/timeline/index.ts +7 -0
- package/src/devtools/presentation/DevtoolsPanel.tsx +80 -0
- package/src/devtools/presentation/components/ComponentTreeView.tsx +79 -0
- package/src/devtools/presentation/components/StateInspector.tsx +70 -0
- package/src/devtools/presentation/components/TimelineView.tsx +52 -0
- package/src/devtools/presentation/components/index.ts +7 -0
- package/src/devtools/presentation/composables/index.ts +7 -0
- package/src/devtools/presentation/composables/useComponentInspector.ts +52 -0
- package/src/devtools/presentation/index.ts +5 -0
- package/src/devtools/shared/errors/index.ts +23 -0
- package/src/devtools/shared/index.ts +7 -0
- package/src/devtools/shared/types/index.ts +6 -0
- package/src/devtools/shared/types/option.ts +58 -0
- package/src/devtools/shared/types/result.ts +53 -0
- package/src/devtools/shared/utils/index.ts +32 -0
- package/src/devtools/style.css +2 -0
- package/src/head/index.ts +5 -0
- package/src/head/modules/head/application/index.ts +1 -0
- package/src/head/modules/head/application/usecases/head-manager.ts +68 -0
- package/src/head/modules/head/application/usecases/index.ts +1 -0
- package/src/head/modules/head/domain/index.ts +3 -0
- package/src/head/modules/head/domain/models/head-tag.ts +73 -0
- package/src/head/modules/head/domain/models/index.ts +1 -0
- package/src/head/modules/head/domain/operations/dedupe.ts +18 -0
- package/src/head/modules/head/domain/operations/index.ts +2 -0
- package/src/head/modules/head/domain/operations/render-tags.ts +43 -0
- package/src/head/modules/head/domain/validators/index.ts +12 -0
- package/src/head/modules/head/index.ts +3 -0
- package/src/head/modules/head/ports/index.ts +11 -0
- package/src/head/presentation/HeadProvider.tsx +42 -0
- package/src/head/presentation/Tags.tsx +90 -0
- package/src/head/presentation/head-context.ts +11 -0
- package/src/head/presentation/index.ts +3 -0
- package/src/head/presentation/useHead.ts +77 -0
- package/src/head/shared/index.ts +1 -0
- package/src/head/shared/types/index.ts +5 -0
- package/src/head/types/index.ts +47 -0
- package/src/hooks/adapters/config/constants.ts +12 -0
- package/src/hooks/adapters/config/index.ts +48 -0
- package/src/hooks/adapters/index.ts +13 -0
- package/src/hooks/adapters/monaco/index.ts +96 -0
- package/src/hooks/adapters/qr/index.ts +65 -0
- package/src/hooks/index.ts +21 -0
- package/src/hooks/modules/array/application/index.ts +2 -0
- package/src/hooks/modules/array/application/usecases/index.ts +123 -0
- package/src/hooks/modules/array/domain/events/index.ts +5 -0
- package/src/hooks/modules/array/domain/index.ts +3 -0
- package/src/hooks/modules/array/domain/models/index.ts +2 -0
- package/src/hooks/modules/array/domain/operations/create.ts +10 -0
- package/src/hooks/modules/array/domain/operations/index.ts +31 -0
- package/src/hooks/modules/array/domain/operations/modify.ts +61 -0
- package/src/hooks/modules/array/domain/operations/query.ts +36 -0
- package/src/hooks/modules/array/domain/validators/index.ts +5 -0
- package/src/hooks/modules/array/index.ts +5 -0
- package/src/hooks/modules/array/types/index.ts +9 -0
- package/src/hooks/modules/counter/application/index.ts +12 -0
- package/src/hooks/modules/counter/application/usecases/index.ts +156 -0
- package/src/hooks/modules/counter/domain/events/index.ts +6 -0
- package/src/hooks/modules/counter/domain/index.ts +21 -0
- package/src/hooks/modules/counter/domain/models/index.ts +2 -0
- package/src/hooks/modules/counter/domain/operations/calculate.ts +22 -0
- package/src/hooks/modules/counter/domain/operations/create.ts +22 -0
- package/src/hooks/modules/counter/domain/operations/index.ts +25 -0
- package/src/hooks/modules/counter/domain/operations/modify.ts +78 -0
- package/src/hooks/modules/counter/domain/operations/query.ts +38 -0
- package/src/hooks/modules/counter/domain/operations/validate.ts +58 -0
- package/src/hooks/modules/counter/domain/validators/counter-validators.ts +19 -0
- package/src/hooks/modules/counter/domain/validators/index.ts +2 -0
- package/src/hooks/modules/counter/index.ts +6 -0
- package/src/hooks/modules/counter/ports/index.ts +7 -0
- package/src/hooks/modules/counter/types/index.ts +13 -0
- package/src/hooks/modules/editor/application/index.ts +6 -0
- package/src/hooks/modules/editor/application/useCodeEditor.ts +81 -0
- package/src/hooks/modules/editor/domain/events/editor-events.ts +16 -0
- package/src/hooks/modules/editor/domain/events/index.ts +6 -0
- package/src/hooks/modules/editor/domain/index.ts +7 -0
- package/src/hooks/modules/editor/domain/models/editor.ts +16 -0
- package/src/hooks/modules/editor/domain/models/index.ts +6 -0
- package/src/hooks/modules/editor/domain/validators/index.ts +34 -0
- package/src/hooks/modules/editor/index.ts +8 -0
- package/src/hooks/modules/editor/types/index.ts +34 -0
- package/src/hooks/modules/sensor/application/index.ts +2 -0
- package/src/hooks/modules/sensor/application/usecases/index.ts +25 -0
- package/src/hooks/modules/sensor/domain/events/index.ts +12 -0
- package/src/hooks/modules/sensor/domain/index.ts +10 -0
- package/src/hooks/modules/sensor/domain/models/index.ts +7 -0
- package/src/hooks/modules/sensor/domain/operations/gamepad.ts +16 -0
- package/src/hooks/modules/sensor/domain/operations/index.ts +12 -0
- package/src/hooks/modules/sensor/domain/operations/motion.ts +10 -0
- package/src/hooks/modules/sensor/domain/operations/orientation.ts +10 -0
- package/src/hooks/modules/sensor/domain/validators/index.ts +2 -0
- package/src/hooks/modules/sensor/index.ts +10 -0
- package/src/hooks/modules/sensor/ports/index.ts +8 -0
- package/src/hooks/modules/sensor/types/index.ts +29 -0
- package/src/hooks/modules/storage/application/index.ts +2 -0
- package/src/hooks/modules/storage/application/usecases/index.ts +18 -0
- package/src/hooks/modules/storage/domain/events/index.ts +5 -0
- package/src/hooks/modules/storage/domain/index.ts +6 -0
- package/src/hooks/modules/storage/domain/models/index.ts +6 -0
- package/src/hooks/modules/storage/domain/models/storage.ts +11 -0
- package/src/hooks/modules/storage/domain/operations/index.ts +8 -0
- package/src/hooks/modules/storage/domain/operations/serialize.ts +22 -0
- package/src/hooks/modules/storage/domain/operations/validate.ts +7 -0
- package/src/hooks/modules/storage/domain/validators/index.ts +2 -0
- package/src/hooks/modules/storage/index.ts +6 -0
- package/src/hooks/modules/storage/ports/index.ts +7 -0
- package/src/hooks/modules/storage/types/index.ts +6 -0
- package/src/hooks/modules/time/application/index.ts +2 -0
- package/src/hooks/modules/time/application/usecases/index.ts +5 -0
- package/src/hooks/modules/time/application/usecases/use-debounce.ts +10 -0
- package/src/hooks/modules/time/application/usecases/use-interval.ts +10 -0
- package/src/hooks/modules/time/application/usecases/use-throttle.ts +10 -0
- package/src/hooks/modules/time/application/usecases/use-timeout.ts +10 -0
- package/src/hooks/modules/time/domain/events/index.ts +6 -0
- package/src/hooks/modules/time/domain/index.ts +12 -0
- package/src/hooks/modules/time/domain/models/index.ts +6 -0
- package/src/hooks/modules/time/domain/models/time.ts +16 -0
- package/src/hooks/modules/time/domain/operations/calculate.ts +8 -0
- package/src/hooks/modules/time/domain/operations/index.ts +11 -0
- package/src/hooks/modules/time/domain/operations/validate.ts +11 -0
- package/src/hooks/modules/time/domain/validators/index.ts +2 -0
- package/src/hooks/modules/time/index.ts +5 -0
- package/src/hooks/modules/time/ports/index.ts +9 -0
- package/src/hooks/modules/time/types/index.ts +18 -0
- package/src/hooks/modules/toggle/application/index.ts +2 -0
- package/src/hooks/modules/toggle/application/usecases/index.ts +48 -0
- package/src/hooks/modules/toggle/domain/events/index.ts +4 -0
- package/src/hooks/modules/toggle/domain/index.ts +11 -0
- package/src/hooks/modules/toggle/domain/models/index.ts +7 -0
- package/src/hooks/modules/toggle/domain/operations/create.ts +11 -0
- package/src/hooks/modules/toggle/domain/operations/index.ts +12 -0
- package/src/hooks/modules/toggle/domain/operations/modify.ts +18 -0
- package/src/hooks/modules/toggle/domain/operations/query.ts +9 -0
- package/src/hooks/modules/toggle/domain/validators/index.ts +2 -0
- package/src/hooks/modules/toggle/index.ts +6 -0
- package/src/hooks/modules/toggle/ports/index.ts +5 -0
- package/src/hooks/modules/toggle/types/index.ts +9 -0
- package/src/hooks/presentation/index.ts +2 -0
- package/src/hooks/presentation/solid/animation/index.ts +11 -0
- package/src/hooks/presentation/solid/animation/useElapsedTime.ts +75 -0
- package/src/hooks/presentation/solid/animation/useInterval.ts +68 -0
- package/src/hooks/presentation/solid/animation/useIntervalFn.ts +54 -0
- package/src/hooks/presentation/solid/animation/useNow.ts +57 -0
- package/src/hooks/presentation/solid/animation/useRafFn.ts +57 -0
- package/src/hooks/presentation/solid/animation/useTimeout.ts +55 -0
- package/src/hooks/presentation/solid/animation/useTimeoutFn.ts +55 -0
- package/src/hooks/presentation/solid/animation/useTimestamp.ts +61 -0
- package/src/hooks/presentation/solid/animation/useTransition.ts +87 -0
- package/src/hooks/presentation/solid/array/index.ts +14 -0
- package/src/hooks/presentation/solid/array/useArrayConcat.ts +18 -0
- package/src/hooks/presentation/solid/array/useArrayEvery.ts +8 -0
- package/src/hooks/presentation/solid/array/useArrayFilter.ts +8 -0
- package/src/hooks/presentation/solid/array/useArrayFind.ts +8 -0
- package/src/hooks/presentation/solid/array/useArrayIncludes.ts +8 -0
- package/src/hooks/presentation/solid/array/useArrayMap.ts +8 -0
- package/src/hooks/presentation/solid/array/useArrayPop.ts +18 -0
- package/src/hooks/presentation/solid/array/useArrayPush.ts +15 -0
- package/src/hooks/presentation/solid/array/useArrayReduce.ts +9 -0
- package/src/hooks/presentation/solid/array/useArrayShift.ts +18 -0
- package/src/hooks/presentation/solid/array/useArraySome.ts +8 -0
- package/src/hooks/presentation/solid/array/useArraySort.ts +12 -0
- package/src/hooks/presentation/solid/browser/index.ts +35 -0
- package/src/hooks/presentation/solid/browser/useBarcode.ts +15 -0
- package/src/hooks/presentation/solid/browser/useBattery.ts +37 -0
- package/src/hooks/presentation/solid/browser/useBeacon.ts +4 -0
- package/src/hooks/presentation/solid/browser/useBluetooth.ts +15 -0
- package/src/hooks/presentation/solid/browser/useClipboard.ts +17 -0
- package/src/hooks/presentation/solid/browser/useClipboardAdvanced.ts +54 -0
- package/src/hooks/presentation/solid/browser/useConnection.ts +22 -0
- package/src/hooks/presentation/solid/browser/useCredential.ts +18 -0
- package/src/hooks/presentation/solid/browser/useDisplayMedia.ts +24 -0
- package/src/hooks/presentation/solid/browser/useFaceDetection.ts +20 -0
- package/src/hooks/presentation/solid/browser/useFullscreen.ts +33 -0
- package/src/hooks/presentation/solid/browser/useGeolocation.ts +64 -0
- package/src/hooks/presentation/solid/browser/useLocalStorage.ts +11 -0
- package/src/hooks/presentation/solid/browser/useMediaDevices.ts +24 -0
- package/src/hooks/presentation/solid/browser/useMemory.ts +9 -0
- package/src/hooks/presentation/solid/browser/useNetwork.ts +43 -0
- package/src/hooks/presentation/solid/browser/useNotification.ts +21 -0
- package/src/hooks/presentation/solid/browser/usePayment.ts +17 -0
- package/src/hooks/presentation/solid/browser/usePerformance.ts +13 -0
- package/src/hooks/presentation/solid/browser/usePush.ts +12 -0
- package/src/hooks/presentation/solid/browser/useQrCode.ts +11 -0
- package/src/hooks/presentation/solid/browser/useScreenOrientation.ts +37 -0
- package/src/hooks/presentation/solid/browser/useServiceWorker.ts +29 -0
- package/src/hooks/presentation/solid/browser/useSessionStorage.ts +11 -0
- package/src/hooks/presentation/solid/browser/useShare.ts +12 -0
- package/src/hooks/presentation/solid/browser/useSpeechRecognition.ts +71 -0
- package/src/hooks/presentation/solid/browser/useSpeechSynthesis.ts +54 -0
- package/src/hooks/presentation/solid/browser/useStorage.ts +22 -0
- package/src/hooks/presentation/solid/browser/useTextDetection.ts +20 -0
- package/src/hooks/presentation/solid/browser/useUsb.ts +15 -0
- package/src/hooks/presentation/solid/browser/useUserMedia.ts +24 -0
- package/src/hooks/presentation/solid/browser/useVibration.ts +12 -0
- package/src/hooks/presentation/solid/browser/useWakeLock.ts +29 -0
- package/src/hooks/presentation/solid/browser/useWebAuthn.ts +35 -0
- package/src/hooks/presentation/solid/elements/index.ts +51 -0
- package/src/hooks/presentation/solid/elements/useActive.ts +33 -0
- package/src/hooks/presentation/solid/elements/useAudio.ts +82 -0
- package/src/hooks/presentation/solid/elements/useBreakpoints.ts +56 -0
- package/src/hooks/presentation/solid/elements/useCanvas.ts +43 -0
- package/src/hooks/presentation/solid/elements/useClick.ts +49 -0
- package/src/hooks/presentation/solid/elements/useDrag.ts +56 -0
- package/src/hooks/presentation/solid/elements/useDraggable.ts +57 -0
- package/src/hooks/presentation/solid/elements/useDraggableHandle.ts +92 -0
- package/src/hooks/presentation/solid/elements/useDrop.ts +54 -0
- package/src/hooks/presentation/solid/elements/useDropZone.ts +67 -0
- package/src/hooks/presentation/solid/elements/useElementBounding.ts +52 -0
- package/src/hooks/presentation/solid/elements/useElementSize.ts +30 -0
- package/src/hooks/presentation/solid/elements/useElementVisibility.ts +33 -0
- package/src/hooks/presentation/solid/elements/useFileDialog.ts +33 -0
- package/src/hooks/presentation/solid/elements/useFileInput.ts +20 -0
- package/src/hooks/presentation/solid/elements/useFocus.ts +49 -0
- package/src/hooks/presentation/solid/elements/useHover.ts +33 -0
- package/src/hooks/presentation/solid/elements/useImagePreview.ts +27 -0
- package/src/hooks/presentation/solid/elements/useImageUpload.ts +66 -0
- package/src/hooks/presentation/solid/elements/useInfiniteScroll.ts +52 -0
- package/src/hooks/presentation/solid/elements/useIntersectionAdvanced.ts +43 -0
- package/src/hooks/presentation/solid/elements/useIntersectionObserver.ts +40 -0
- package/src/hooks/presentation/solid/elements/useLayout.ts +47 -0
- package/src/hooks/presentation/solid/elements/useLongPress.ts +54 -0
- package/src/hooks/presentation/solid/elements/useMagicKeys.ts +60 -0
- package/src/hooks/presentation/solid/elements/useMediaQuery.ts +24 -0
- package/src/hooks/presentation/solid/elements/useModal.ts +24 -0
- package/src/hooks/presentation/solid/elements/useMouse.ts +51 -0
- package/src/hooks/presentation/solid/elements/useMutationObserver.ts +38 -0
- package/src/hooks/presentation/solid/elements/useOnClickOutside.ts +25 -0
- package/src/hooks/presentation/solid/elements/useOnKeyStroke.ts +33 -0
- package/src/hooks/presentation/solid/elements/useParallax.ts +34 -0
- package/src/hooks/presentation/solid/elements/usePerformanceObserver.ts +30 -0
- package/src/hooks/presentation/solid/elements/usePinch.ts +61 -0
- package/src/hooks/presentation/solid/elements/usePopover.ts +54 -0
- package/src/hooks/presentation/solid/elements/useResize.ts +34 -0
- package/src/hooks/presentation/solid/elements/useResizeObserver.ts +42 -0
- package/src/hooks/presentation/solid/elements/useRotate.ts +42 -0
- package/src/hooks/presentation/solid/elements/useScroll.ts +97 -0
- package/src/hooks/presentation/solid/elements/useScrollTo.ts +30 -0
- package/src/hooks/presentation/solid/elements/useSortable.ts +22 -0
- package/src/hooks/presentation/solid/elements/useSplitter.ts +61 -0
- package/src/hooks/presentation/solid/elements/useSticky.ts +33 -0
- package/src/hooks/presentation/solid/elements/useSvg.ts +31 -0
- package/src/hooks/presentation/solid/elements/useSwipe.ts +87 -0
- package/src/hooks/presentation/solid/elements/useTabs.ts +44 -0
- package/src/hooks/presentation/solid/elements/useTooltip.ts +57 -0
- package/src/hooks/presentation/solid/elements/useVideo.ts +83 -0
- package/src/hooks/presentation/solid/elements/useVirtualList.ts +43 -0
- package/src/hooks/presentation/solid/elements/useWebgl.ts +36 -0
- package/src/hooks/presentation/solid/index.ts +11 -0
- package/src/hooks/presentation/solid/math/index.ts +10 -0
- package/src/hooks/presentation/solid/math/useAbs.ts +9 -0
- package/src/hooks/presentation/solid/math/useCeil.ts +9 -0
- package/src/hooks/presentation/solid/math/useClamp.ts +24 -0
- package/src/hooks/presentation/solid/math/useExp.ts +9 -0
- package/src/hooks/presentation/solid/math/useFloor.ts +9 -0
- package/src/hooks/presentation/solid/math/useLog.ts +21 -0
- package/src/hooks/presentation/solid/math/useMath.ts +3 -0
- package/src/hooks/presentation/solid/math/useOffset.ts +20 -0
- package/src/hooks/presentation/solid/math/usePow.ts +16 -0
- package/src/hooks/presentation/solid/math/useRound.ts +24 -0
- package/src/hooks/presentation/solid/math/useSign.ts +9 -0
- package/src/hooks/presentation/solid/math/useSqrt.ts +9 -0
- package/src/hooks/presentation/solid/network/index.ts +5 -0
- package/src/hooks/presentation/solid/network/useEventSource.ts +87 -0
- package/src/hooks/presentation/solid/network/useFetch.ts +187 -0
- package/src/hooks/presentation/solid/network/useWebSocket.ts +120 -0
- package/src/hooks/presentation/solid/sensors/index.ts +21 -0
- package/src/hooks/presentation/solid/sensors/useAbsoluteOrientation.ts +41 -0
- package/src/hooks/presentation/solid/sensors/useAccelerometer.ts +39 -0
- package/src/hooks/presentation/solid/sensors/useAmbientLight.ts +35 -0
- package/src/hooks/presentation/solid/sensors/useDeviceMotion.ts +50 -0
- package/src/hooks/presentation/solid/sensors/useDeviceOrientation.ts +38 -0
- package/src/hooks/presentation/solid/sensors/useGamepad.ts +52 -0
- package/src/hooks/presentation/solid/sensors/useGamepadRumble.ts +28 -0
- package/src/hooks/presentation/solid/sensors/useGravity.ts +39 -0
- package/src/hooks/presentation/solid/sensors/useGyroscope.ts +39 -0
- package/src/hooks/presentation/solid/sensors/useHID.ts +19 -0
- package/src/hooks/presentation/solid/sensors/useLinearAcceleration.ts +41 -0
- package/src/hooks/presentation/solid/sensors/useMagnetometer.ts +39 -0
- package/src/hooks/presentation/solid/sensors/useMotion.ts +31 -0
- package/src/hooks/presentation/solid/sensors/useNFC.ts +19 -0
- package/src/hooks/presentation/solid/sensors/usePressure.ts +35 -0
- package/src/hooks/presentation/solid/sensors/useProximity.ts +38 -0
- package/src/hooks/presentation/solid/sensors/useRelativeOrientation.ts +41 -0
- package/src/hooks/presentation/solid/sensors/useSerial.ts +18 -0
- package/src/hooks/presentation/solid/sensors/useShake.ts +54 -0
- package/src/hooks/presentation/solid/sensors/useTilt.ts +31 -0
- package/src/hooks/presentation/solid/state/createSharedComposable.ts +24 -0
- package/src/hooks/presentation/solid/state/index.ts +14 -0
- package/src/hooks/presentation/solid/state/reactivity.ts +43 -0
- package/src/hooks/presentation/solid/state/refDebounced.ts +27 -0
- package/src/hooks/presentation/solid/state/refThrottled.ts +39 -0
- package/src/hooks/presentation/solid/state/syncRef.ts +24 -0
- package/src/hooks/presentation/solid/state/toRef.ts +18 -0
- package/src/hooks/presentation/solid/state/useArray.ts +55 -0
- package/src/hooks/presentation/solid/state/useCounter.ts +24 -0
- package/src/hooks/presentation/solid/state/useToggle.ts +20 -0
- package/src/hooks/presentation/solid/time/index.ts +6 -0
- package/src/hooks/presentation/solid/time/useDebounceFn.ts +18 -0
- package/src/hooks/presentation/solid/time/useInterval.ts +44 -0
- package/src/hooks/presentation/solid/time/useThrottleFn.ts +30 -0
- package/src/hooks/presentation/solid/time/useTimeout.ts +37 -0
- package/src/hooks/presentation/solid/time/watchDebounced.ts +19 -0
- package/src/hooks/presentation/solid/time/watchPausable.ts +29 -0
- package/src/hooks/presentation/solid/time/whenever.ts +13 -0
- package/src/hooks/presentation/solid/utilities/index.ts +8 -0
- package/src/hooks/presentation/solid/utilities/useArrayEvery.ts +8 -0
- package/src/hooks/presentation/solid/utilities/useArrayFilter.ts +11 -0
- package/src/hooks/presentation/solid/utilities/useArrayFind.ts +8 -0
- package/src/hooks/presentation/solid/utilities/useArrayIncludes.ts +8 -0
- package/src/hooks/presentation/solid/utilities/useArrayMap.ts +8 -0
- package/src/hooks/presentation/solid/utilities/useArrayReduce.ts +9 -0
- package/src/hooks/presentation/solid/utilities/useArraySome.ts +8 -0
- package/src/hooks/presentation/solid/utilities/useArraySort.ts +12 -0
- package/src/hooks/presentation/solid/utilities/useClamp.ts +24 -0
- package/src/hooks/presentation/solid/utilities/useDebounce.ts +32 -0
- package/src/hooks/presentation/solid/utilities/useEventBus.ts +57 -0
- package/src/hooks/presentation/solid/utilities/useMemoize.ts +15 -0
- package/src/hooks/presentation/solid/utilities/useOffset.ts +20 -0
- package/src/hooks/presentation/solid/utilities/useRound.ts +24 -0
- package/src/hooks/presentation/solid/utilities/useSorted.ts +12 -0
- package/src/hooks/presentation/solid/utilities/useThrottle.ts +44 -0
- package/src/hooks/presentation/solid/utilities/useToNumber.ts +11 -0
- package/src/hooks/presentation/solid/utilities/useToString.ts +10 -0
- package/src/hooks/realtime/use-sse.ts +70 -0
- package/src/hooks/shared/constants/index.ts +4 -0
- package/src/hooks/shared/errors/index.ts +1 -0
- package/src/hooks/shared/errors/validation-error.ts +28 -0
- package/src/hooks/shared/index.ts +8 -0
- package/src/hooks/shared/types/index.ts +17 -0
- package/src/hooks/shared/types/option.ts +17 -0
- package/src/hooks/shared/types/result.ts +34 -0
- package/src/hooks/shared/types/utilities.ts +102 -0
- package/src/hooks/shared/utils/identity.ts +2 -0
- package/src/hooks/shared/utils/index.ts +4 -0
- package/src/hooks/shared/utils/logger.ts +69 -0
- package/src/hooks/shared/utils/pipe.ts +5 -0
- package/src/hooks/shared/utils/result.ts +9 -0
- package/src/hooks/test/counter.test.ts +25 -0
- package/src/index.ts +16 -0
- package/src/internal.ts +61 -0
- package/src/query/adapters/devtools/index.ts +29 -0
- package/src/query/adapters/persistence/index.ts +62 -0
- package/src/query/adapters/solid/index.ts +10 -0
- package/src/query/adapters/solid/solid-query-context.ts +29 -0
- package/src/query/adapters/solid/solid-query-empty-result.ts +34 -0
- package/src/query/adapters/solid/solid-query-options.ts +52 -0
- package/src/query/adapters/solid/solid-query-use-infinite.ts +228 -0
- package/src/query/adapters/solid/solid-query-use-mutation.ts +54 -0
- package/src/query/adapters/solid/solid-query-use-query.ts +75 -0
- package/src/query/adapters/solid/solid.test.ts +53 -0
- package/src/query/adapters/validation/index.ts +20 -0
- package/src/query/index.test.ts +203 -0
- package/src/query/index.ts +4 -0
- package/src/query/modules/query/application/usecases/query-client-data.ts +29 -0
- package/src/query/modules/query/application/usecases/query-client-helpers.ts +49 -0
- package/src/query/modules/query/application/usecases/query-client-infinite.ts +39 -0
- package/src/query/modules/query/application/usecases/query-client.ts +251 -0
- package/src/query/modules/query/domain/models/mutation-cache.ts +115 -0
- package/src/query/modules/query/domain/models/mutation.ts +207 -0
- package/src/query/modules/query/domain/models/query-cache.ts +119 -0
- package/src/query/modules/query/domain/models/query-environment.ts +16 -0
- package/src/query/modules/query/domain/models/query-observer.ts +162 -0
- package/src/query/modules/query/domain/models/query-operations.ts +76 -0
- package/src/query/modules/query/domain/models/query.ts +239 -0
- package/src/query/modules/query/domain/operations/index.ts +76 -0
- package/src/query/modules/query/index.ts +9 -0
- package/src/query/modules/query/ports/index.ts +53 -0
- package/src/query/modules/query/types/index.ts +239 -0
- package/src/query/shared/index.ts +48 -0
- package/src/render/adapters/index.ts +1 -0
- package/src/render/adapters/solid-web/hydration.ts +35 -0
- package/src/render/adapters/solid-web/index.ts +3 -0
- package/src/render/adapters/solid-web/renderer.ts +20 -0
- package/src/render/index.ts +7 -0
- package/src/render/modules/render/application/index.ts +1 -0
- package/src/render/modules/render/application/usecases/index.ts +4 -0
- package/src/render/modules/render/application/usecases/remote-island.ts +46 -0
- package/src/render/modules/render/application/usecases/render-page.ts +86 -0
- package/src/render/modules/render/application/usecases/render-shell.ts +56 -0
- package/src/render/modules/render/application/usecases/stream-page.ts +159 -0
- package/src/render/modules/render/domain/index.ts +3 -0
- package/src/render/modules/render/domain/models/context.ts +34 -0
- package/src/render/modules/render/domain/models/document.ts +26 -0
- package/src/render/modules/render/domain/models/index.ts +2 -0
- package/src/render/modules/render/domain/operations/document.ts +58 -0
- package/src/render/modules/render/domain/operations/hydration.ts +58 -0
- package/src/render/modules/render/domain/operations/index.ts +3 -0
- package/src/render/modules/render/domain/operations/rsc.ts +53 -0
- package/src/render/modules/render/domain/validators/index.ts +11 -0
- package/src/render/modules/render/index.ts +3 -0
- package/src/render/modules/render/ports/index.ts +17 -0
- package/src/render/presentation/ClientComponent.tsx +42 -0
- package/src/render/presentation/Document.tsx +45 -0
- package/src/render/presentation/Island.tsx +146 -0
- package/src/render/presentation/RemoteIsland.tsx +68 -0
- package/src/render/presentation/entries.ts +83 -0
- package/src/render/presentation/index.ts +5 -0
- package/src/render/shared/index.ts +2 -0
- package/src/render/shared/types/index.ts +9 -0
- package/src/render/shared/utils/index.ts +1 -0
- package/src/render/shared/utils/result.ts +30 -0
- package/src/render/types/index.ts +58 -0
- package/src/router/adapters/index.ts +1 -0
- package/src/router/adapters/solid-start/index.ts +42 -0
- package/src/router/cli/bundle-analyzer.ts +142 -0
- package/src/router/cli/index.ts +3 -0
- package/src/router/cli/migration-cli.ts +217 -0
- package/src/router/cli/route-generator-config.ts +109 -0
- package/src/router/cli/route-generator-templates.ts +117 -0
- package/src/router/cli/route-generator-types.ts +9 -0
- package/src/router/cli/route-generator-utils.ts +40 -0
- package/src/router/cli/route-generator.ts +64 -0
- package/src/router/index.test.ts +7 -0
- package/src/router/index.ts +21 -0
- package/src/router/modules/navigation/application/index.ts +1 -0
- package/src/router/modules/navigation/application/usecases.ts +42 -0
- package/src/router/modules/navigation/domain/index.ts +2 -0
- package/src/router/modules/navigation/domain/models.ts +44 -0
- package/src/router/modules/navigation/domain/operations.ts +28 -0
- package/src/router/modules/navigation/index.ts +3 -0
- package/src/router/modules/navigation/types/index.ts +15 -0
- package/src/router/modules/route-cache/application/usecases/index.ts +74 -0
- package/src/router/modules/route-cache/domain/models/index.ts +63 -0
- package/src/router/modules/route-cache/domain/operations/cache-evict.ts +104 -0
- package/src/router/modules/route-cache/domain/operations/cache-invalidate.ts +101 -0
- package/src/router/modules/route-cache/domain/operations/cache-read.ts +74 -0
- package/src/router/modules/route-cache/domain/operations/cache-write.ts +62 -0
- package/src/router/modules/route-cache/domain/operations/index.ts +4 -0
- package/src/router/modules/route-cache/domain/validators/index.ts +25 -0
- package/src/router/modules/route-cache/index.ts +8 -0
- package/src/router/modules/route-cache/ports/index.ts +20 -0
- package/src/router/modules/route-cache/types/index.ts +8 -0
- package/src/router/modules/route-error-tracking/application/usecases/index.ts +182 -0
- package/src/router/modules/route-error-tracking/domain/index.ts +5 -0
- package/src/router/modules/route-error-tracking/domain/models/index.ts +130 -0
- package/src/router/modules/route-error-tracking/domain/operations/error-cleanup.ts +50 -0
- package/src/router/modules/route-error-tracking/domain/operations/error-queries.ts +103 -0
- package/src/router/modules/route-error-tracking/domain/operations/error-recording.ts +112 -0
- package/src/router/modules/route-error-tracking/domain/operations/error-reporting.ts +55 -0
- package/src/router/modules/route-error-tracking/domain/operations/index.ts +4 -0
- package/src/router/modules/route-error-tracking/domain/validators/index.ts +46 -0
- package/src/router/modules/route-error-tracking/index.ts +8 -0
- package/src/router/modules/route-error-tracking/ports/index.ts +20 -0
- package/src/router/modules/route-error-tracking/types/index.ts +6 -0
- package/src/router/modules/route-feature-flags/application/usecases/index.ts +159 -0
- package/src/router/modules/route-feature-flags/domain/index.ts +5 -0
- package/src/router/modules/route-feature-flags/domain/models/index.ts +102 -0
- package/src/router/modules/route-feature-flags/domain/operations/feature-flag-audit.ts +37 -0
- package/src/router/modules/route-feature-flags/domain/operations/feature-flag-conditions.ts +52 -0
- package/src/router/modules/route-feature-flags/domain/operations/feature-flag-flags.ts +205 -0
- package/src/router/modules/route-feature-flags/domain/operations/feature-flag-routes.ts +54 -0
- package/src/router/modules/route-feature-flags/domain/operations/feature-flag-segments.ts +22 -0
- package/src/router/modules/route-feature-flags/domain/operations/feature-flag-statistics.ts +22 -0
- package/src/router/modules/route-feature-flags/domain/operations/index.ts +6 -0
- package/src/router/modules/route-feature-flags/domain/validators/index.ts +40 -0
- package/src/router/modules/route-feature-flags/index.ts +8 -0
- package/src/router/modules/route-feature-flags/ports/index.ts +23 -0
- package/src/router/modules/route-feature-flags/types/index.ts +7 -0
- package/src/router/modules/route-i18n/application/usecases/index.ts +81 -0
- package/src/router/modules/route-i18n/domain/models/index.ts +85 -0
- package/src/router/modules/route-i18n/domain/operations/index.ts +201 -0
- package/src/router/modules/route-i18n/domain/validators/index.ts +43 -0
- package/src/router/modules/route-i18n/index.ts +8 -0
- package/src/router/modules/route-i18n/ports/index.ts +20 -0
- package/src/router/modules/route-i18n/types/index.ts +7 -0
- package/src/router/modules/route-navigation-timeline/application/usecases/index.ts +182 -0
- package/src/router/modules/route-navigation-timeline/domain/index.ts +5 -0
- package/src/router/modules/route-navigation-timeline/domain/models/index.ts +143 -0
- package/src/router/modules/route-navigation-timeline/domain/operations/index.ts +177 -0
- package/src/router/modules/route-navigation-timeline/domain/validators/index.ts +19 -0
- package/src/router/modules/route-navigation-timeline/index.ts +8 -0
- package/src/router/modules/route-navigation-timeline/ports/index.ts +30 -0
- package/src/router/modules/route-navigation-timeline/types/index.ts +5 -0
- package/src/router/modules/route-performance/application/usecases/index.ts +166 -0
- package/src/router/modules/route-performance/domain/models/index.ts +96 -0
- package/src/router/modules/route-performance/domain/operations/index.ts +5 -0
- package/src/router/modules/route-performance/domain/operations/performance-cleanup.ts +29 -0
- package/src/router/modules/route-performance/domain/operations/performance-queries.ts +91 -0
- package/src/router/modules/route-performance/domain/operations/performance-recording.ts +151 -0
- package/src/router/modules/route-performance/domain/operations/performance-reporting.ts +32 -0
- package/src/router/modules/route-performance/domain/operations/performance-tracking.ts +75 -0
- package/src/router/modules/route-performance/domain/validators/index.ts +55 -0
- package/src/router/modules/route-performance/index.ts +8 -0
- package/src/router/modules/route-performance/ports/index.ts +25 -0
- package/src/router/modules/route-performance/types/index.ts +6 -0
- package/src/router/modules/route-security/application/usecases/index.ts +153 -0
- package/src/router/modules/route-security/domain/models/index.ts +216 -0
- package/src/router/modules/route-security/domain/operations/index.ts +165 -0
- package/src/router/modules/route-security/domain/validators/index.ts +32 -0
- package/src/router/modules/route-security/index.ts +8 -0
- package/src/router/modules/route-security/ports/index.ts +31 -0
- package/src/router/modules/route-security/types/index.ts +11 -0
- package/src/router/modules/route-testing/application/usecases/index.ts +131 -0
- package/src/router/modules/route-testing/domain/models/index.ts +217 -0
- package/src/router/modules/route-testing/domain/operations/contract-testing-operations.ts +239 -0
- package/src/router/modules/route-testing/domain/operations/e2e-testing-operations.ts +167 -0
- package/src/router/modules/route-testing/domain/operations/index.ts +3 -0
- package/src/router/modules/route-testing/domain/operations/route-testing-core.ts +48 -0
- package/src/router/modules/route-testing/domain/validators/index.ts +34 -0
- package/src/router/modules/route-testing/index.ts +8 -0
- package/src/router/modules/route-testing/ports/index.ts +21 -0
- package/src/router/modules/route-testing/types/index.ts +13 -0
- package/src/router/modules/routing/application/index.ts +7 -0
- package/src/router/modules/routing/application/usecases.ts +49 -0
- package/src/router/modules/routing/domain/ab-testing.ts +86 -0
- package/src/router/modules/routing/domain/analytics.ts +88 -0
- package/src/router/modules/routing/domain/caching-evict.ts +104 -0
- package/src/router/modules/routing/domain/caching-invalidate.ts +101 -0
- package/src/router/modules/routing/domain/caching-read.ts +74 -0
- package/src/router/modules/routing/domain/caching-state.ts +38 -0
- package/src/router/modules/routing/domain/caching-types.ts +38 -0
- package/src/router/modules/routing/domain/caching-write.ts +62 -0
- package/src/router/modules/routing/domain/caching.ts +6 -0
- package/src/router/modules/routing/domain/code-splitting.ts +226 -0
- package/src/router/modules/routing/domain/contract-factory.ts +37 -0
- package/src/router/modules/routing/domain/contract-testing.ts +13 -0
- package/src/router/modules/routing/domain/contract-types.ts +32 -0
- package/src/router/modules/routing/domain/contract-validator.ts +246 -0
- package/src/router/modules/routing/domain/dynamic-imports.ts +67 -0
- package/src/router/modules/routing/domain/e2e-testing.ts +267 -0
- package/src/router/modules/routing/domain/error-boundaries.ts +54 -0
- package/src/router/modules/routing/domain/error-tracking.ts +277 -0
- package/src/router/modules/routing/domain/feature-flags.ts +255 -0
- package/src/router/modules/routing/domain/guards.ts +104 -0
- package/src/router/modules/routing/domain/i18n.ts +230 -0
- package/src/router/modules/routing/domain/index.ts +30 -0
- package/src/router/modules/routing/domain/interactive-docs-advanced-sections.ts +164 -0
- package/src/router/modules/routing/domain/interactive-docs-core-sections.ts +198 -0
- package/src/router/modules/routing/domain/interactive-docs.ts +154 -0
- package/src/router/modules/routing/domain/isr.ts +35 -0
- package/src/router/modules/routing/domain/middleware.ts +79 -0
- package/src/router/modules/routing/domain/models.ts +95 -0
- package/src/router/modules/routing/domain/navigation-timeline.ts +243 -0
- package/src/router/modules/routing/domain/operations.ts +36 -0
- package/src/router/modules/routing/domain/optimized-matcher.ts +75 -0
- package/src/router/modules/routing/domain/performance-alert-manager.ts +28 -0
- package/src/router/modules/routing/domain/performance-monitoring.ts +287 -0
- package/src/router/modules/routing/domain/performance-report.ts +29 -0
- package/src/router/modules/routing/domain/performance-types.ts +19 -0
- package/src/router/modules/routing/domain/predictive-preloading.ts +296 -0
- package/src/router/modules/routing/domain/rbac.ts +219 -0
- package/src/router/modules/routing/domain/resource-routes.ts +64 -0
- package/src/router/modules/routing/domain/route-autocomplete.ts +176 -0
- package/src/router/modules/routing/domain/route-groups.ts +63 -0
- package/src/router/modules/routing/domain/security-scanner.ts +225 -0
- package/src/router/modules/routing/domain/server-actions.ts +71 -0
- package/src/router/modules/routing/domain/testing.ts +80 -0
- package/src/router/modules/routing/domain/type-safe-links.ts +72 -0
- package/src/router/modules/routing/domain/validators.ts +23 -0
- package/src/router/modules/routing/index.ts +4 -0
- package/src/router/modules/routing/ports/index.ts +1 -0
- package/src/router/modules/routing/ports/router-port.ts +15 -0
- package/src/router/modules/routing/types/index.ts +14 -0
- package/src/router/modules/routing-core/application/usecases/index.ts +49 -0
- package/src/router/modules/routing-core/domain/models/index.ts +95 -0
- package/src/router/modules/routing-core/domain/operations/index.ts +36 -0
- package/src/router/modules/routing-core/domain/validators/index.ts +28 -0
- package/src/router/modules/routing-core/index.ts +8 -0
- package/src/router/modules/routing-core/ports/index.ts +16 -0
- package/src/router/modules/routing-core/types/index.ts +25 -0
- package/src/router/presentation/index.ts +1 -0
- package/src/router/presentation/solid/components/index.ts +1 -0
- package/src/router/presentation/solid/components/route-visualizer-details.tsx +37 -0
- package/src/router/presentation/solid/components/route-visualizer-helpers.ts +56 -0
- package/src/router/presentation/solid/components/route-visualizer-tree.tsx +99 -0
- package/src/router/presentation/solid/components/route-visualizer-types.ts +41 -0
- package/src/router/presentation/solid/components/route-visualizer.tsx +110 -0
- package/src/router/presentation/solid/components/router.ts +82 -0
- package/src/router/presentation/solid/devtools/index.ts +2 -0
- package/src/router/presentation/solid/devtools/router-devtools-panel.tsx +141 -0
- package/src/router/presentation/solid/devtools/router-inspector.ts +54 -0
- package/src/router/presentation/solid/hmr.ts +77 -0
- package/src/router/presentation/solid/index.ts +7 -0
- package/src/router/presentation/solid/lazy-loading.ts +111 -0
- package/src/router/presentation/solid/preloading.ts +81 -0
- package/src/router/presentation/solid/route-state.ts +58 -0
- package/src/router/presentation/solid/signals/index.ts +2 -0
- package/src/router/presentation/solid/signals/route-state.ts +39 -0
- package/src/router/presentation/solid/signals/search-params.ts +31 -0
- package/src/router/shared/constants/index.ts +6 -0
- package/src/router/shared/errors/enhanced-errors.ts +94 -0
- package/src/router/shared/errors/index.ts +30 -0
- package/src/router/shared/index.ts +4 -0
- package/src/router/shared/types/either.ts +55 -0
- package/src/router/shared/types/index.ts +5 -0
- package/src/router/shared/types/option.ts +20 -0
- package/src/router/shared/types/result.ts +34 -0
- package/src/router/shared/types/route-inference.ts +49 -0
- package/src/router/shared/types/routing.ts +31 -0
- package/src/router/shared/utils/index.ts +3 -0
- package/src/router/shared/utils/path.ts +43 -0
- package/src/router/shared/utils/result.ts +5 -0
- package/src/router/shared/utils/time-condition.ts +53 -0
- package/src/router/vite-plugin/index.ts +2 -0
- package/src/router/vite-plugin/vite-plugin-core.ts +79 -0
- package/src/router/vite-plugin/vite-plugin-options-advanced.ts +127 -0
- package/src/router/vite-plugin/vite-plugin-options-features.ts +117 -0
- package/src/router/vite-plugin/vite-plugin-options-routing.ts +70 -0
- package/src/router/vite-plugin/vite-plugin-options.ts +23 -0
- package/src/server/adapters/index.ts +2 -0
- package/src/server/adapters/platforms.ts +79 -0
- package/src/server/adapters/web-server/index.ts +281 -0
- package/src/server/index.ts +13 -0
- package/src/server/modules/http/domain/operations/cookies.ts +151 -0
- package/src/server/modules/http/domain/operations/metrics.ts +103 -0
- package/src/server/modules/http/domain/operations/request-context.ts +36 -0
- package/src/server/modules/http/domain/operations/session-store.ts +98 -0
- package/src/server/modules/http/index.ts +15 -0
- package/src/server/modules/loaders/application/index.ts +1 -0
- package/src/server/modules/loaders/application/usecases/create-route-loader.ts +88 -0
- package/src/server/modules/loaders/application/usecases/dehydrate.ts +21 -0
- package/src/server/modules/loaders/application/usecases/index.ts +2 -0
- package/src/server/modules/loaders/index.ts +1 -0
- package/src/server/modules/realtime/domain/operations/channels.ts +241 -0
- package/src/server/modules/realtime/domain/operations/sse.ts +63 -0
- package/src/server/modules/realtime/index.ts +2 -0
- package/src/server/modules/server-functions/adapters/http/handler.ts +128 -0
- package/src/server/modules/server-functions/application/index.ts +1 -0
- package/src/server/modules/server-functions/application/usecases/batch.ts +135 -0
- package/src/server/modules/server-functions/application/usecases/create-server-fn.ts +272 -0
- package/src/server/modules/server-functions/application/usecases/csrf.ts +67 -0
- package/src/server/modules/server-functions/application/usecases/index.ts +6 -0
- package/src/server/modules/server-functions/application/usecases/live.ts +172 -0
- package/src/server/modules/server-functions/application/usecases/registry.ts +22 -0
- package/src/server/modules/server-functions/application/usecases/scheduler.ts +115 -0
- package/src/server/modules/server-functions/domain/index.ts +24 -0
- package/src/server/modules/server-functions/domain/models/execution-result.ts +18 -0
- package/src/server/modules/server-functions/domain/models/index.ts +1 -0
- package/src/server/modules/server-functions/domain/operations/result.ts +61 -0
- package/src/server/modules/server-functions/domain/operations/serialize.ts +134 -0
- package/src/server/modules/server-functions/domain/operations/stream.ts +107 -0
- package/src/server/modules/server-functions/index.ts +3 -0
- package/src/server/modules/server-only/index.ts +30 -0
- package/src/server/node.ts +10 -0
- package/src/server/shared/errors/index.ts +1 -0
- package/src/server/shared/errors/server-fn-error.ts +27 -0
- package/src/server/shared/index.ts +2 -0
- package/src/server/shared/types/index.ts +5 -0
- package/src/server/types/index.ts +65 -0
- package/src/stores/adapters/analytics/index.ts +5 -0
- package/src/stores/adapters/analytics/monitoring.ts +164 -0
- package/src/stores/adapters/devtools/index.ts +80 -0
- package/src/stores/adapters/persistence/index.ts +5 -0
- package/src/stores/adapters/persistence/versioning.ts +142 -0
- package/src/stores/adapters/router/index.ts +144 -0
- package/src/stores/adapters/storage/index.ts +6 -0
- package/src/stores/adapters/storage/indexed-db.ts +83 -0
- package/src/stores/adapters/storage/local-storage.ts +44 -0
- package/src/stores/adapters/storage/session-storage.ts +44 -0
- package/src/stores/adapters/sync/index.ts +5 -0
- package/src/stores/adapters/sync/tab-sync.ts +148 -0
- package/src/stores/adapters/validation/arktype-validator.ts +32 -0
- package/src/stores/adapters/validation/error-handling.ts +27 -0
- package/src/stores/adapters/validation/index.ts +61 -0
- package/src/stores/adapters/validation/schemas/api-schemas.ts +30 -0
- package/src/stores/adapters/validation/schemas/common-schemas.ts +32 -0
- package/src/stores/adapters/validation/schemas/config-schemas.ts +22 -0
- package/src/stores/adapters/validation/schemas/constraint-schemas.ts +34 -0
- package/src/stores/adapters/validation/schemas/ecommerce-schemas.ts +43 -0
- package/src/stores/adapters/validation/schemas/form-schemas.ts +27 -0
- package/src/stores/adapters/validation/schemas/primitive-schemas.ts +9 -0
- package/src/stores/adapters/validation/schemas/store-schemas.ts +52 -0
- package/src/stores/adapters/validation/schemas.ts +11 -0
- package/src/stores/index.ts +13 -0
- package/src/stores/modules/query/index.ts +24 -0
- package/src/stores/modules/query/mutation-state.ts +33 -0
- package/src/stores/modules/query/mutation-store.ts +59 -0
- package/src/stores/modules/query/query-builder.ts +25 -0
- package/src/stores/modules/query/query-cache.ts +65 -0
- package/src/stores/modules/query/query-manager.ts +103 -0
- package/src/stores/modules/query/query-state.ts +39 -0
- package/src/stores/modules/query/query-store.ts +81 -0
- package/src/stores/modules/store/application/usecases/index.ts +217 -0
- package/src/stores/modules/store/domain/models/index.ts +38 -0
- package/src/stores/modules/store/domain/operations/actions.ts +120 -0
- package/src/stores/modules/store/domain/operations/composition.ts +205 -0
- package/src/stores/modules/store/domain/operations/derived-operations.ts +21 -0
- package/src/stores/modules/store/domain/operations/diffing.ts +272 -0
- package/src/stores/modules/store/domain/operations/event-bus.ts +255 -0
- package/src/stores/modules/store/domain/operations/history-operations.ts +101 -0
- package/src/stores/modules/store/domain/operations/hydration.ts +159 -0
- package/src/stores/modules/store/domain/operations/immutable.ts +173 -0
- package/src/stores/modules/store/domain/operations/index.ts +21 -0
- package/src/stores/modules/store/domain/operations/middleware.ts +193 -0
- package/src/stores/modules/store/domain/operations/mutations.ts +14 -0
- package/src/stores/modules/store/domain/operations/normalization.ts +195 -0
- package/src/stores/modules/store/domain/operations/optimistic.ts +171 -0
- package/src/stores/modules/store/domain/operations/persistence-operations.ts +26 -0
- package/src/stores/modules/store/domain/operations/queries.ts +296 -0
- package/src/stores/modules/store/domain/operations/selectors.ts +112 -0
- package/src/stores/modules/store/domain/operations/store-operations.ts +52 -0
- package/src/stores/modules/store/domain/operations/time-machine.ts +240 -0
- package/src/stores/modules/store/domain/operations/transactions.ts +198 -0
- package/src/stores/modules/store/domain/validators/action-validators.ts +20 -0
- package/src/stores/modules/store/domain/validators/history-validators.ts +19 -0
- package/src/stores/modules/store/domain/validators/index.ts +7 -0
- package/src/stores/modules/store/domain/validators/persistence-validators.ts +23 -0
- package/src/stores/modules/store/domain/validators/store-validators.ts +41 -0
- package/src/stores/modules/store/index.ts +9 -0
- package/src/stores/modules/store/ports/index.ts +104 -0
- package/src/stores/modules/store/types/index.ts +35 -0
- package/src/stores/shared/constants/index.ts +50 -0
- package/src/stores/shared/errors/index.ts +122 -0
- package/src/stores/shared/index.ts +7 -0
- package/src/stores/shared/schema-generator.ts +262 -0
- package/src/stores/shared/types/index.ts +147 -0
- package/src/testing/index.ts +90 -0
- package/src/vite/auto-imports.ts +65 -0
- package/src/vite/client.d.ts +25 -0
- package/src/vite/dev-middleware.ts +142 -0
- package/src/vite/index.ts +9 -0
- package/src/vite/plugin.ts +277 -0
- package/src/vite/prerender.ts +72 -0
- package/src/vite/server-fn-ids.ts +52 -0
- package/src/vite/types/index.ts +24 -0
- package/src/vite/virtual-modules.ts +68 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loader Data — page `loader` export results, resolved per navigation
|
|
3
|
+
* On the server the loader runs inline during SSR and its result is
|
|
4
|
+
* written into the render context's hydration payload; on the client
|
|
5
|
+
* the first read comes from that payload and later navigations fetch
|
|
6
|
+
* `/_server/loader`
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
createContext,
|
|
11
|
+
createMemo,
|
|
12
|
+
createResource,
|
|
13
|
+
type Resource,
|
|
14
|
+
useContext,
|
|
15
|
+
} from "solid-js";
|
|
16
|
+
import { isServer } from "solid-js/web";
|
|
17
|
+
import { readHydrationPayload } from "#render/modules/render/domain";
|
|
18
|
+
import type { HydrationPayload } from "#render/types";
|
|
19
|
+
import { LoaderError } from "../domain/errors";
|
|
20
|
+
import {
|
|
21
|
+
DEFERRED,
|
|
22
|
+
deferMarkerKey,
|
|
23
|
+
deferredRegistry,
|
|
24
|
+
extractDeferred,
|
|
25
|
+
isDeferred,
|
|
26
|
+
type LeafMapped,
|
|
27
|
+
materializeDeferred,
|
|
28
|
+
} from "../domain/operations/defer";
|
|
29
|
+
import type { RouteLoaderFn } from "../domain/operations/loader";
|
|
30
|
+
import { LOADER_ENDPOINT } from "../domain/operations/loader";
|
|
31
|
+
import { timedDevEvent } from "./dev-events";
|
|
32
|
+
import {
|
|
33
|
+
type LoaderCacheConfig,
|
|
34
|
+
requestState,
|
|
35
|
+
runLoaderCached,
|
|
36
|
+
} from "./loader-cache";
|
|
37
|
+
|
|
38
|
+
export type LoaderDataContextValue = Resource<unknown> | undefined;
|
|
39
|
+
export const LoaderDataContext = createContext<LoaderDataContextValue>();
|
|
40
|
+
|
|
41
|
+
/** Re-runs the current route's loader chain — error.tsx `retry` */
|
|
42
|
+
export const LoaderRetryContext = createContext<() => void>();
|
|
43
|
+
|
|
44
|
+
/** Retry the current route loader — typically inside error.tsx */
|
|
45
|
+
export const useLoaderRetry = (): (() => void) | undefined =>
|
|
46
|
+
useContext(LoaderRetryContext);
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The live hydration payload during SSR — provided by the routed
|
|
50
|
+
* server entry so loader results serialize into the document
|
|
51
|
+
*/
|
|
52
|
+
export const HydrationContext = createContext<HydrationPayload>();
|
|
53
|
+
|
|
54
|
+
/** Promise source for a deferred key — payload map or stream wait */
|
|
55
|
+
const deferSource = (key: string): Promise<unknown> => {
|
|
56
|
+
const resolved = readHydrationPayload().deferred;
|
|
57
|
+
if (resolved && key in resolved) return Promise.resolve(resolved[key]);
|
|
58
|
+
return (
|
|
59
|
+
window.__sfDeferWait?.(key) ??
|
|
60
|
+
Promise.reject(new Error(`[solid-framework] deferred key ${key} lost`))
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Deep-walk loader data — replace Deferred leaves (server) and defer
|
|
66
|
+
* markers (client payload) with per-leaf Resources so each field
|
|
67
|
+
* suspends independently under the user's <Suspense> boundaries
|
|
68
|
+
*/
|
|
69
|
+
const toLeafResources = (value: unknown): unknown => {
|
|
70
|
+
if (isDeferred(value)) {
|
|
71
|
+
const [r] = createResource(() => value[DEFERRED]);
|
|
72
|
+
return r;
|
|
73
|
+
}
|
|
74
|
+
const marker = deferMarkerKey(value);
|
|
75
|
+
if (marker !== undefined) {
|
|
76
|
+
const [r] = createResource(() => deferSource(marker));
|
|
77
|
+
return r;
|
|
78
|
+
}
|
|
79
|
+
if (Array.isArray(value)) return value.map(toLeafResources);
|
|
80
|
+
if (value !== null && typeof value === "object") {
|
|
81
|
+
const out: Record<string, unknown> = {};
|
|
82
|
+
for (const [k, v] of Object.entries(value)) {
|
|
83
|
+
out[k] = toLeafResources(v);
|
|
84
|
+
}
|
|
85
|
+
return out;
|
|
86
|
+
}
|
|
87
|
+
return value;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Read the current route's loader data — reactive accessor; every
|
|
92
|
+
* defer() leaf is its own Resource so fast fields render while slow
|
|
93
|
+
* fields still stream in:
|
|
94
|
+
*
|
|
95
|
+
* const data = useRouteData<Awaited<ReturnType<typeof loader>>>();
|
|
96
|
+
* <p>{data()?.fast}</p>
|
|
97
|
+
* <Suspense fallback="…">{data()?.slow?.()}</Suspense>
|
|
98
|
+
*/
|
|
99
|
+
export const useRouteData = <T = unknown>(): (() =>
|
|
100
|
+
| LeafMapped<T>
|
|
101
|
+
| undefined) => {
|
|
102
|
+
const resource = useContext(LoaderDataContext);
|
|
103
|
+
const mapped = createMemo(() => toLeafResources(resource?.()));
|
|
104
|
+
return () => mapped() as LeafMapped<T> | undefined;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
/** @deprecated renamed to useRouteData — own-brand naming */
|
|
108
|
+
export const useLoaderData = useRouteData;
|
|
109
|
+
|
|
110
|
+
/** Read a path's loader data from the serialized hydration payload */
|
|
111
|
+
export const readHydrated = (path: string): unknown =>
|
|
112
|
+
readHydrationPayload().loaders?.[path];
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Page-level `schema` export — validate route params / request body
|
|
116
|
+
* before the loader runs; a throwing assert → 400 response
|
|
117
|
+
*
|
|
118
|
+
* export const schema = {
|
|
119
|
+
* params: (p) => { if (!p.id) throw new Error("id required"); return p; },
|
|
120
|
+
* };
|
|
121
|
+
*/
|
|
122
|
+
export interface RouteSchema {
|
|
123
|
+
params?: (raw: Record<string, string>) => unknown;
|
|
124
|
+
body?: (raw: unknown) => unknown;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Resolve a route module's loader export:
|
|
129
|
+
* server → run it directly with the live Request, write into hydration
|
|
130
|
+
* client → hydration payload first, else fetch the loader endpoint
|
|
131
|
+
*/
|
|
132
|
+
export const runRouteLoader = async (
|
|
133
|
+
loader: RouteLoaderFn | undefined,
|
|
134
|
+
key: string,
|
|
135
|
+
params: Record<string, string>,
|
|
136
|
+
request: Request | undefined,
|
|
137
|
+
hydration?: HydrationPayload,
|
|
138
|
+
parent?: unknown,
|
|
139
|
+
/** Route path to fetch on the client — layouts pass undefined */
|
|
140
|
+
fetchPath?: string,
|
|
141
|
+
/** Page-level `loaderCache` export — in-memory tagged cache */
|
|
142
|
+
cache?: LoaderCacheConfig,
|
|
143
|
+
/** Page-level `schema` export — params/body assertions (server only) */
|
|
144
|
+
schema?: RouteSchema,
|
|
145
|
+
): Promise<unknown> => {
|
|
146
|
+
if (!loader) return parent;
|
|
147
|
+
|
|
148
|
+
if (isServer) {
|
|
149
|
+
if (!request) return parent;
|
|
150
|
+
// Schema validation — params first (cheap), body for non-GET
|
|
151
|
+
if (schema?.params)
|
|
152
|
+
params = schema.params(params) as Record<string, string>;
|
|
153
|
+
if (schema?.body && request.method !== "GET" && request.method !== "HEAD") {
|
|
154
|
+
const raw = await request
|
|
155
|
+
.clone()
|
|
156
|
+
.json()
|
|
157
|
+
.catch(() => null);
|
|
158
|
+
schema.body(raw);
|
|
159
|
+
}
|
|
160
|
+
const run = cache
|
|
161
|
+
? runLoaderCached(loader, key, params, request, parent, cache)
|
|
162
|
+
: loader({ request, params, parent, state: requestState() });
|
|
163
|
+
const data = await run;
|
|
164
|
+
// Deferred leaves become markers in the payload (streamed tail
|
|
165
|
+
// scripts resolve them); the component gets the raw shape —
|
|
166
|
+
// useLoaderData turns each Deferred leaf into its own resource
|
|
167
|
+
// so fields suspend independently
|
|
168
|
+
if (hydration) {
|
|
169
|
+
hydration.loaders[key] = extractDeferred(
|
|
170
|
+
data,
|
|
171
|
+
deferredRegistry(hydration),
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
return data;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
const hydrated = readHydrated(key);
|
|
178
|
+
if (hydrated !== undefined) {
|
|
179
|
+
// Raw markers — leaf resources resolve each key lazily via
|
|
180
|
+
// hydration.deferred (ssr) or __sfDeferWait (stream)
|
|
181
|
+
return hydrated;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// Layout loader data only exists in the hydration payload — client
|
|
185
|
+
// navigations re-fetch the page path and the endpoint runs the
|
|
186
|
+
// full chain server-side
|
|
187
|
+
if (!fetchPath) return parent;
|
|
188
|
+
|
|
189
|
+
const response = await timedDevEvent("loader", fetchPath, () =>
|
|
190
|
+
fetch(`${LOADER_ENDPOINT}?path=${encodeURIComponent(fetchPath)}`),
|
|
191
|
+
);
|
|
192
|
+
if (!response.ok) {
|
|
193
|
+
const body = (await response.json().catch(() => null)) as {
|
|
194
|
+
error?: { code?: string; message?: string };
|
|
195
|
+
} | null;
|
|
196
|
+
throw new LoaderError(
|
|
197
|
+
body?.error?.code ?? "LOADER_ERROR",
|
|
198
|
+
body?.error?.message ?? `loader failed for ${fetchPath}`,
|
|
199
|
+
response.status,
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
const body = (await response.json()) as {
|
|
203
|
+
data: unknown;
|
|
204
|
+
deferred?: Record<string, unknown>;
|
|
205
|
+
};
|
|
206
|
+
return materializeDeferred(body.data, body.deferred);
|
|
207
|
+
};
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Location Context
|
|
3
|
+
* Minimal reactive location for file routing — history navigation
|
|
4
|
+
* on the client, static request path on the server
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
type Accessor,
|
|
9
|
+
createContext,
|
|
10
|
+
createSignal,
|
|
11
|
+
onCleanup,
|
|
12
|
+
useContext,
|
|
13
|
+
} from "solid-js";
|
|
14
|
+
import { isServer } from "solid-js/web";
|
|
15
|
+
import type { RouteParamsFor, RoutePath } from "../domain/operations/typed";
|
|
16
|
+
import { recordDevEvent } from "./dev-events";
|
|
17
|
+
|
|
18
|
+
export interface AppLocation {
|
|
19
|
+
pathname: Accessor<string>;
|
|
20
|
+
/** Query string including "?" — reactive on the client */
|
|
21
|
+
search: Accessor<string>;
|
|
22
|
+
navigate: (
|
|
23
|
+
to: string,
|
|
24
|
+
options?: {
|
|
25
|
+
replace?: boolean;
|
|
26
|
+
/** View Transition — default true when the browser supports it */
|
|
27
|
+
transition?: boolean;
|
|
28
|
+
/** Scroll to top on nav (default true) — false keeps position */
|
|
29
|
+
scroll?: boolean;
|
|
30
|
+
/** Re-run the destination loader after the nav lands */
|
|
31
|
+
invalidate?: boolean;
|
|
32
|
+
},
|
|
33
|
+
) => void;
|
|
34
|
+
/** True while a client navigation is being applied (loading bars) */
|
|
35
|
+
navigating: Accessor<boolean>;
|
|
36
|
+
/** Previous pathname — last navigation source, for "back" UX */
|
|
37
|
+
prev: Accessor<string | undefined>;
|
|
38
|
+
/**
|
|
39
|
+
* Shallow routing — associate state with the history entry without
|
|
40
|
+
* navigating (modals, drawers). `state()` reads it reactively.
|
|
41
|
+
*/
|
|
42
|
+
pushState: (url: string, state: Record<string, unknown>) => void;
|
|
43
|
+
replaceState: (state: Record<string, unknown>) => void;
|
|
44
|
+
state: Accessor<Record<string, unknown>>;
|
|
45
|
+
/**
|
|
46
|
+
* Revalidation counter — bumped by refresh() so route loader
|
|
47
|
+
* resources re-run after mutations (single-flight)
|
|
48
|
+
*/
|
|
49
|
+
version: Accessor<number>;
|
|
50
|
+
/** Re-run the current route's loader (post-mutation refresh) */
|
|
51
|
+
refresh: () => void;
|
|
52
|
+
/** Saved scrollY for a path — used by `page({ scroll: false })` */
|
|
53
|
+
savedScroll: (path: string) => number | undefined;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export const LocationContext = createContext<AppLocation>();
|
|
57
|
+
export const ParamsContext = createContext<Record<string, string>>({});
|
|
58
|
+
/** Current Request during SSR — provided by the routed server entry */
|
|
59
|
+
export const RequestContext = createContext<Request>();
|
|
60
|
+
|
|
61
|
+
export const createLocation = (
|
|
62
|
+
initial = "/",
|
|
63
|
+
initialSearch = "",
|
|
64
|
+
): AppLocation => {
|
|
65
|
+
const [version, setVersion] = createSignal(0);
|
|
66
|
+
const [prev, setPrev] = createSignal<string | undefined>();
|
|
67
|
+
const [state, setState] = createSignal<Record<string, unknown>>({});
|
|
68
|
+
const [navigating, setNavigating] = createSignal(false);
|
|
69
|
+
if (isServer) {
|
|
70
|
+
return {
|
|
71
|
+
pathname: () => initial,
|
|
72
|
+
search: () => initialSearch,
|
|
73
|
+
prev,
|
|
74
|
+
navigating,
|
|
75
|
+
state,
|
|
76
|
+
pushState: () => {},
|
|
77
|
+
replaceState: () => {},
|
|
78
|
+
version,
|
|
79
|
+
navigate: () => {
|
|
80
|
+
/* no-op on server */
|
|
81
|
+
},
|
|
82
|
+
refresh: () => setVersion((v) => v + 1),
|
|
83
|
+
savedScroll: () => undefined,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const [pathname, setPathname] = createSignal(
|
|
88
|
+
window.location.pathname || initial,
|
|
89
|
+
);
|
|
90
|
+
const [search, setSearch] = createSignal(window.location.search);
|
|
91
|
+
|
|
92
|
+
// Scroll restoration — save position per path, restore on back/forward
|
|
93
|
+
const positions = new Map<string, number>();
|
|
94
|
+
window.history.scrollRestoration = "manual";
|
|
95
|
+
|
|
96
|
+
const onPop = () => {
|
|
97
|
+
const path = window.location.pathname || "/";
|
|
98
|
+
setNavigating(true);
|
|
99
|
+
setPrev(pathname());
|
|
100
|
+
setPathname(path);
|
|
101
|
+
setSearch(window.location.search);
|
|
102
|
+
setState((window.history.state as Record<string, unknown>) ?? {});
|
|
103
|
+
const saved = positions.get(path);
|
|
104
|
+
queueMicrotask(() => {
|
|
105
|
+
window.scrollTo(0, saved ?? 0);
|
|
106
|
+
setNavigating(false);
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
window.addEventListener("popstate", onPop);
|
|
110
|
+
onCleanup(() => window.removeEventListener("popstate", onPop));
|
|
111
|
+
|
|
112
|
+
return {
|
|
113
|
+
pathname,
|
|
114
|
+
search,
|
|
115
|
+
prev,
|
|
116
|
+
navigating,
|
|
117
|
+
state,
|
|
118
|
+
pushState: (url, s) => {
|
|
119
|
+
window.history.pushState(s, "", url || undefined);
|
|
120
|
+
setState(s);
|
|
121
|
+
},
|
|
122
|
+
replaceState: (s) => {
|
|
123
|
+
window.history.replaceState(s, "");
|
|
124
|
+
setState(s);
|
|
125
|
+
},
|
|
126
|
+
version,
|
|
127
|
+
refresh: () => setVersion((v) => v + 1),
|
|
128
|
+
savedScroll: (path) => positions.get(path),
|
|
129
|
+
navigate: (to, options) => {
|
|
130
|
+
positions.set(pathname(), window.scrollY);
|
|
131
|
+
recordDevEvent({ type: "navigate", path: to });
|
|
132
|
+
setNavigating(true);
|
|
133
|
+
const apply = () => {
|
|
134
|
+
setPrev(pathname());
|
|
135
|
+
if (options?.replace) window.history.replaceState(null, "", to);
|
|
136
|
+
else window.history.pushState(null, "", to);
|
|
137
|
+
setPathname(window.location.pathname);
|
|
138
|
+
setSearch(window.location.search);
|
|
139
|
+
if (options?.scroll !== false) window.scrollTo(0, 0);
|
|
140
|
+
if (options?.invalidate) setVersion((v) => v + 1);
|
|
141
|
+
// one frame for the router to swap — Suspense may still show
|
|
142
|
+
// fallbacks for loaders, but the URL nav itself is done
|
|
143
|
+
requestAnimationFrame(() => setNavigating(false));
|
|
144
|
+
};
|
|
145
|
+
// View Transitions — progressive enhancement when supported,
|
|
146
|
+
// `transition: false` opts out for this navigation
|
|
147
|
+
const startViewTransition = (
|
|
148
|
+
document as Document & {
|
|
149
|
+
startViewTransition?: (cb: () => void) => void;
|
|
150
|
+
}
|
|
151
|
+
).startViewTransition;
|
|
152
|
+
if (startViewTransition && options?.transition !== false)
|
|
153
|
+
startViewTransition.call(document, apply);
|
|
154
|
+
else apply();
|
|
155
|
+
},
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Middleware-written request state — provided by the routed server
|
|
161
|
+
* entry; empty object on the client. `useRouteState<T>()` reads it
|
|
162
|
+
* with the consumer's own state type
|
|
163
|
+
*/
|
|
164
|
+
export const RouteStateContext = createContext<Record<string, unknown>>({});
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Validated search params — route modules export `validateSearch`
|
|
168
|
+
* to parse/coerce `?query`; FileRoutes provides the result here.
|
|
169
|
+
* Defaults to the raw Record<string,string> when no validator
|
|
170
|
+
*/
|
|
171
|
+
export const SearchContext = createContext<unknown>({});
|
|
172
|
+
|
|
173
|
+
/** Typed search params — `useSearchParams<{ page: number }>()` */
|
|
174
|
+
export const useSearchParams = <T = Record<string, string>>(): T =>
|
|
175
|
+
useContext(SearchContext) as T;
|
|
176
|
+
|
|
177
|
+
/** Raw Request from the client-side render context (empty post-hydration) */
|
|
178
|
+
export const useRawRequest = (): Request | undefined =>
|
|
179
|
+
useContext(RequestContext);
|
|
180
|
+
|
|
181
|
+
/** @deprecated renamed to useRawRequest — avoids confusion with useRequestEvent */
|
|
182
|
+
export const useRequest = useRawRequest;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Read middleware-written request state (client side) — the same
|
|
186
|
+
* state bag as server `useRequestState`, typed by the consumer
|
|
187
|
+
*/
|
|
188
|
+
export const useRequestState = <
|
|
189
|
+
T extends Record<string, unknown> = Record<string, unknown>,
|
|
190
|
+
>(): T => useContext(RouteStateContext) as T;
|
|
191
|
+
|
|
192
|
+
/** @deprecated renamed to useRequestState — same state bag both sides */
|
|
193
|
+
export const useRouteState = useRequestState;
|
|
194
|
+
|
|
195
|
+
export const useLocation = (): AppLocation => {
|
|
196
|
+
const ctx = useContext(LocationContext);
|
|
197
|
+
if (!ctx) {
|
|
198
|
+
throw new Error("[solid-framework] useLocation must be inside FileRoutes");
|
|
199
|
+
}
|
|
200
|
+
return ctx;
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
export const useNavigate = (): AppLocation["navigate"] =>
|
|
204
|
+
useLocation().navigate;
|
|
205
|
+
|
|
206
|
+
/** True while a client navigation is in flight — for loading bars */
|
|
207
|
+
export const useNavigating = (): Accessor<boolean> => useLocation().navigating;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Typed params — `useParams<{ id: string }>()` for an ad-hoc shape or
|
|
211
|
+
* `useParams<"/users/[id]">()` for params derived from the route path
|
|
212
|
+
* (uses GeneratedRoutes when `.solid/routes.d.ts` is generated)
|
|
213
|
+
*/
|
|
214
|
+
export const useParams = <
|
|
215
|
+
P extends string | Record<string, string> = Record<string, string>,
|
|
216
|
+
>(): P extends RoutePath ? RouteParamsFor<P> : P =>
|
|
217
|
+
useContext(ParamsContext) as never;
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Route Module Normalization
|
|
3
|
+
* Lifts a `page()` definition into the flat module shape the runtime
|
|
4
|
+
* expects — `{ default: component, loader, beforeLoad, schema, ... }` —
|
|
5
|
+
* wrapping the component with head/transition handling
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { type Component, createComponent } from "solid-js";
|
|
9
|
+
import { seoTags, useHeadEffect } from "#head/presentation/useHead";
|
|
10
|
+
import type { SeoMetaInput } from "#head/types";
|
|
11
|
+
import type { RouteActionContext } from "../domain/operations/actions";
|
|
12
|
+
import type { LoaderContext } from "../domain/operations/loader";
|
|
13
|
+
import {
|
|
14
|
+
isRouteDef,
|
|
15
|
+
type RouteComponentProps,
|
|
16
|
+
type RouteDef,
|
|
17
|
+
redirect,
|
|
18
|
+
} from "./route-def";
|
|
19
|
+
|
|
20
|
+
/** `page({ actions })` → flat `action` export dispatching by __action */
|
|
21
|
+
const dispatchActions = (
|
|
22
|
+
actions: NonNullable<RouteDef["actions"]>,
|
|
23
|
+
): ((ctx: RouteActionContext) => Promise<unknown>) => {
|
|
24
|
+
return async (ctx) => {
|
|
25
|
+
const keys = Object.keys(actions);
|
|
26
|
+
const name =
|
|
27
|
+
String(ctx.form.get("__action") ?? "") ||
|
|
28
|
+
(keys.length === 1 ? keys[0] : "default");
|
|
29
|
+
const fn = actions[name] ?? actions.default;
|
|
30
|
+
if (!fn)
|
|
31
|
+
throw new Error(
|
|
32
|
+
`[solid-framework] unknown action "${name}" (have: ${keys.join(", ")})`,
|
|
33
|
+
);
|
|
34
|
+
return fn(ctx);
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/** Wrap the route component so `page({ head })` reaches the head sink */
|
|
39
|
+
const withHead = <D, Q>(
|
|
40
|
+
def: RouteDef<D, Q>,
|
|
41
|
+
): Component<RouteComponentProps<D, Q>> => {
|
|
42
|
+
if (
|
|
43
|
+
!def.head &&
|
|
44
|
+
!def.robots &&
|
|
45
|
+
!def.title &&
|
|
46
|
+
!def.canonical &&
|
|
47
|
+
!def.description &&
|
|
48
|
+
!def.keywords &&
|
|
49
|
+
!def.image
|
|
50
|
+
)
|
|
51
|
+
return def.component;
|
|
52
|
+
const head = def.head;
|
|
53
|
+
const extra: SeoMetaInput = {
|
|
54
|
+
...(def.robots ? { robots: def.robots } : {}),
|
|
55
|
+
...(def.title ? { title: def.title } : {}),
|
|
56
|
+
...(def.canonical ? { canonical: def.canonical } : {}),
|
|
57
|
+
...(def.description ? { description: def.description } : {}),
|
|
58
|
+
...(def.keywords ? { keywords: def.keywords } : {}),
|
|
59
|
+
...(def.image ? { ogImage: def.image, twitterImage: def.image } : {}),
|
|
60
|
+
};
|
|
61
|
+
return (props: RouteComponentProps<D, Q>) => {
|
|
62
|
+
useHeadEffect(() => {
|
|
63
|
+
const out = head
|
|
64
|
+
? head({ params: props.params, search: props.search, data: props.data })
|
|
65
|
+
: {};
|
|
66
|
+
const tags = Array.isArray(out) ? out : seoTags(out);
|
|
67
|
+
return [...tags, ...seoTags(extra)];
|
|
68
|
+
});
|
|
69
|
+
return createComponent(def.component, props);
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
/** head + transition-name wrapper around `page({ component })` */
|
|
74
|
+
const wrapPage = <D, Q>(
|
|
75
|
+
def: RouteDef<D, Q>,
|
|
76
|
+
): Component<RouteComponentProps<D, Q>> => {
|
|
77
|
+
const Headed = withHead(def);
|
|
78
|
+
if (!def.transition) return Headed;
|
|
79
|
+
return (props: RouteComponentProps<D, Q>) =>
|
|
80
|
+
createComponent("div" as unknown as Component<{ children?: unknown }>, {
|
|
81
|
+
get children() {
|
|
82
|
+
return createComponent(Headed, props);
|
|
83
|
+
},
|
|
84
|
+
style: { "view-transition-name": def.transition } as never,
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Normalize a resolved route module - if `default` is a page() def,
|
|
90
|
+
* lift its fields into the flat module shape the runtime expects
|
|
91
|
+
*/
|
|
92
|
+
export const normalizeRouteModule = <M extends Record<string, unknown>>(
|
|
93
|
+
mod: M,
|
|
94
|
+
): M => {
|
|
95
|
+
const def = mod.default;
|
|
96
|
+
if (!isRouteDef(def)) return mod;
|
|
97
|
+
return {
|
|
98
|
+
...mod,
|
|
99
|
+
default: wrapPage(def),
|
|
100
|
+
...(def.load ? { loader: def.load } : {}),
|
|
101
|
+
...(def.guard?.length || def.before || def.redirect
|
|
102
|
+
? {
|
|
103
|
+
beforeLoad: async (ctx: LoaderContext) => {
|
|
104
|
+
if (def.redirect) return redirect(def.redirect);
|
|
105
|
+
for (const g of def.guard ?? []) {
|
|
106
|
+
const r = await g(ctx);
|
|
107
|
+
if (r instanceof Response) return r;
|
|
108
|
+
}
|
|
109
|
+
return def.before?.(ctx);
|
|
110
|
+
},
|
|
111
|
+
}
|
|
112
|
+
: {}),
|
|
113
|
+
...(def.cache || def.ttl !== undefined
|
|
114
|
+
? {
|
|
115
|
+
loaderCache: {
|
|
116
|
+
...(def.cache ?? {}),
|
|
117
|
+
...(def.ttl !== undefined ? { ttl: def.ttl } : {}),
|
|
118
|
+
},
|
|
119
|
+
}
|
|
120
|
+
: {}),
|
|
121
|
+
...(def.params || def.body
|
|
122
|
+
? { schema: { params: def.params, body: def.body } }
|
|
123
|
+
: {}),
|
|
124
|
+
...(def.search ? { validateSearch: def.search } : {}),
|
|
125
|
+
...(def.actions
|
|
126
|
+
? {
|
|
127
|
+
action: dispatchActions(def.actions),
|
|
128
|
+
actionNames: Object.keys(def.actions),
|
|
129
|
+
}
|
|
130
|
+
: {}),
|
|
131
|
+
...(def.shell ? { shell: def.shell } : {}),
|
|
132
|
+
...(def.error ? { error: def.error } : {}),
|
|
133
|
+
...(def.loading ? { loading: def.loading } : {}),
|
|
134
|
+
...(def.poll
|
|
135
|
+
? {
|
|
136
|
+
poll: typeof def.poll === "number" ? def.poll : def.poll.every,
|
|
137
|
+
...(typeof def.poll === "object" && def.poll.pauseHidden
|
|
138
|
+
? { pollPauseHidden: true }
|
|
139
|
+
: {}),
|
|
140
|
+
}
|
|
141
|
+
: {}),
|
|
142
|
+
...(def.transition ? { transition: def.transition } : {}),
|
|
143
|
+
...(def.staleTime !== undefined ? { staleTime: def.staleTime } : {}),
|
|
144
|
+
...(def.offline !== undefined ? { offline: def.offline } : {}),
|
|
145
|
+
...(def.robots ? { robots: def.robots } : {}),
|
|
146
|
+
...(def.scripts !== undefined ? { scripts: def.scripts } : {}),
|
|
147
|
+
...(def.layout === false ? { layout: false } : {}),
|
|
148
|
+
...(def.scroll === false ? { scroll: false } : {}),
|
|
149
|
+
...(def.order !== undefined ? { order: def.order } : {}),
|
|
150
|
+
...(def.meta ? { meta: def.meta } : {}),
|
|
151
|
+
...(def.streaming !== undefined ? { streaming: def.streaming } : {}),
|
|
152
|
+
...(def.prerender ? { prerender: def.prerender } : {}),
|
|
153
|
+
...(def.staticParams ? { staticParams: def.staticParams } : {}),
|
|
154
|
+
};
|
|
155
|
+
};
|