Skip to content

Align language checks, lowering and the runtime - #98

Open
devagrawal09 wants to merge 29 commits into
solidjs:mainfrom
devagrawal09:upstream/lang-fixes
Open

devagrawal09 wants to merge 29 commits into
solidjs:mainfrom
devagrawal09:upstream/lang-fixes

Conversation

@devagrawal09

Copy link
Copy Markdown
Collaborator

What and why

Make real relative JS modules win over the injected ./api, and erase declaration-only imports. Extend written .d.rx declarations with private aliases, generics, type imports and failure rows. Fix casts, computed keys, multiline chains, escapes, fragments and JSX spacing across the reference and Rust implementations.

Recover diagnostics independently across modules. Align rx-tsc with declaration-file precedence, source write types, and handler snapshots. Diagnose misplaced styles, statically shadowed typed boundaries, and unsupported action defaults. Add the fixed pure JavaScript prelude and detach store snapshots at action call time without changing ordinary JS argument identity. Block-function equations still instantiate; SNAPSHOT_ARGUMENT explains when to use an expression-bodied function instead.

This change includes checker and lowering parity in compiler CI. It does not include declaration generation, dev keys or the map.

Breaking changes

  • A real ./api takes precedence; an unresolved injected API with no implementation reports MISSING_TEST_API.
  • Corrected escape and JSX whitespace handling can change rendered text.
  • STYLE_SCOPE and DEAD_TYPED_BOUNDARY reject previously accepted shapes. The latter only fires when the inner fallback is statically inert.
  • Structured store arguments to actions retain their call-time state rather than following subsequent writes.

Verification

Check Result
Interpreter, Solid oracle, compiled scenarios Pass
TypeScript projection scenarios 202 pass
SSR/hydration 143 pass, 1 fail, 7 skipped; S-solid-28 observed a late hydration frame before its expected answer
Rust tests, Node-API, runtime Pass
Checker and projection parity 414/414 and 235/235
Lowering parity 209/239 after esbuild normalization across three targets; the exact 30 mismatches match the CI baseline

Questions for Ryan

  • Is the fixed pure prelude the right boundary, or should more names require foreign declarations?
  • Is static-fallback-only DEAD_TYPED_BOUNDARY the right level of proof for an error?
  • Does real-file precedence leave the injected API in the right role for tests and small examples?

… its line.

`e as T` is TypeScript's assertion: erased where the program runs, kept in the projection. A statement-bodied arrow that fails to parse is no longer re-read as a record, which blamed the handler's `let` with JS_LOCAL.
`source open := false` is already a boolean. Inside `{if open}` the read is `true`, and `open := false` was checked against that. The projection keeps the slot's type and checks the write against it.
The projection checks the import against the declaration, so a ref parameter or result is that type and not the accessor the implementation is written with. The compiled import is unchanged.
The read happens when the handler runs, and the branch may no longer hold. Snapshot into a local and narrow that. A check inside the handler still narrows its own snapshot.
…s an error.

CSS-2 already scopes a stylesheet to its own view, so Row stayed unstyled with no warning. STYLE_SCOPE names the other component and the fix: its own style, or a class map.
…has none.

n++ in a handler was reported as a generic parse error once the statement reading won outright. The expression reading's ASSIGNMENT hint is kept, and JS_LOCAL from re-reading the body as a record is not.
NoteList's stylesheet does not reach Row (CSS-2). .when and td were pruned; they belong on Row.
…eeps the value.

`out := s as Status` evaluated to undefined: the oracle's expression walk had no case for `as`. The checker walks through it too, so the read is still the operand.
…rt type.

The projection aliases the other declare namespace, not the sibling .ts.
The model marks that region shadowed by the inner one, so the map can draw it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant