Skip to content

Give an optional prop one way, and a function child one way - #10

Merged
zaiev merged 1 commit into
mainfrom
give-an-optional-prop-one-way
Nov 15, 2026
Merged

zaiev merged 1 commit into
mainfrom
give-an-optional-prop-one-way

Conversation

@zaiev

@zaiev zaiev commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

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 is fun () -> e: an optional prop had two forms for one meaning, and title=note and ?title=note meant different things. A function child had two forms too, in place as the child and as render=(fun ...). Each now has one, and the other is refused with a message saying which to write.

Changes

  • Breaking: ?title=note is refused; an optional prop is ?title=(fun () -> S.get note), as a required one is.
  • Breaking: render=(fun ...) is refused; a function written in place is the child, <C>(fun ...)</C>, and render=f gives 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 docs with no warning.
  • Every JSX position the ppx lowers listed with the forms it takes: each meaning has one form.

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.
@zaiev
zaiev merged commit 1ffe793 into main Nov 15, 2026
2 checks passed
@zaiev
zaiev deleted the give-an-optional-prop-one-way branch November 15, 2026 14:32
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