Repository navigation
Release 0.15.0: refactored generators - #19
Merged
Merged
Conversation
A review of how a TypeScript library becomes a binding found places where a wrong program still compiled or a wrong build still ran. A function's type does not say whether it takes its arguments at once: fun a b -> e and a function that takes a, then gives a function of b, are one type and two JavaScript functions. One of the second kind given to For, Index, a component's function prop or Kobalte's on_open_change compiled and was called wrong, or never. Carrying the arity in the type was weighed and refused: a caller would write every such function in place, and read an error that names Melange's calling convention. So whoever receives the function applies it as OCaml applies one it did not make: the ppx's read of a prop, For and Index as components over Solid's, a generated part through Solidtype.Arity, a generated constructor and function inside the binding. And a function JavaScript hands to OCaml is wrapped at the binding to its arity, since Melange calls one it did not make by its length. A type argument typed any was written _, so reading it gave whatever type the caller chose; it is Types.Unknown.t where it is read. A bigint was bound as an object named for where it was first met. Kobalte's and Html's generators dropped what no rule mapped without a word, where rhp's failed: every generator now fails unless the declaration is named as left out, with why, and a name left out that no longer applies fails it too. A module of Types was named for where its type was first met, and numbered when two met at one name, so Bins was a function's options and Bins2 what it gave, by the order they were read in. A type with no name is now named by the path to it, a parameter's name after its function's, and two types of one name fail the run until the generator names each. The plugin moved a bound function to its use without asking whether the names it reads mean the same there, and removed the markers' import while a marker held as a value still named it. The core was one file of a thousand lines over module-level state, so it bound one library a process and nothing could test a rule alone. It is a Binding made per library, with the mapping, the emitters and the Types file each a file, the way a value crosses passed rather than ambient, a test per rule, and one driver that reads a package and writes its files, so a library of functions is a few calls. A generator wrote each file as lines it indented, and its interface as other lines beside them, so a comment was a line some declaration followed: 167 of Kobalte's fields carried the next one's description, and ocamlformat refused the files. A generator now says what a file declares, each declaration with its comment; one printer writes the file and its interface, and ocamlformat lays them out, as it does any file here. Every file parses to the declarations it had. AGENTS.md had grown to 754 lines, most of them a tree that repeated each module's own .mli and rules that restated the pipeline: its layout now says where things are and what no file says of itself, and its rules are grouped by what they hold. impeccable's configuration, which nothing here reads, is removed.
CI's lower-bounds job runs the tests against the oldest Melange the packages allow, whose Dom is laid out where the generators do not look, so the rule tests failed there before one ran: they are lint's, beside the generators' own check. And a marker's error is printed without colour, which CI's terminal added and the test read as text.
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
A review of how a TypeScript library becomes a binding found places where a wrong program still compiled or a wrong build still ran.
A function's type does not say whether it takes its arguments at once: fun a b -> e and a function that takes a, then gives a function of b, are one type and two JavaScript functions. One of the second kind given to For, Index, a component's function prop or Kobalte's on_open_change compiled and was called wrong, or never. Carrying the arity in the type was weighed and refused: a caller would write every such function in place, and read an error that names Melange's calling convention. So whoever receives the function applies it as OCaml applies one it did not make: the ppx's read of a prop, For and Index as components over Solid's, a generated part through Solidtype.Arity, a generated constructor and function inside the binding. And a function JavaScript hands to OCaml is wrapped at the binding to its arity, since Melange calls one it did not make by its length.
A type argument typed any was written _, so reading it gave whatever type the caller chose; it is Types.Unknown.t where it is read. A bigint was bound as an object named for where it was first met. Kobalte's and Html's generators dropped what no rule mapped without a word, where rhp's failed: every generator now fails unless the declaration is named as left out, with why, and a name left out that no longer applies fails it too.
A module of Types was named for where its type was first met, and numbered when two met at one name, so Bins was a function's options and Bins2 what it gave, by the order they were read in. A type with no name is now named by the path to it, a parameter's name after its function's, and two types of one name fail the run until the generator names each.
The plugin moved a bound function to its use without asking whether the names it reads mean the same there, and removed the markers' import while a marker held as a value still named it.
The core was one file of a thousand lines over module-level state, so it bound one library a process and nothing could test a rule alone. It is a Binding made per library, with the mapping, the emitters and the Types file each a file, the way a value crosses passed rather than ambient, a test per rule, and one driver that reads a package and writes its files, so a library of functions is a few calls.
A generator wrote each file as lines it indented, and its interface as other lines beside them, so a comment was a line some declaration followed: 167 of Kobalte's fields carried the next one's description, and ocamlformat refused the files. A generator now says what a file declares, each declaration with its comment; one printer writes the file and its interface, and ocamlformat lays them out, as it does any file here. Every file parses to the declarations it had.
AGENTS.md had grown to 754 lines, most of them a tree that repeated each module's own .mli and rules that restated the pipeline: its layout now says where things are and what no file says of itself, and its rules are grouped by what they hold. impeccable's configuration, which nothing here reads, is removed.
Changes
Typesis named by one rule and never numbered;CHANGES.mdlists each rename in Kobalte, rhp and @internationalized/date.anyisTypes.Unknown.twhere it is read; abigintisJs.Bigint.t;For.componentandIndex.componentare components over Solid's;Types.Toast_Toaster.makeis gone.Verified
make lint,make testandmake docspass on this commit.For,Index, a component and Kobalte's Combobox, failed before and passes now; a list and an adapted component keep the server's nodes when hydrated.