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

feat: react/jsx-runtime #714

Merged
merged 14 commits into from
Jun 13, 2023
Merged

feat: react/jsx-runtime #714

merged 14 commits into from
Jun 13, 2023

Conversation

anmonteiro
Copy link
Member

No description provided.

Copy link
Member

@davesnx davesnx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few comments as if was ready to review, most of them are questions but I would avoid the change of the API under React.string, React.int, React.float, etc.

The rest looks good

src/jsx.re Outdated
Comment on lines 1 to 10
type element;
type ref;

[@bs.val] external null: element = "null";

external float: float => element = "%identity";
external int: int => element = "%identity";
external string: string => element = "%identity";

external array: array(element) => element = "%identity";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might need to include Jsx in React module, otherwise those functions won't be available under React.*

src/jsx.re Outdated Show resolved Hide resolved
src/jsxDOM.re Outdated Show resolved Hide resolved
src/React.re Outdated Show resolved Hide resolved
src/ReactDOM.re Outdated Show resolved Hide resolved
@anmonteiro anmonteiro marked this pull request as ready for review June 11, 2023 23:53
@anmonteiro
Copy link
Member Author

Not really sure what these errors are about?

FAIL _build/default/test/test/test/React__test.bs.js
  ● Test suite failed to run

    describe does not expect any arguments

       6 |
       7 | function describe(name, f) {
    >  8 |   Caml_external_polyfill.resolve("describe")(name, (function (param) {
         |                                             ^
       9 |           Curry._1(f, undefined);
      10 |         }));
      11 | }

      at Env.describe (node_modules/jest-jasmine2/build/jasmine/Env.js:402:19)
      at Object.describe (_build/default/test/test/test/jest/Jest.bs.js:8:45)
      at Object.<anonymous> (_build/default/test/test/test/React__test.bs.js:207:6)

FAIL _build/default/test/test/test/ReactRouter__test.bs.js
  ● Test suite failed to run

    describe does not expect any arguments

       6 |
       7 | function describe(name, f) {
    >  8 |   Caml_external_polyfill.resolve("describe")(name, (function (param) {
         |                                             ^
       9 |           Curry._1(f, undefined);
      10 |         }));
      11 | }

      at Env.describe (node_modules/jest-jasmine2/build/jasmine/Env.js:402:19)
      at Object.describe (_build/default/test/test/test/jest/Jest.bs.js:8:45)
      at Object.<anonymous> (_build/default/test/test/test/ReactRouter__test.bs.js:9:6)

will investigate.

@davesnx
Copy link
Member

davesnx commented Jun 13, 2023

There seems to be some issue with bindings, when building

File "test/React__test.re", lines 563-567, characters 4-18:
563 | ....expect(
564 |       container
565 |       ->DOM.findBySelectorAndPartialTextContent("div", "10")
566 |       ->Option.isSome,
567 |     )->toBe(true);
Warning 106 [bucklescript-unimplemented-primitive]: Unimplemented primitive used:toBe

@anmonteiro
Copy link
Member Author

Ah, makes sense, was missing the ppx 0da7411

@anmonteiro
Copy link
Member Author

🚀 ❓

@davesnx davesnx merged commit f7a9aa8 into main Jun 13, 2023
davesnx added a commit that referenced this pull request Jun 13, 2023
…1-release

* 'main' of github.com:/reasonml/reason-react:
  feat: react/jsx-runtime (#714)
davesnx added a commit that referenced this pull request Jun 13, 2023
* 'main' of github.com:/reasonml/reason-react:
  feat: react/jsx-runtime (#714)
  chore: update flakes / add ocamlformat (#731)
  opam-ci: load cache before setup-ocaml (#727)
davesnx added a commit that referenced this pull request Jun 13, 2023
* 'main' of github.com:/reasonml/reason-react:
  feat: react/jsx-runtime (#714)
  chore: update flakes / add ocamlformat (#731)
  opam-ci: load cache before setup-ocaml (#727)
anmonteiro added a commit that referenced this pull request Jun 14, 2023
davesnx added a commit that referenced this pull request Jun 14, 2023
Co-authored-by: David Sancho Moreno <dsnxmoreno@gmail.com>
davesnx added a commit that referenced this pull request Jun 14, 2023
* 'main' of github.com:/reasonml/reason-react:
  Add changelog entries for #714 and #721 (#735)
davesnx added a commit to davesnx/opam-repository that referenced this pull request Sep 13, 2023
CHANGES:

* Migrate the reason-react PPX and library to the [new React JSX
transform](https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html)
  (@anmonteiro in [reasonml/reason-react#714](reasonml/reason-react#714))
* Add `suppressHydrationWarning` to supported props (@davesnx in
[reasonml/reason-react#721](reasonml/reason-react#721))
* Rename `reactjs-jsx-ppx` to `reason-react-ppx` ([@davesnx in reasonml/reason-react#732](reasonml/reason-react#732))
* Fix locations for lower and uppercase components so that merlin / editor
  integration can get type defs on hover ([@jchavarri in reasonml/reason-react#748](reasonml/reason-react#748))
* Refine types for `key` attributes ([@anmonteiro in reasonml/reason-react#750](reasonml/reason-react#750))
* Bump React depext to v17-18 reasonml/reason-react#777 ([@jchavarri in reasonml/reason-react#777](https://github.com/reasonml/reason-react/pull/777/files))
* Make optional props optional properly
 ([@davesnx in reasonml/reason-react#776](reasonml/reason-react@0a98c07))
davesnx added a commit to davesnx/opam-repository that referenced this pull request Sep 13, 2023
CHANGES:

* Migrate the reason-react PPX and library to the [new React JSX
transform](https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html)
  (@anmonteiro in [reasonml/reason-react#714](reasonml/reason-react#714))
* Add `suppressHydrationWarning` to supported props (@davesnx in
[reasonml/reason-react#721](reasonml/reason-react#721))
* Rename `reactjs-jsx-ppx` to `reason-react-ppx` ([@davesnx in reasonml/reason-react#732](reasonml/reason-react#732))
* Fix locations for lower and uppercase components so that merlin / editor
  integration can get type defs on hover ([@jchavarri in reasonml/reason-react#748](reasonml/reason-react#748))
* Refine types for `key` attributes ([@anmonteiro in reasonml/reason-react#750](reasonml/reason-react#750))
* Bump React depext to v17-18 reasonml/reason-react#777 ([@jchavarri in reasonml/reason-react#777](https://github.com/reasonml/reason-react/pull/777/files))
* Make optional props optional properly
 ([@davesnx in reasonml/reason-react#776](reasonml/reason-react@0a98c07))
davesnx added a commit to davesnx/opam-repository that referenced this pull request Sep 13, 2023
CHANGES:

* Migrate the reason-react PPX and library to the [new React JSX
transform](https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html)
  (@anmonteiro in [reasonml/reason-react#714](reasonml/reason-react#714))
* Add `suppressHydrationWarning` to supported props (@davesnx in
[reasonml/reason-react#721](reasonml/reason-react#721))
* Rename `reactjs-jsx-ppx` to `reason-react-ppx` ([@davesnx in reasonml/reason-react#732](reasonml/reason-react#732))
* Fix locations for lower and uppercase components so that merlin / editor
  integration can get type defs on hover ([@jchavarri in reasonml/reason-react#748](reasonml/reason-react#748))
* Refine types for `key` attributes ([@anmonteiro in reasonml/reason-react#750](reasonml/reason-react#750))
* Bump React depext to v17-18 reasonml/reason-react#777 ([@jchavarri in reasonml/reason-react#777](https://github.com/reasonml/reason-react/pull/777/files))
* Make optional props optional properly
 ([@davesnx in reasonml/reason-react#776](reasonml/reason-react@0a98c07))
nberth pushed a commit to nberth/opam-repository that referenced this pull request Jun 18, 2024
CHANGES:

* Migrate the reason-react PPX and library to the [new React JSX
transform](https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html)
  (@anmonteiro in [reasonml/reason-react#714](reasonml/reason-react#714))
* Add `suppressHydrationWarning` to supported props (@davesnx in
[reasonml/reason-react#721](reasonml/reason-react#721))
* Rename `reactjs-jsx-ppx` to `reason-react-ppx` ([@davesnx in reasonml/reason-react#732](reasonml/reason-react#732))
* Fix locations for lower and uppercase components so that merlin / editor
  integration can get type defs on hover ([@jchavarri in reasonml/reason-react#748](reasonml/reason-react#748))
* Refine types for `key` attributes ([@anmonteiro in reasonml/reason-react#750](reasonml/reason-react#750))
* Bump React depext to v17-18 reasonml/reason-react#777 ([@jchavarri in reasonml/reason-react#777](https://github.com/reasonml/reason-react/pull/777/files))
* Make optional props optional properly
 ([@davesnx in reasonml/reason-react#776](reasonml/reason-react@0a98c07))
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