Skip to content

Conversation

anmonteiro
Copy link
Member

fixes #713

@anmonteiro anmonteiro requested a review from jchavarri September 3, 2023 02:27
Copy link
Member

@jchavarri jchavarri left a 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.

anmonteiro and others added 6 commits September 4, 2023 15:35
* 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>
@anmonteiro anmonteiro force-pushed the anmonteiro/allow-exporting-invalid-identifiers branch from 51ce599 to 6c7784b Compare September 4, 2023 22:38
@anmonteiro anmonteiro merged commit 6a29e7a into main Sep 5, 2023
@anmonteiro anmonteiro deleted the anmonteiro/allow-exporting-invalid-identifiers branch September 5, 2023 00:18
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)).
@jchavarri jchavarri mentioned this pull request Oct 21, 2023
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow to export values with invalid OCaml names
3 participants