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

Add ESM build to react-is #13272

Closed
pgarciacamou opened this issue Jul 26, 2018 · 8 comments
Closed

Add ESM build to react-is #13272

pgarciacamou opened this issue Jul 26, 2018 · 8 comments
Labels
Component: Build Infrastructure Resolution: Stale Automatically closed due to inactivity

Comments

@pgarciacamou
Copy link

pgarciacamou commented Jul 26, 2018

Do you want to request a feature or report a bug?

Feature

What is the current behavior?

Unable to import individual modules from the package.

import * as ReactIs from "react-is";
ReactIs.isValidElementType(<div />); // true

What is the expected behavior?

import { isValidElementType } from "react-is";
isValidElementType(<div />); // true

Context

This issue arose when trying to to make react-redux work with React.forwardRef (see this PR), but evidently, react-is doesn't allow import/export ESM to enable tree shaking capabilities in react-redux (that is my understanding).

This issue is following this comment.

I tried solving this (and totally failed) in #13250 before I realised anything about ESM. But this is now over my head, so I'm creating an issue now and see how that follows.

@gaearon
Copy link
Collaborator

gaearon commented Aug 2, 2018

You can't make it work by changing the source — you'll want to change the build scripts (scripts/rollup/*) to target an ESM build.

@TrySound
Copy link
Contributor

TrySound commented Aug 3, 2018

FYI I'm working on this.

@kentcdodds
Copy link
Contributor

Could we change this issue (or should I open a new issue) to apply this to all react packages? Rollup has trouble when dependencies use React like it has an ESM export but it actually doesn't :-(

Ref: reach/reach-ui#74

@stale
Copy link

stale bot commented Jan 10, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution.

@stale stale bot added the Resolution: Stale Automatically closed due to inactivity label Jan 10, 2020
@TrySound
Copy link
Contributor

Not stale.

@stale stale bot removed the Resolution: Stale Automatically closed due to inactivity label Jan 10, 2020
@stale
Copy link

stale bot commented Apr 9, 2020

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

@stale stale bot added the Resolution: Stale Automatically closed due to inactivity label Apr 9, 2020
@stale
Copy link

stale bot commented Apr 17, 2020

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!

@stale stale bot closed this as completed Apr 17, 2020
@jacksteamdev
Copy link

Not stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Build Infrastructure Resolution: Stale Automatically closed due to inactivity
Projects
None yet
Development

No branches or pull requests

5 participants