Repository navigation
feat: emit cross-file types and generics on solid - #73
Merged
Merged
Conversation
Solid imports the types its output reads by name, from a `.ts` module or a package as written and from a child's output, and the output of a module's main component writes the module's other type exports in source order (ADR-0067, ADR-0068). A generic component is a generic function component, and the interfaces Solid declares for its events, models and slots take the type parameters their members read, so a scoped slot's fill is typed with the consumer's `T`. A `<select>` bound to a model of `T` writes the chosen value as `T`. Adds Solid's consumer fixtures for the types and generics cases, empties its quarantine, and brings those cases back into its package tests. The canaries find a generic component's template past its type parameters. Co-authored-by: multica-agent <github@multica.ai>
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://solid-types-generics-uxf-463-unframework.blue-water-0397.workers.dev (commit 1e86725)This URL reflects your latest Preview deploymentPreview Deployments by commit
|
A generic component's setup constant or function that names one of its type parameters stays inside the generic function instead of moving to module scope, where `T` is not in scope. The interfaces Solid declares for events, models and slots take every type parameter a chain of constraints reaches (`T extends U, U extends V`), not only one step of it. The canaries' `L4-consumer` widening finds a generic component's parameters through the same finder as its template, and Solid's golden-wide L4 test that names each injected error gets the same 60 s timeout as its sibling. Co-authored-by: multica-agent <github@multica.ai>
…-types-generics-uxf-463 # Conflicts: # tests/integration/harness/canaries.ts
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.
What changed
Cross-file types and generic components on Solid, which turns its column of the types and generics cases green (ADR-0067, ADR-0068). Only Solid's output changes.
import typeby name through codegen'saddTypeImports(./types, a package as written, a child's types from./Field), and in the output of a module's main component its other type exports and re-exports in source order (typeExportsCode). A generic component is a generic function component,function List<T>(props: ListProps<T>). The interfaces Solid declares for a component's events, models and slots take the type parameters their members read (PickerSlots<T>), so a scoped slot's fill is typed with the consumer'sT(generic-slot-props, native). A<select>bound to a model ofTwrites the chosen value asT. Setup code that names a type parameter (function label(item: T),const none: T[]) stays inside the generic function, whereTis in scope, and a generated interface declares every type parameter a chain of constraints reaches (T extends U, U extends V).typeand generic misuses: a scoped slot's fill that reads a memberTlacks fails with TS2339.function List<T>() through one finder, which places the corruptions and letsL4-consumerwiden a generic component's inline props. It is merged with React's lane, which taught the same finder the same form.Parity matrix
.ts: 1402 files, 8829 tests passed, 242 skipped, and the summary reports the matrix green.types/(8),generics/(4) anddiagnostics/generic-slot-propspass at every live layer; the skips are layers those cases have nothing for.Checklist
feat(web): sell the next framework on the homepage.pnpm format:check,pnpm lint,pnpm check-typesandpnpm testpass. (The first three pass. In place ofpnpm test: Solid's package tests and the whole integration suite, both green, from a checkout whose path holds no.ts.)pnpm changeset(see.changeset/README.md).pnpm build, thenpnpm --filter web lighthouse, still scores at least 0.95 in every category.