-
Notifications
You must be signed in to change notification settings - Fork 40
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
Possible to use with create-react-app? #142
Comments
Then it's time to add some macros :) Probably I should research both ways. |
Keeping in mind - while |
Not yet released |
Thank you for the issue :) |
Fantastic, thank you! Now I'm trying to figure out how to use it... I reran When I use |
Let me spin up CRA and test |
|
Confirmed, works when calling directly. If however, I use a wrapper function like:
I get warnings. eg: https://codesandbox.io/s/kind-easley-80ez6 |
So the problem is - import { marked } from "react-imported-component/macro";
cons marked = a => a;
const async = Load(marked(() => import("./async")));
const async = Load(() => marked(import("./async")));
const async = marked(Load(() => import("./async")));
marked(() => {
anycode
}); Another option - |
|
|
|
Look like half of macro logic is not working at all, however I haven't changed it, and tests, tests are green :( |
This version is working - https://codesandbox.io/s/kind-https-qpx0z
|
Ok. I've found the problem - babel plugins are fighting with each other - "plugin" adds all the imports before the macro, and "macro" is not adding them, as long as they are not required. |
|
When I add
|
So it's replaces |
I'm using it with react-snap
|
... could you should me transpiled sources - I could not understand why importerWrapper is used here. |
Tried again this morning and it was working. Will close this. Thanks for all your help. |
Thank's for your help, and making macros real! |
CRA only has `babel-plugin-macros support (with ejecting or rewiring). But I don't see any .macro export. Not sure if a macro would even work for RIC?
Without babel, I get lots of warnings about
no marks found
...The text was updated successfully, but these errors were encountered: