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 experimental babel-plugin-macros support #3675

Merged
merged 2 commits into from Jan 9, 2018

Conversation

kentcdodds
Copy link
Contributor

@kentcdodds kentcdodds commented Jan 2, 2018

closes #2730

This will remain undocumented until the brave have tried it in the wild.

Test Plan:

There's currently no established way to test changes to
babel-preset-react-app. But I did create unmaintained-react-scripts-babel-macros a while back and it worked well.

closes facebook#2730

This will remain undocumented until the brave have tried it in the wild.

**Test Plan:**

There's currently no established way to test changes to
`babel-preset-react-app`. But I did create
[`unmaintained-react-scripts-babel-macros`](https://www.npmjs.com/package/unmaintained-react-scripts-babel-macros)
[a while back](facebook#2730 (comment))
and it worked well.
@kentcdodds
Copy link
Contributor Author

kentcdodds commented Jan 2, 2018

Copied from the linked issue:

Ok, so, check this out:

unmaintained-react-scripts-babel-macros diff:

screen shot 2017-09-08 at 10 36 23 am

(this would be implemented as part of babel-preset-react-app if it becomes official)

App.js

screen shot 2017-09-08 at 10 36 58 am

npm test

screen shot 2017-09-08 at 10 38 36 am

npm start

screen shot 2017-09-08 at 10 34 54 am

So that's pretty rock solid awesome... 😄

Note: that was before the babel-macros -> babel-plugin-macros name change which I did to improve the compatibility with babel 7. There have been no breaking changes other than the name change since I created unmaintained-react-scripts-babel-macros 👍

@Timer Timer added this to the 2.0.0 milestone Jan 3, 2018
@omeid
Copy link

omeid commented Jan 3, 2018

I understand that it is a massive change but any chance this could land "unsupported" without having to wait for 2.0? Landing it would allow a lot of people to test this actually out in the wild and promote adding macros support to various babel plugins.

@gaearon gaearon changed the base branch from master to next January 9, 2018 16:53
@gaearon gaearon merged commit bfffb26 into facebook:next Jan 9, 2018
@gaearon
Copy link
Contributor

gaearon commented Jan 9, 2018

Merged into next.

@kentcdodds kentcdodds deleted the pr/add-babel-plugin-macros branch January 9, 2018 17:29
gaearon pushed a commit that referenced this pull request Jan 9, 2018
* add experimental babel-plugin-macros support

closes #2730

This will remain undocumented until the brave have tried it in the wild.

**Test Plan:**

There's currently no established way to test changes to
`babel-preset-react-app`. But I did create
[`unmaintained-react-scripts-babel-macros`](https://www.npmjs.com/package/unmaintained-react-scripts-babel-macros)
[a while back](#2730 (comment))
and it worked well.

* Pin the version
@Timer Timer added this to Ready in 2.0 Jan 10, 2018
gaearon pushed a commit that referenced this pull request Jan 10, 2018
* add experimental babel-plugin-macros support

closes #2730

This will remain undocumented until the brave have tried it in the wild.

**Test Plan:**

There's currently no established way to test changes to
`babel-preset-react-app`. But I did create
[`unmaintained-react-scripts-babel-macros`](https://www.npmjs.com/package/unmaintained-react-scripts-babel-macros)
[a while back](#2730 (comment))
and it worked well.

* Pin the version
Timer pushed a commit to Timer/create-react-app that referenced this pull request Jan 11, 2018
* add experimental babel-plugin-macros support

closes facebook#2730

This will remain undocumented until the brave have tried it in the wild.

**Test Plan:**

There's currently no established way to test changes to
`babel-preset-react-app`. But I did create
[`unmaintained-react-scripts-babel-macros`](https://www.npmjs.com/package/unmaintained-react-scripts-babel-macros)
[a while back](facebook#2730 (comment))
and it worked well.

* Pin the version
Timer pushed a commit that referenced this pull request Jan 11, 2018
* add experimental babel-plugin-macros support

closes #2730

This will remain undocumented until the brave have tried it in the wild.

**Test Plan:**

There's currently no established way to test changes to
`babel-preset-react-app`. But I did create
[`unmaintained-react-scripts-babel-macros`](https://www.npmjs.com/package/unmaintained-react-scripts-babel-macros)
[a while back](#2730 (comment))
and it worked well.

* Pin the version
Timer pushed a commit to Timer/create-react-app that referenced this pull request Jan 11, 2018
* add experimental babel-plugin-macros support

closes facebook#2730

This will remain undocumented until the brave have tried it in the wild.

**Test Plan:**

There's currently no established way to test changes to
`babel-preset-react-app`. But I did create
[`unmaintained-react-scripts-babel-macros`](https://www.npmjs.com/package/unmaintained-react-scripts-babel-macros)
[a while back](facebook#2730 (comment))
and it worked well.

* Pin the version
Timer pushed a commit to Timer/create-react-app that referenced this pull request Jan 13, 2018
* add experimental babel-plugin-macros support

closes facebook#2730

This will remain undocumented until the brave have tried it in the wild.

**Test Plan:**

There's currently no established way to test changes to
`babel-preset-react-app`. But I did create
[`unmaintained-react-scripts-babel-macros`](https://www.npmjs.com/package/unmaintained-react-scripts-babel-macros)
[a while back](facebook#2730 (comment))
and it worked well.

* Pin the version
gaearon pushed a commit that referenced this pull request Jan 13, 2018
* add experimental babel-plugin-macros support

closes #2730

This will remain undocumented until the brave have tried it in the wild.

**Test Plan:**

There's currently no established way to test changes to
`babel-preset-react-app`. But I did create
[`unmaintained-react-scripts-babel-macros`](https://www.npmjs.com/package/unmaintained-react-scripts-babel-macros)
[a while back](#2730 (comment))
and it worked well.

* Pin the version
Timer pushed a commit that referenced this pull request Jan 14, 2018
* add experimental babel-plugin-macros support

closes #2730

This will remain undocumented until the brave have tried it in the wild.

**Test Plan:**

There's currently no established way to test changes to
`babel-preset-react-app`. But I did create
[`unmaintained-react-scripts-babel-macros`](https://www.npmjs.com/package/unmaintained-react-scripts-babel-macros)
[a while back](#2730 (comment))
and it worked well.

* Pin the version
gaearon pushed a commit that referenced this pull request Jan 14, 2018
* add experimental babel-plugin-macros support

closes #2730

This will remain undocumented until the brave have tried it in the wild.

**Test Plan:**

There's currently no established way to test changes to
`babel-preset-react-app`. But I did create
[`unmaintained-react-scripts-babel-macros`](https://www.npmjs.com/package/unmaintained-react-scripts-babel-macros)
[a while back](#2730 (comment))
and it worked well.

* Pin the version
gaearon pushed a commit that referenced this pull request Jan 14, 2018
* add experimental babel-plugin-macros support

closes #2730

This will remain undocumented until the brave have tried it in the wild.

**Test Plan:**

There's currently no established way to test changes to
`babel-preset-react-app`. But I did create
[`unmaintained-react-scripts-babel-macros`](https://www.npmjs.com/package/unmaintained-react-scripts-babel-macros)
[a while back](#2730 (comment))
and it worked well.

* Pin the version
gaearon pushed a commit that referenced this pull request Jan 14, 2018
* add experimental babel-plugin-macros support

closes #2730

This will remain undocumented until the brave have tried it in the wild.

**Test Plan:**

There's currently no established way to test changes to
`babel-preset-react-app`. But I did create
[`unmaintained-react-scripts-babel-macros`](https://www.npmjs.com/package/unmaintained-react-scripts-babel-macros)
[a while back](#2730 (comment))
and it worked well.

* Pin the version
gaearon pushed a commit that referenced this pull request Jan 14, 2018
* add experimental babel-plugin-macros support

closes #2730

This will remain undocumented until the brave have tried it in the wild.

**Test Plan:**

There's currently no established way to test changes to
`babel-preset-react-app`. But I did create
[`unmaintained-react-scripts-babel-macros`](https://www.npmjs.com/package/unmaintained-react-scripts-babel-macros)
[a while back](#2730 (comment))
and it worked well.

* Pin the version
Timer pushed a commit to Timer/create-react-app that referenced this pull request Jan 15, 2018
* add experimental babel-plugin-macros support

closes facebook#2730

This will remain undocumented until the brave have tried it in the wild.

**Test Plan:**

There's currently no established way to test changes to
`babel-preset-react-app`. But I did create
[`unmaintained-react-scripts-babel-macros`](https://www.npmjs.com/package/unmaintained-react-scripts-babel-macros)
[a while back](facebook#2730 (comment))
and it worked well.

* Pin the version
@Timer
Copy link
Contributor

Timer commented Jan 18, 2018

Support for this has been released in the first v2 alpha version. See #3815 for more details!

@gaearon gaearon mentioned this pull request Jan 18, 2018
@vinhlh vinhlh mentioned this pull request Feb 13, 2018
akstuhl pushed a commit to akstuhl/create-react-app that referenced this pull request Mar 15, 2018
* add experimental babel-plugin-macros support

closes facebook#2730

This will remain undocumented until the brave have tried it in the wild.

**Test Plan:**

There's currently no established way to test changes to
`babel-preset-react-app`. But I did create
[`unmaintained-react-scripts-babel-macros`](https://www.npmjs.com/package/unmaintained-react-scripts-babel-macros)
[a while back](facebook#2730 (comment))
and it worked well.

* Pin the version
@gaearon
Copy link
Contributor

gaearon commented Oct 2, 2018

It shipped in 2.0.
https://reactjs.org/blog/2018/10/01/create-react-app-v2.html

@kentcdodds
Copy link
Contributor Author

This is just awesome! 🎉

@such
Copy link

such commented Oct 2, 2018

Do you have to eject to make it work?
I've just tried it and I get Error: Cannot find module 'babel-macros'
I tried adding babel-macros and babel-plugin-macros as dependency with no luck...

@kentcdodds
Copy link
Contributor Author

You're probably trying to use an outdated macro. What are you trying to use?

@such
Copy link

such commented Oct 2, 2018

I'm trying to use https://github.com/leoasis/graphql-tag.macro

@kentcdodds
Copy link
Contributor Author

Yeah, that needs to be updated to babel-plugin-macros: https://github.com/leoasis/graphql-tag.macro/blob/47919df7548bd698076cb74fa777874a49bc9bbe/package.json#L20

Luckily the upgrade is pretty simple. Pretty much find/replace babel-macros for babel-plugin-macros.

@such
Copy link

such commented Oct 3, 2018

ok thanks!

@lock lock bot locked and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
2.0
  
Ready
Development

Successfully merging this pull request may close these issues.

None yet

6 participants