-
Notifications
You must be signed in to change notification settings - Fork 60
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
react-test-renderer is included in production bundle #32
Comments
My apologies! I didn't do enough searching and just saw that you can do this manually with |
@good-idea Could you elaborate on your setup? Did you manage to produce a production bundle without |
I dove into this a little bit more. Looking through the source code here, I would guess the idea is that Note that I am not importing We're running a setup with Typescript, Babel, and Webpack. I can see in my bundle stats that the So my question: what is the recommended way to use Personally, I always appreciate it if there is a way to manually selectively import parts of a library, like so:
|
Thank you very much @good-idea @edorivai to discuss about this. I was thinking about separating the packages, like: import { Action, State, withStateMachine } from 'react-automata' and: import { testStateMachine } from 'react-automata-test-utilities' What do you think? Also, if someone has experience creating a monorepo with Learn and Yarn Workspaces is more than welcome to submit a PR : ) Than you very much! |
That solution sounds good to me. Any particular reason you won't just expose it like this: import { testUtility } from 'react-automata/testUtility'; |
@edorivai I'm digging through my projects but can't find the config file where I implemented this, sorry! I'll try to set it up with a repo sometime this week |
@edorivai separate packages would allow us to define different dependencies. Thank you very much, @good-idea, that would be awesome. |
Hey all, sorry, I gave this a shot and wasn't able to get it working - it requires that the bundled NPM package has a structure like I'm not sure where or how I had this working. (Maybe I actually didn't?) This was also back in february, when React-automata was at an earlier version. |
@good-idea I see, thanks for checking. That was possible (not recommended) before we moved to flat bundles in #38. |
+1 to have separate projects for testing helpers. Having Can I help making this happen? I could try updating this repo to be a monorepo for both libraries. |
Yes, please @san650. |
I'll start working on it! |
Hey @san650 .. any updates on this ? |
Howdy all 👋 I've made great progress on the Lerna Monorepo migration. Check it out at #83 |
According to my webpack stats, it's adding about 55k to a production build. Is there a way to allow this to be eliminated by tree-shaking if
testStatechart
is not in use?The text was updated successfully, but these errors were encountered: