Skip to content
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

[lite-version] Separate into melange.ppx and melange.ppx-lib #534

Merged
merged 12 commits into from
Apr 22, 2023

Conversation

anmonteiro
Copy link
Member

@anmonteiro anmonteiro commented Apr 6, 2023

in summary:

  • we fix the bug that prompted this change
  • we set up a path towards incremental migration without having to do it all at once

part of #463

@anmonteiro
Copy link
Member Author

This is still not 100% right. Ast_derive_js_mapper emits extensions which are expected to be expanded later, but will now need to be expanded inline.

@anmonteiro anmonteiro force-pushed the anmonteiro/melange-ppx-lite branch 3 times, most recently from 6c45d8d to 09e9abf Compare April 10, 2023 02:00
@anmonteiro anmonteiro force-pushed the anmonteiro/melange-ppx-lite branch from 09e9abf to 5a83a43 Compare April 16, 2023 01:28
@anmonteiro anmonteiro force-pushed the anmonteiro/melange-ppx-lite branch from 30607b3 to aae8fda Compare April 16, 2023 04:46
@anmonteiro anmonteiro mentioned this pull request Apr 22, 2023
@anmonteiro
Copy link
Member Author

The last few commits allow making progress here without having ocaml/dune#7373 land first.

@anmonteiro anmonteiro merged commit d87e473 into main Apr 22, 2023
@anmonteiro anmonteiro deleted the anmonteiro/melange-ppx-lite branch April 22, 2023 09:56
jchavarri added a commit that referenced this pull request May 4, 2023
* main:
  feat(melange): add `--preamble` for e.g. "use client" (#545)
  fix(ci): never re-run the `anonymous` function
  test: interaction between `[@@@bs.config {flags = ...}]` and `--as-ppx`
  melange: delete dead code across the ext library (#552)
  melc: delete Ext_json and related modules, use dune-build-info for (#551)
  melc: remove old namespace system, legacy mode (#550)
  chore: changelog entry for #548
  feat(melange): installable and usable in more OCaml versions (#548)
  fix(melange): improve error message for file-level flags handler (#549)
  melange: allow vendoring without having node.js installed (#547)
  [lite-version] Separate into melange.ppx and melange.ppx-lib (#534)
  chore: remove mel (#546)
  chore: update flakes (#543)
  Add test for doc comment attached to `%%private` (#542)
anmonteiro added a commit to anmonteiro/opam-repository that referenced this pull request May 31, 2023
CHANGES:

- melange: print an error message if `$MELANGELIB` is set to a directory that
  doesn't exist ([melange-re/melange#449](melange-re/melange#449))
- melange: fix bug where `--bs-module-name` didn't always affect generated JS
  file casing ([melange-re/melange#446](melange-re/melange#446))
- melange: fix bug where `-o output.js` didn't always write a JavaScript file
  ([melange-re/melange#454](melange-re/melange#454))
- melange: remove the `-bs-read-cmi` flag in favor of the builtin
  `-intf-suffix` flag, standard in OCaml
  ([melange-re/melange#458](melange-re/melange#458),
  [melange-re/melange#460](melange-re/melange#460))
- melange: return an actionable error message when no output is specified
  with `-impl` / `-intf`
  ([melange-re/melange#465](melange-re/melange#465),
  [melange-re/melange#466](melange-re/melange#466))
- melange: use `Object.prototype.hasOwnProperty` in the `Caml_obj` runtime
  ([melange-re/melange#469](melange-re/melange#469))
- melange: transform
  [`NonEscapeCharacter`](https://tc39.es/ecma262/#prod-NonEscapeCharacter)
  correctly in JS strings (those written using `{js|string here|js}`)
  ([melange-re/melange#469](melange-re/melange#469))
- melange: define `MELANGE` conditional compilation variable
  ([melange-re/melange#472](melange-re/melange#472))
- melange: Make `Pervasives` exactly match the `Stdlib` behavior
  ([melange-re/melange#476](melange-re/melange#476))
- melange: fix unbound error when trying to use `Printexc.exn_slot_id`
  ([melange-re/melange#482](melange-re/melange#482))
- melange: fix codegen issue accessing a nested module path that is also
  `include`d ([melange-re/melange#487](melange-re/melange#487))
- melange: preserve the correct command-line order for load path directories
  ([melange-re/melange#492](melange-re/melange#492))
- melange: respect the `-nostdlib` option; don't add stdlib / runtime to the
  load path in that case
  ([melange-re/melange#496](melange-re/melange#496))
- melange: build the Melange runtime / stdlib / runtime tests with the dune
  integration ([melange-re/melange#493](melange-re/melange#493)). Thus
  melange now requires Dune 3.8.
- melange: allow shadowing sub-modules of Stdlib in user projects
  ([melange-re/melange#512](melange-re/melange#512))
- melange, reactjs-jsx-ppx: introduce a `reactjs-jsx-ppx` package, remove its
  dependency from melange
  ([melange-re/melange#517](melange-re/melange#517))
- melange: remove the `--bs-jsx <version>` flag from `melc` now that
  `reactjs-jsx-ppx` is a separate package
  ([melange-re/melange#525](melange-re/melange#525))
- melange: add `melpp` executable to preprocess `#if` conditionals with the
  melange parser ([melange-re/melange#539](melange-re/melange#539))
- mel: delete the `mel` package. The dune integration is now the only
  officially supported workflow for orchestrating melange builds
  ([melange-re/melange#546](melange-re/melange#546))
- melange: Extract `melange.ppx` from the melange package. This preprocessing
  step interprets extensions such as `%bs.obj`, `%bs.raw`, `%bs.re`, etc.
  ([melange-re/melange#534](melange-re/melange#534))
- melange: allow installing melange in more OCaml versions and compiler
  switches. Melange now migrates binary AST to the version it understands
  ([melange-re/melange#548](melange-re/melange#548))
- melange: don't run anonymous args function from
  `[@@@bs.config {flags = [| ... |]}]` attributes
  ([melange-re/melange#554](melange-re/melange#554))
- melange: add `--preamble` flag to add a preamble to emitted JS. An example is
  `"use client";` in React Server Components, which needs to appear before
  imports ([melange-re/melange#545](melange-re/melange#545),
  [melange-re/melange#574](melange-re/melange#574))
- melange: turn off warning 20 (`ignore-extra-argument`) by default. This
  warning is rarely useful in Melange due to false positives when invoking
  functions defined with `%bs.raw`
  ([melange-re/melange#488](melange-re/melange#488),
  [melange-re/melange#576](melange-re/melange#576))
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.

2 participants