Skip to content

Conversation

@davesnx
Copy link
Member

@davesnx davesnx commented Nov 19, 2024

Depends on #846

@davesnx davesnx mentioned this pull request Nov 19, 2024
@davesnx davesnx marked this pull request as ready for review November 19, 2024 20:01
@davesnx davesnx requested a review from jchavarri November 20, 2024 10:55
Copy link
Collaborator

@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.

I'm afraid I don't know the reason why switching to another (heavier) testing library is needed.

Comment on lines +3 to +5
This directory contains a vendored version of the melange-testing-library.

The original repository is https://github.com/melange-community/melange-testing-library
Copy link
Collaborator

Choose a reason for hiding this comment

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

The PR description mentions

Vendors ReactTestingLibrary (and does some ad-hoc changes)

are the ad-hoc changes valuable for other users of the bindings? in that case, will they be upstreamed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure, melange-testing-library contains a few binding designs focused on previous versions of BuckleScript where options aren't translated to undefined, or records aren't objects.

I would keep the changes here and evolve this bindings as a playground for the melange-testing-library

Copy link
Member

Choose a reason for hiding this comment

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

works, but we should upstream as they get better!

install: ## Update the package dependencies when new deps are added to dune-project
@opam install . --deps-only --with-test
@npm install
@npm install --force
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why was force needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because testinglib and other deps depend on react 18, so npm complains. It is a decent workaround to ensure the installation succeeds

Copy link
Member Author

Choose a reason for hiding this comment

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

Will write a comment

Copy link
Member

Choose a reason for hiding this comment

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

would we still needed --force if you commit the lockfile from manual install and run npm ci here?

…esting-libraries

* '19' of github.com:/reasonml/reason-react:
  Add deprecations on ReactDOMTestUtils
  Add uri comment back on action
  Update src/React.re
  Update src/React.re
  Update src/React.re
  Snapshot with lower {}
@davesnx davesnx force-pushed the replace-testing-libraries branch from f7d55fe to 7aaef3e Compare November 25, 2024 15:04
…on-react into replace-testing-libraries

* 'replace-testing-libraries' of github.com:/reasonml/reason-react:
  Bind React.act and React.actAsync
@davesnx davesnx merged commit 66cd920 into 19 Nov 25, 2024
3 checks passed
@davesnx davesnx deleted the replace-testing-libraries branch November 25, 2024 17:36
davesnx added a commit that referenced this pull request Nov 25, 2024
…lid-prop

* '19' of github.com:/reasonml/reason-react:
  Replace react dom's testing library with ReactTestingLibrary (#859)
davesnx added a commit that referenced this pull request Nov 25, 2024
…lid-prop

* '19' of github.com:/reasonml/reason-react:
  Replace react dom's testing library with ReactTestingLibrary (#859)
davesnx added a commit that referenced this pull request Nov 25, 2024
…ises-as-annotations

* '19' of github.com:/reasonml/reason-react:
  Enable ref as valid prop (#862)
  Replace react dom's testing library with ReactTestingLibrary (#859)
  Add deprecations on ReactDOMTestUtils
  Add uri comment back on action
  Update src/React.re
  Update src/React.re
  Update src/React.re
  Snapshot with lower {}
@davesnx davesnx mentioned this pull request Nov 25, 2024
davesnx added a commit that referenced this pull request Nov 25, 2024
* '19' of github.com:/reasonml/reason-react:
  Enable ref as valid prop (#862)
  Replace react dom's testing library with ReactTestingLibrary (#859)
davesnx added a commit that referenced this pull request Apr 3, 2025
* Add useTransition with async support

* Add useTransitionAsync into the interface

* Add useOptimistic

* Rename use to usePromise and add useContext

* Move useTransitionAsync to Experimental

* Add formStatus to interface

* Leftover from removing useTransitionAsync to Experimental

* Add action_ and action_Async in ReactDOM props

* Fix reference to function on formStatus

* Embed FormData for now

* Add test of Form with useOptimistic

* Embed FormData into ReactDOM

* Move formStatus into ReactDOM

* Run formatter

* Bind React.useActionState instead of ReactDOM.useFormState

* Remove React.use being 'a => 'b

* Revert change on ReactDOM's prop 'action'

* useAction state published in React.rei

* Remove React.use being 'a => 'b

* Use act from 'react' inseat of react-dom/test-utils

* Snapshot with lower {}

* Update src/React.re

Co-authored-by: Javier Chávarri <[email protected]>

* Update src/React.re

Co-authored-by: Javier Chávarri <[email protected]>

* Update src/React.re

Co-authored-by: Javier Chávarri <[email protected]>

* Add uri comment back on action

* Add deprecations on ReactDOMTestUtils

* Replace react dom's testing library with ReactTestingLibrary (#859)

* Install melange-testing-library

* Install melange-testing-library npm deps

* Vendor melange-testing-library

* Fix Form__test with RTL

* Start migrating Hooks__test

* Remove dependency

* Remove unused code from Form__test

* Add a jest-devtoolsgs

* Add a jest-devtools

* Migrate Hooks and Form into RTL

* Add demo to manually test easily

* Use Uncurried for tests

* Migrate all React__test

* Force install since we are dealing with R19

* Snapshot with lower {}

* Remove jest from demo/dune

* Add comment on install --force

* Bind React.act and React.actAsync

* Bind React.act and React.actAsync

* Use React.act as async version only

* Test react.act and react.actasync

* Fix hola test :(

* Enable ref as valid prop (#862)

* Install melange-testing-library

* Install melange-testing-library npm deps

* Vendor melange-testing-library

* Fix Form__test with RTL

* Start migrating Hooks__test

* Remove dependency

* Remove unused code from Form__test

* Add a jest-devtoolsgs

* Add a jest-devtools

* Migrate Hooks and Form into RTL

* Add demo to manually test easily

* Use Uncurried for tests

* Migrate all React__test

* Force install since we are dealing with R19

* Snapshot with lower {}

* Enable ref in ppx

* Add jest test for ref

* Remove jest from demo/dune

* Add comment on install --force

* Improve test from checking ref

* Bind React.act and React.actAsync

* Bind React.act and React.actAsync

* Migrate custom childrens test to RTL

* Fix role for React__test

* Rollback change on _ppx

* Install latest react version with the useState fix

* Use [email protected]

---------

Co-authored-by: Javier Chávarri <[email protected]>
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.

4 participants