-
-
Notifications
You must be signed in to change notification settings - Fork 57
feat: allow exporting invalid OCaml identifiers in JS #714
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
Merged
anmonteiro
merged 7 commits into
main
from
anmonteiro/allow-exporting-invalid-identifiers
Sep 5, 2023
Merged
feat: allow exporting invalid OCaml identifiers in JS #714
anmonteiro
merged 7 commits into
main
from
anmonteiro/allow-exporting-invalid-identifiers
Sep 5, 2023
Conversation
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
jchavarri
reviewed
Sep 3, 2023
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.
This is great, thanks! 🤗 lmk if you want me to help with any of the suggestions, if they make sense.
jchavarri
approved these changes
Sep 3, 2023
davesnx
reviewed
Sep 3, 2023
* use for_js, don't export OCaml id * add test to showcase consumption * use mel.as --------- Co-authored-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
51ce599
to
6c7784b
Compare
anmonteiro
added a commit
to anmonteiro/opam-repository
that referenced
this pull request
Sep 14, 2023
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)).
mseri
pushed a commit
to ocaml/opam-repository
that referenced
this pull request
Sep 16, 2023
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)).
Open
nberth
pushed a commit
to nberth/opam-repository
that referenced
this pull request
Jun 18, 2024
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)).
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.
fixes #713