Repository navigation
Give an optional prop one way, and a function child one way - #10
Merged
Merged
Conversation
0.10.0 took a bare name as an optional prop, ?title=note, for an accessor of an option, while everywhere else a bare name is a value read once and what changes is fun () -> e: an optional prop had two forms for one meaning, and title=note and ?title=note meant different things. It is now refused, with a message, so a prop is given one way, required or optional. A function child had two forms too, in place as the child and as render=(fun ...); render= is now a function's name alone, as it was made for.
This was referenced Nov 15, 2026
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.
Why
0.10.0 took a bare name as an optional prop,
?title=note, for an accessor of an option, while everywhere else a bare name is a value read once and what changes isfun () -> e: an optional prop had two forms for one meaning, andtitle=noteand?title=notemeant different things. A function child had two forms too, in place as the child and asrender=(fun ...). Each now has one, and the other is refused with a message saying which to write.Changes
?title=noteis refused; an optional prop is?title=(fun () -> S.get note), as a required one is.render=(fun ...)is refused; a function written in place is the child,<C>(fun ...)</C>, andrender=fgives one by its name.Verified
make test: dune's tests, with a compile case for each refusal, the plugin's 38 and vitest's 963;make lint;make docswith no warning.