-
-
Notifications
You must be signed in to change notification settings - Fork 57
[melange.ppx]: move the entire PPX frontend to melange.ppx #583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
d3c46a2
to
c6d58ca
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
|
||
type xx = < x : int > Js.t | ||
[@@bs.deriving accessors] | ||
(* Not applicable to this type. *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if the deriving
attribute is applied to an invalid type? Unused warning, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup
@@ -69,7 +69,7 @@ let assemble_obj_args (labels : External_arg_spec.obj_params) | |||
match acc with | |||
| Splice2 _ | Splice0 -> assert false | |||
| Splice1 x -> | |||
((Js_op.Lit label, x) :: accs, Ext_list.append new_eff eff, assign) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the goal to get rid of Ext_list
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I regret doing this mixed with the other changes, but I removed some functions that existed in List.
for the OCaml versions that we support.
// Generated by Melange | ||
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a bit strange to include this in the error output. I understand it is caused by the hack to preserve melc
behavior to avoid adding -ppx melppx
to dune?
CHANGES: - Build executables for bytecode-only platforms too ([melange-re/melange#596](melange-re/melange#596)) - Move the entire builtin PPX to `melange.ppx`. Preprocessing with `melange.ppx` will needed in most cases going forward, as it's responsible for processing `external` declarations, `@deriving` attributes and more, compared to the previous release where `melange.ppx` just processed AST extension nodes ([melange-re/melange#583](melange-re/melange#583)) - Remove old BuckleScript-style conditional compilation ([melange-re/melange#605](melange-re/melange#605)) - Don't emit JS import / require paths with `foo/./bar.js` ([melange-re/melange#598](melange-re/melange#598), [melange-re/melange#612](melange-re/melange#612)) - Wrap the melange runtime ([melange-re/melange#624](melange-re/melange#624), [melange-re/melange#637](melange-re/melange#637)). After this change, Melange exposes fewer toplevel modules. Melange runtime / stdlib modules are now wrapped under: - `Caml*` / `Curry` modules are part of the runtime and keep being exposed as before - `Js.*` contains all the modules previously accessible via `Js_*`, e.g. `Js_int` -> `Js.Int` - `Belt.*` wraps all the `Belt` modules; `Belt_List` etc. are not exposed anymore, but rather nested under `Belt`, e.g. `Belt.List` - `Node.*`: we now ship a `melange.node` library that includes the modules containing Node.js bindings. After this change, users will have to depend on `melange.node` explicitly in order to use the `Node.*` modules - `Dom.*`: we now ship a `melange.dom` library that includes the modules containing Node.js bindings. This library is included by default so the `Dom` module will always be available in Melange projects. - Disable warning 61 (`unboxable-type-in-prim-decl`) for externals generated by Melange ([melange-re/melange#641](melange-re/melange#641), [melange-re/melange#643](melange-re/melange#643)) - Add `--rectypes` ([melange-re/melange#644](melange-re/melange#644)) to enable [recursive types](https://v2.ocaml.org/releases/5.0/htmlman/types.html#sss:typexpr-aliased-recursive) - [melange.ppx]: Deprecate `bs.*` attributes in favor of `mel.*` ([melange-re/melange#566](melange-re/melange#566), [melange-re/melange#662](melange-re/melange#662), [melange-re/melange#663](melange-re/melange#663)) - [melange]: Fix field access code generation when `open`in inline functor applications ([melange-re/melange#661](melange-re/melange#661), [melange-re/melange#664](melange-re/melange#664)) - [melange]: Upgrade the OCaml typechecker version to 5.1 ([melange-re/melange#668](melange-re/melange#668)) - [melange.ppx]: Deprecate `[@@mel.val]` and suggest its removal. This attribute is redundant and unnecessary ([melange-re/melange#675](melange-re/melange#675), [melange-re/melange#678](melange-re/melange#678)) - [melange]: remove old, unused CLI flags: `-bs-ns`, `-bs-cmi`, `-bs-cmj`, `-bs-no-builtin-ppx`, `-bs-super-errors` ([melange-re/melange#686](melange-re/melange#686)). - [melange]: generate correct code for types with the `option` shape ([melange-re/melange#700](melange-re/melange#700)). - [melange]: stop exporting `$$default` in the generated JavaScript when using ES6 default exports `let default = ..` ([melange-re/melange#708](melange-re/melange#708)). - [melange]: allow exporting invalid OCaml identifiers in the resulting JavaScript with `@mel.as` ([melange-re/melange#714](melange-re/melange#714), fixes [melange-re/melange#713](melange-re/melange#713)). - [melange]: Allow using `@mel.as` in external declarations without explicitly annotating `@mel.{string,int}` ([melange-re/melange#722](melange-re/melange#722), fixes [melange-re/melange#578](melange-re/melange#578)). - [melange]: Allow using `@mel.unwrap` in external declarations with `@mel.obj` ([melange-re/melange#724](melange-re/melange#724), fixes [melange-re/melange#679](melange-re/melange#679)). - [melange]: Support renaming fields in inline records / record extensions with `@mel.as` ([melange-re/melange#732](melange-re/melange#732), fixes [melange-re/melange#730](melange-re/melange#730)).
CHANGES: - Build executables for bytecode-only platforms too ([melange-re/melange#596](melange-re/melange#596)) - Move the entire builtin PPX to `melange.ppx`. Preprocessing with `melange.ppx` will needed in most cases going forward, as it's responsible for processing `external` declarations, `@deriving` attributes and more, compared to the previous release where `melange.ppx` just processed AST extension nodes ([melange-re/melange#583](melange-re/melange#583)) - Remove old BuckleScript-style conditional compilation ([melange-re/melange#605](melange-re/melange#605)) - Don't emit JS import / require paths with `foo/./bar.js` ([melange-re/melange#598](melange-re/melange#598), [melange-re/melange#612](melange-re/melange#612)) - Wrap the melange runtime ([melange-re/melange#624](melange-re/melange#624), [melange-re/melange#637](melange-re/melange#637)). After this change, Melange exposes fewer toplevel modules. Melange runtime / stdlib modules are now wrapped under: - `Caml*` / `Curry` modules are part of the runtime and keep being exposed as before - `Js.*` contains all the modules previously accessible via `Js_*`, e.g. `Js_int` -> `Js.Int` - `Belt.*` wraps all the `Belt` modules; `Belt_List` etc. are not exposed anymore, but rather nested under `Belt`, e.g. `Belt.List` - `Node.*`: we now ship a `melange.node` library that includes the modules containing Node.js bindings. After this change, users will have to depend on `melange.node` explicitly in order to use the `Node.*` modules - `Dom.*`: we now ship a `melange.dom` library that includes the modules containing Node.js bindings. This library is included by default so the `Dom` module will always be available in Melange projects. - Disable warning 61 (`unboxable-type-in-prim-decl`) for externals generated by Melange ([melange-re/melange#641](melange-re/melange#641), [melange-re/melange#643](melange-re/melange#643)) - Add `--rectypes` ([melange-re/melange#644](melange-re/melange#644)) to enable [recursive types](https://v2.ocaml.org/releases/5.0/htmlman/types.html#sss:typexpr-aliased-recursive) - [melange.ppx]: Deprecate `bs.*` attributes in favor of `mel.*` ([melange-re/melange#566](melange-re/melange#566), [melange-re/melange#662](melange-re/melange#662), [melange-re/melange#663](melange-re/melange#663)) - [melange]: Fix field access code generation when `open`in inline functor applications ([melange-re/melange#661](melange-re/melange#661), [melange-re/melange#664](melange-re/melange#664)) - [melange]: Upgrade the OCaml typechecker version to 5.1 ([melange-re/melange#668](melange-re/melange#668)) - [melange.ppx]: Deprecate `[@@mel.val]` and suggest its removal. This attribute is redundant and unnecessary ([melange-re/melange#675](melange-re/melange#675), [melange-re/melange#678](melange-re/melange#678)) - [melange]: remove old, unused CLI flags: `-bs-ns`, `-bs-cmi`, `-bs-cmj`, `-bs-no-builtin-ppx`, `-bs-super-errors` ([melange-re/melange#686](melange-re/melange#686)). - [melange]: generate correct code for types with the `option` shape ([melange-re/melange#700](melange-re/melange#700)). - [melange]: stop exporting `$$default` in the generated JavaScript when using ES6 default exports `let default = ..` ([melange-re/melange#708](melange-re/melange#708)). - [melange]: allow exporting invalid OCaml identifiers in the resulting JavaScript with `@mel.as` ([melange-re/melange#714](melange-re/melange#714), fixes [melange-re/melange#713](melange-re/melange#713)). - [melange]: Allow using `@mel.as` in external declarations without explicitly annotating `@mel.{string,int}` ([melange-re/melange#722](melange-re/melange#722), fixes [melange-re/melange#578](melange-re/melange#578)). - [melange]: Allow using `@mel.unwrap` in external declarations with `@mel.obj` ([melange-re/melange#724](melange-re/melange#724), fixes [melange-re/melange#679](melange-re/melange#679)). - [melange]: Support renaming fields in inline records / record extensions with `@mel.as` ([melange-re/melange#732](melange-re/melange#732), fixes [melange-re/melange#730](melange-re/melange#730)).
CHANGES: - Build executables for bytecode-only platforms too ([melange-re/melange#596](melange-re/melange#596)) - Move the entire builtin PPX to `melange.ppx`. Preprocessing with `melange.ppx` will needed in most cases going forward, as it's responsible for processing `external` declarations, `@deriving` attributes and more, compared to the previous release where `melange.ppx` just processed AST extension nodes ([melange-re/melange#583](melange-re/melange#583)) - Remove old BuckleScript-style conditional compilation ([melange-re/melange#605](melange-re/melange#605)) - Don't emit JS import / require paths with `foo/./bar.js` ([melange-re/melange#598](melange-re/melange#598), [melange-re/melange#612](melange-re/melange#612)) - Wrap the melange runtime ([melange-re/melange#624](melange-re/melange#624), [melange-re/melange#637](melange-re/melange#637)). After this change, Melange exposes fewer toplevel modules. Melange runtime / stdlib modules are now wrapped under: - `Caml*` / `Curry` modules are part of the runtime and keep being exposed as before - `Js.*` contains all the modules previously accessible via `Js_*`, e.g. `Js_int` -> `Js.Int` - `Belt.*` wraps all the `Belt` modules; `Belt_List` etc. are not exposed anymore, but rather nested under `Belt`, e.g. `Belt.List` - `Node.*`: we now ship a `melange.node` library that includes the modules containing Node.js bindings. After this change, users will have to depend on `melange.node` explicitly in order to use the `Node.*` modules - `Dom.*`: we now ship a `melange.dom` library that includes the modules containing Node.js bindings. This library is included by default so the `Dom` module will always be available in Melange projects. - Disable warning 61 (`unboxable-type-in-prim-decl`) for externals generated by Melange ([melange-re/melange#641](melange-re/melange#641), [melange-re/melange#643](melange-re/melange#643)) - Add `--rectypes` ([melange-re/melange#644](melange-re/melange#644)) to enable [recursive types](https://v2.ocaml.org/releases/5.0/htmlman/types.html#sss:typexpr-aliased-recursive) - [melange.ppx]: Deprecate `bs.*` attributes in favor of `mel.*` ([melange-re/melange#566](melange-re/melange#566), [melange-re/melange#662](melange-re/melange#662), [melange-re/melange#663](melange-re/melange#663)) - [melange]: Fix field access code generation when `open`in inline functor applications ([melange-re/melange#661](melange-re/melange#661), [melange-re/melange#664](melange-re/melange#664)) - [melange]: Upgrade the OCaml typechecker version to 5.1 ([melange-re/melange#668](melange-re/melange#668)) - [melange.ppx]: Deprecate `[@@mel.val]` and suggest its removal. This attribute is redundant and unnecessary ([melange-re/melange#675](melange-re/melange#675), [melange-re/melange#678](melange-re/melange#678)) - [melange]: remove old, unused CLI flags: `-bs-ns`, `-bs-cmi`, `-bs-cmj`, `-bs-no-builtin-ppx`, `-bs-super-errors` ([melange-re/melange#686](melange-re/melange#686)). - [melange]: generate correct code for types with the `option` shape ([melange-re/melange#700](melange-re/melange#700)). - [melange]: stop exporting `$$default` in the generated JavaScript when using ES6 default exports `let default = ..` ([melange-re/melange#708](melange-re/melange#708)). - [melange]: allow exporting invalid OCaml identifiers in the resulting JavaScript with `@mel.as` ([melange-re/melange#714](melange-re/melange#714), fixes [melange-re/melange#713](melange-re/melange#713)). - [melange]: Allow using `@mel.as` in external declarations without explicitly annotating `@mel.{string,int}` ([melange-re/melange#722](melange-re/melange#722), fixes [melange-re/melange#578](melange-re/melange#578)). - [melange]: Allow using `@mel.unwrap` in external declarations with `@mel.obj` ([melange-re/melange#724](melange-re/melange#724), fixes [melange-re/melange#679](melange-re/melange#679)). - [melange]: Support renaming fields in inline records / record extensions with `@mel.as` ([melange-re/melange#732](melange-re/melange#732), fixes [melange-re/melange#730](melange-re/melange#730)).
foo |. bar
/foo->bar
) tomelange.ppx
jscomp/frontend
to the melange ppxfixes #568
bs.deriving {abstract,accessors,jsConverter}
in favor ofderiving {abstract,accessors,jsConverter}
bs.deriving
form[@@deriving abstract]
:[@bs.optional]
types to be annotated withoption
explicitly.<..> Js.t
representation for@@deriving abstract
.