Skip to content
This repository has been archived by the owner on Jun 8, 2019. It is now read-only.

Add option to disable JSX extraction #20

Closed
wants to merge 1 commit into from
Closed

Add option to disable JSX extraction #20

wants to merge 1 commit into from

Conversation

baer
Copy link

@baer baer commented Nov 19, 2015

This PR adds the option to disable JSX extraction using babel-plugin config

@baer
Copy link
Author

baer commented Nov 19, 2015

@ericf - Sorry for the delay, I got caught up in a few other things. This is kinda what I had in mind but I thought I'd push it up to get your thoughts before I continue.

There is a dev UX problem where all visited react-intl components will throw a warning about not extracting defaults which could get super noisy. I could fix that by doing a little attribute checking but I'd have to do a bit of refactoring to cleanly do it for both the FormattedPlural case and the general case.

@ericf
Copy link
Collaborator

ericf commented Nov 21, 2015

@baer This week I worked on rewriting the plugin to work with Babel 6: PR #21

I think I've addressed the warn noise problem on that branch where it now checks for a defaultMessage prop before attempting the store the message. Are you planning to upgrade to Babel 6 soon? I was thinking of creating a 1.x branch which will be tied to Babel 5, while master and a 2.0 release will be tied to Babel 6.

@baer
Copy link
Author

baer commented Nov 21, 2015

The plan is to upgrade to Babel 6 but for now we are constrained by the transforms we need. The only ones that we know are incompatible are this one and gaearon/babel-plugin-react-transform#46 but there very well be others.

There is a big push from the babel folks to move to Babel6 so I would not put a lot of effort into a Babel5 version (maybe just tag it with 1.x as is) but I do think you should keep it around. I've read through ~90% of what you have and integrated it in 2 different ways and IMO it seems solid enough to just call this the 5.x release.

@baer
Copy link
Author

baer commented Nov 21, 2015

Once PR #21 goes in I will rebase this and work from the babel6 version.

@ericf
Copy link
Collaborator

ericf commented Nov 21, 2015

Okay sounds good. In the meantime let's think of a better option name than extractJSX which I think is confusing. Usually for things like this I think of the optional option being falsy/missing by default and truth when enabled. Maybe defineMessagesOnly?

@baer
Copy link
Author

baer commented Nov 21, 2015

I struggled to name that option - I'll try to think of something better for the second pass.

@ericf
Copy link
Collaborator

ericf commented Nov 22, 2015

@baer I've merged #21 to update this plugin for Babel 6. I've also created a 1.x branch for Babel 5.

@longlho
Copy link
Member

longlho commented May 22, 2019

stale

@longlho longlho closed this May 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants