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

Complete React 16 support #1553

Open
ljharb opened this Issue Mar 2, 2018 · 33 comments

Comments

@ljharb
Copy link
Member

ljharb commented Mar 2, 2018

Overarching project: https://github.com/airbnb/enzyme/projects/4

@MarcoNicolodi

This comment has been minimized.

Copy link

MarcoNicolodi commented Mar 12, 2018

Isnt #1229 related to this?

@ljharb

This comment has been minimized.

Copy link
Member

ljharb commented Mar 13, 2018

@MarcoNicolodi I don't think it is; that issue might either be a bug in v3 or intended behavior, but it's not related to React 16 specifically.

@petegleeson

This comment has been minimized.

Copy link

petegleeson commented Apr 5, 2018

@ljharb I have verified that #1592 solves the forwardRef problem.

What is the release plan for these fixes? New versions for each feature or one release when all of these are completed?

Please let me know if there is anything I can do to help out.

jtanner added a commit to mxenabled/mx-react-components that referenced this issue Apr 9, 2018

jtanner added a commit to mxenabled/mx-react-components that referenced this issue Apr 11, 2018

@ljharb

This comment has been minimized.

Copy link
Member

ljharb commented Apr 12, 2018

I’m hoping to bunch together as many as possible; there’s currently a backlog for me to go through, after which i hope to cut a release.

@elboman elboman referenced this issue Apr 15, 2018

Merged

New React 16.3 context API #153

5 of 5 tasks complete
@baldwmic

This comment has been minimized.

Copy link
Contributor

baldwmic commented Apr 16, 2018

@ljharb is there a list of issues you'd like to get merged before releasing a new version on npm? Would love to see this one get released soon: #1513 as my team has already migrated our codebase so just waiting on tests passing.

Perhaps we could help finish up some issues for you to get the release in.

@Mensae Mensae referenced this issue Apr 26, 2018

Closed

Upgrade react #2160

ghmeier added a commit to mixmaxhq/connect-backbone-to-react that referenced this issue Apr 30, 2018

Prototype using the React 16.3 Context API
In [React
16.3](https://reactjs.org/blog/2018/03/29/react-v-16-3.html#official-context-api)
they announced a new, official Context API. Here we can use this api to
simplify the `BackboneProvider` and the `connectBackboneToReact`
function. We no longer need to use soon to be deprecated lifecycle
methods and can instead just set up listeners for backbone events and
map models to props as previously.

Fortunately, we can accomplish this without changes to the
`connect-backbone-to-react` API, but unfortunately, it requires updating
to `react@^16.3.0` (along with `prop-types` and `react-dom`). This also
means that tests have to be updated to use the latest version of
`enzyme` which doesn't [yet
support](airbnb/enzyme#1553) the new Context
API. Until then, we can leave this as a prototype.
@simonbuchan

This comment has been minimized.

Copy link

simonbuchan commented May 2, 2018

Nope, just #1504 - createRef() works fine when it's nested. What about createRef()? I'm hitting that not working in styled-components/styled-components#1720 - even with just pure react + enzyme. Here's the test copied over:

test('enzyme should mount object refs', () => {
  const ref = React.createRef()
  const wrapper = mount(<div ref={ref} />)
  const div = wrapper.find('div').first()
  expect(div).toBeTruthy()
  expect(ref).toHaveProperty('current', div.instance())
})

Is this just a dumb mistake I'm making?

ghmeier added a commit to mixmaxhq/connect-backbone-to-react that referenced this issue May 2, 2018

Prototype using the React 16.3 Context API
In [React
16.3](https://reactjs.org/blog/2018/03/29/react-v-16-3.html#official-context-api)
they announced a new, official Context API. Here we can use this api to
simplify the `BackboneProvider` and the `connectBackboneToReact`
function. We no longer need to use soon to be deprecated lifecycle
methods and can instead just set up listeners for backbone events and
map models to props as previously.

Fortunately, we can accomplish this without changes to the
`connect-backbone-to-react` API, but unfortunately, it requires updating
to `react@^16.3.0` (along with `prop-types` and `react-dom`). This also
means that tests have to be updated to use the latest version of
`enzyme` which doesn't [yet
support](airbnb/enzyme#1553) the new Context
API. Until then, we can leave this as a prototype.

ghmeier added a commit to mixmaxhq/connect-backbone-to-react that referenced this issue May 2, 2018

Prototype using the React 16.3 Context API
In [React
16.3](https://reactjs.org/blog/2018/03/29/react-v-16-3.html#official-context-api)
they announced a new, official Context API. Here we can use this api to
simplify the `BackboneProvider` and the `connectBackboneToReact`
function. We no longer need to use soon to be deprecated lifecycle
methods and can instead just set up listeners for backbone events and
map models to props as previously.

Fortunately, we can accomplish this without changes to the
`connect-backbone-to-react` API, but unfortunately, it requires updating
to `react@^16.3.0` (along with `prop-types` and `react-dom`). This also
means that tests have to be updated to use the latest version of
`enzyme` which doesn't [yet
support](airbnb/enzyme#1553) the new Context
API. Until then, we can leave this as a prototype.
@simonbuchan

This comment has been minimized.

Copy link

simonbuchan commented Aug 8, 2018

@ljharb I'm assuming since the issues linked in the description are still open that these still only support <16 features, but running against 16+, as a first step? Well, CHANGELOG mentions React.Fragment...

@ljharb

This comment has been minimized.

Copy link
Member

ljharb commented Aug 8, 2018

@simonbuchan React.Fragment is a v16.2 feature, and this is now supported. There's still a bunch of work to go, but the new releases cover the work done so far.

@the-spyke

This comment was marked as resolved.

Copy link

the-spyke commented Aug 8, 2018

forwardRef still doesn't work, by the way.

@ljharb

This comment was marked as resolved.

Copy link
Member

ljharb commented Aug 8, 2018

@the-spyke I’m pretty sure that my interaction on #1592, and the lack of a check on the box in the OP, should make that clear to everybody

@simonbuchan

This comment was marked as resolved.

Copy link

simonbuchan commented Aug 8, 2018

That's a little unfair, it was unclear enough from your earlier comment that I had to ask!

@ljharb

This comment was marked as resolved.

Copy link
Member

ljharb commented Aug 9, 2018

@simonbuchan fair enough :-) sorry if my reply was harsh.

@FezVrasta

This comment has been minimized.

Copy link
Contributor

FezVrasta commented Aug 9, 2018

The PR for the Context API support is merged, can we find it in this new release I guess? What's still missing to check its checkbox?

@maxkostow

This comment has been minimized.

Copy link

maxkostow commented Aug 9, 2018

Yes it is but there is a bug with github where clicking the check mark unchecks the others so you have to manually edit the markdown.

@ljharb

This comment has been minimized.

Copy link
Member

ljharb commented Aug 9, 2018

@maxkostow i'm not aware of any such bug; that checkbox has never been checked on this issue.

@FezVrasta i'll update the list of issues for context; check https://github.com/airbnb/enzyme/projects/4#card-11112928 for a larger list of issues.

@mprobber

This comment has been minimized.

Copy link

mprobber commented Nov 26, 2018

re: 16.6 contextType support - I just put out facebook/react#14329 - it's a PR for the shallow react-test-renderer so that when contextType is defined, you can just pass it a context.

@rodoabad

This comment has been minimized.

Copy link

rodoabad commented Nov 29, 2018

@ljharb I don't see any item for supporting React.lazy, I see one for Suspense but those two come hand-in-hand.

@llaryssa

This comment has been minimized.

Copy link

llaryssa commented Dec 6, 2018

Does this issue include shallow rendering support for components that use react hooks?

@rodoabad rodoabad referenced this issue Dec 7, 2018

Closed

How to test component with dynamic imports #1460

3 of 4 tasks complete

@felixjung felixjung referenced this issue Dec 20, 2018

Open

Upgrade dependencies #341

4 of 7 tasks complete

@ljharb ljharb referenced this issue Dec 24, 2018

Closed

Enzyme Internal Error: unknown node with tag 13 #1953

2 of 2 tasks complete

@ljharb ljharb referenced this issue Jan 1, 2019

Open

context options for mount are not being applied #1959

2 of 13 tasks complete

@ljharb ljharb referenced this issue Jan 24, 2019

Open

Testing Hooks with shallow: Invariant Violation #1938

2 of 13 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment