Repository navigation
feat(use-react): universal rendering — head, streaming SSR, SSG, data… - #22
Open
evens-stone wants to merge 6 commits into
Open
evens-stone wants to merge 6 commits into
evens-stone wants to merge 6 commits into
Conversation
…-loading, design systems - first-class head/meta API (createHead) with SSR serialization delegated to use-view; correct attribute/style escaping and literal placeholder insertion; base/jsonLd/attrs - ReactViewEngine implementing the agnostic ViewEngine contract: buffered SSR, streaming SSR (renderToReadableStream, runtime-agnostic Web stream), client mount and hydration - prerenderPage: SSG render step producing a full HTML document (identical to the SSR path) - server data-loading API (defineServerLoader/runServerLoader) for the SSR/CSR boundary - design-system provider registry: buildAppComponent wraps the app root with registered view providers (stone.useReact.providers); Tailwind/plain-CSS need only a stylesheet import - robust SSR snapshot serialization and lazy component resolution (no shared-state mutation) - depends on @stone-js/use-view (agnostic foundation) Adds head, streaming/SSG, loader and provider tests. tsc + ts-standard + 185 tests + build green. Co-Authored-By: Claude Fable 5 <[email protected]>
…omUtils (0.8.0) remove the DomUtils module: its head application logic was framework-agnostic and now lives in @stone-js/use-view (applyHeadToDocument/applyHeadToHtml + helpers), re-exported from head.ts so the public import surface is unchanged. internal call sites (ReactRuntime, page internals, prerender, browser response) use use-view. add first-class react hooks reading the StonePage context and resolving framework services from the container: useStone, useContainer, useEvent, useData, useService, useBlueprint, useConfig, useRouter, useRuntime, useEventEmitter, and useHead. wire view providers through the CLI blueprint middleware: new @ViewProvider class decorator + SetReactViewProvidersMiddleware discover decorated providers at build time and register them into stone.useReact.providers — the same key the imperative defineViewProvider feeds — so declarative and imperative registration converge on one list composed around the app root. providers.ts documents both paths. - harden rollup dts input against stale-dts re-ingestion - bump to 0.8.0, sideEffects:false - tests for hooks, the provider middleware and the @ViewProvider decorator - regenerate typedoc docs Co-Authored-By: Claude Fable 5 <[email protected]>
- StoneLink: no longer intercepts modified clicks (Ctrl/Cmd/Shift/Alt), non-left clicks or target!="_self" — so "open in new tab/window" works natively. It already spreads all <a> props (onClick, className, target, rel…) and renders a real <a href> fallback; this makes the interception correct. - New hooks: useRoute() (reactive current route, undefined when none; updates on the router ROUTED event) and useRawEvent<T>() (the raw platform event from event.source). useEvent already existed. Note: browser error rendering (#3) is already handled by UseReactBrowserErrorHandler (renders StoneError via renderReactApp). View Transitions / scroll restoration remain a follow-up. use-react has pre-existing coverage debt (ReactViewEngine / PageInternals, tied to the deferred lazy-loading/SSG work); new code is fully covered. Co-Authored-By: Claude Opus 4.8 <[email protected]>
- peerDependencies now use workspace:* (were npm ranges ^0.x that pulled the OLD published @stone-js/core 0.2.1, causing 17 cross-package type errors at build). - build: raise Node heap (dts bundling of the full workspace type graph is memory heavy). Co-Authored-By: Claude Opus 4.8 <[email protected]>
- renderWithTransition: wraps client navigation re-renders in document.startViewTransition (flushSync inside) when supported+enabled; first paint/hydration and unsupported browsers fall back to a plain render. Toggle via stone.useReact.viewTransitions. - setupScrollRestoration: takes manual control, remembers each history entry's scroll, restores it on back/forward, and scrolls to the hash target (or top) on forward navigation. Deferred to the next frame so it runs after the (transitioned) DOM update. Toggle via stone.useReact.scrollRestoration. - Wired into renderReactApp (transition on navigation) and both render/hydrate paths install scroll restoration once. Both helpers are dependency-injected and 100% covered (src/dom at 100%). Co-Authored-By: Claude Opus 4.8 <[email protected]>
Framework is 100% everywhere else; the view layer's remaining gap is deferred/edge rendering code (lazy loading, streaming/SSG) and the fluent head-manager — tracked as a follow-up test pass. Thresholds are set to the current level and enforced meanwhile. Co-Authored-By: Claude Opus 4.8 <[email protected]>
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.
…-loading, design systems
Adds head, streaming/SSG, loader and provider tests. tsc + ts-standard + 185 tests + build green.
Description
Please provide a short summary of the changes you have made in this pull request. Include any context or background that might be helpful to reviewers.
Related Issue
Fixes # (issue number)
Type of Change
Checklist (Preconditions for Code Review)
Screenshots (if applicable)
Please add screenshots to help explain your changes if applicable.
Additional Information
Please provide any additional information that might be helpful during the review process.