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

Babel macro support #19

Merged
merged 9 commits into from Apr 16, 2019

Conversation

Projects
None yet
2 participants
@morsdyce
Copy link
Collaborator

morsdyce commented Apr 10, 2019

merge only after #18

Please note that the import should be reusable/macro it is a rule of babel-macro-plugin.
In addition you can only import the reuse methods from the macro. You will get an error otherwise

@morsdyce morsdyce requested a review from adamkleingit Apr 10, 2019

@@ -0,0 +1,127 @@
const pluginTester = require("babel-plugin-tester");

This comment has been minimized.

Copy link
@adamkleingit

adamkleingit Apr 11, 2019

Collaborator

Why are the plugins unit tests here and not in the babel-plugin-tester repo?

const reuseStateCode = `
import { reuseState } from "../src/reuseable.macro";
const counter = () => {

This comment has been minimized.

Copy link
@adamkleingit

adamkleingit Apr 11, 2019

Collaborator

Do you also support a case like this?

const counter = () => reuseState(0)
import { reuseMemo } from "../src/reuseable.macro";
const counter = () => {
reuseMemo(() => {

This comment has been minimized.

Copy link
@adamkleingit

adamkleingit Apr 11, 2019

Collaborator

Do you also support:

const counter = () => {
  const count = reuseMemo(() => ...)
}
@morsdyce

This comment has been minimized.

Copy link
Collaborator Author

morsdyce commented Apr 14, 2019

Updated PR with suggested examples and changed behaviour to:
Unless a variable name is found, use a fallback based on parent unit and index as debugName

@adamkleingit adamkleingit merged commit e3eb1f4 into master Apr 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.