Repository navigation
Dispatch @deriving by name instead of through a registry - #9157
Conversation
Ast_derive kept a process-global table of derivers, filled at startup by a side effect in Bs_builtin_ppx, with a single entry (accessors) and an expression_gen field nothing read. dispatch now matches the name directly, so it stays the one place a future deriver would be resolved. The projector exposes its generators as plain functions. New super_errors fixtures pin the unknown-deriver and configuration errors, which are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kbf3gKyiYMf54wPRxFdUWe Signed-off-by: Christoph Knittel <ck@cca.io>
Changelog💅 Polish
🏠 Internal
Semantic Diff2 commits · Full page Dispatch
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #9157 +/- ##
=======================================
Coverage 81.74% 81.75%
=======================================
Files 460 460
Lines 64944 64941 -3
=======================================
- Hits 53091 53090 -1
+ Misses 11853 11851 -2
🚀 New features to boost your workflow:
|
Why:
Review: "lenses is not supported" and "such configuration is not
supported" didn't say which attribute was wrong or what to write
instead. The messages now follow the removed-deriver ones.
Diagnostic modified (unknown deriver):
Example:
@deriving(lenses)
type t = {name: string}
Before (diagnostic): lenses is not supported
After (diagnostic): @deriving(lenses) is not supported. The only deriver is @deriving(accessors).
Diagnostic modified (configuration for accessors):
Example:
@deriving({accessors: true})
type t = {name: string}
Before (diagnostic): such configuration is not supported
After (diagnostic): @deriving(accessors) takes no configuration.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kbf3gKyiYMf54wPRxFdUWe
Signed-off-by: Christoph Knittel <ck@cca.io>
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
rescript
@rescript/belt
@rescript/darwin-arm64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
|
Developer playground preview: https://rescript-lang.github.io/rescript/dev-playground/?version=pr-9157 |
Split out of #9153.
Ast_derivekept a process-global table of derivers, filled at startup by a side effect inBs_builtin_ppx. It had a single entry (accessors), and anexpression_genfield nothing read.dispatchnow matches on the deriver name directly, still giving the removed derivers (abstract,jsConverter) their dedicated errors.Ast_derive_projectorexposescheck_config,structure_genandsignature_genas plain functions, and no longer depends onAst_derive.A future deriver, for example a user-defined one from compile-time evaluation, would be resolved per compilation in
dispatch, from what is in scope. A table filled once when the process starts would be the wrong place for that, especially with rewatch compiling many packages in one process.New
super_errorsfixtures,deriving_unknown.resandderiving_accessors_config.res, pin the two error pathsdispatchhandles. A second commit makes both messages say which attribute is wrong and what to write instead, in the style of the removed-deriver errors:@deriving(lenses)lenses is not supported@deriving(lenses) is not supported. The only deriver is @deriving(accessors).@deriving({accessors: true})such configuration is not supported@deriving(accessors) takes no configuration.Most of the
ast_derive_projector.mldiff is re-indentation; with-wit is +41/−83 across the PR.🤖 Generated with Claude Code
https://claude.ai/code/session_01Kbf3gKyiYMf54wPRxFdUWe