- If you’re using Create React App, Next.js, Gatsby, or a similar tool you will have a Webpack setup out of the box to bundle your app.
- You need to keep an eye on the code you are including in your bundle so that you don’t accidentally make it so large that your app takes a long time to load.
- When Webpack comes across this syntax, it automatically start code-splitting your app.
- You want to make sure you choose places that will split bundles evenly, but not be terribly interuptive to the users of your app.
- Here’s an example of how to setup route-based code splitting into your app using libraries like React Router and React Loadable.
Most React apps will have their files “bundled” using tools like
Webpack or Browserify.
Bundling is the process of following imported files and merging them into a
single file: a “bundle”. This bundle can then be included on a webpage to load
an entire app at once.
Continue reading “Just landed my PR addings docs about code splitting to the @reactjs docs”
- React Native PitfallsThere are a lot of collections of anti-patterns for React and different app’s state managers like Redux and MobX (e.g. react-bits), but I haven’t seen a lot of advises for React Native developers.
- Your apps are native and that’s awesome, but Android and iOS are different platforms, with different guidelines and components.
- So develop and test both versions in parallel.Test on a device from the day oneEmulators are nice, but use devices, especially on Android because of variety of screen sizes, OS versions is use, etc.It won’t be iOS/Android only storySometimes people pick React Native for developing an app only for one platform (yep, seriously).
There are a lot of collections of anti-patterns for React and different app’s state managers like Redux and MobX (e.g. react-bits), but I haven’t seen a lot of advises for React Native developers. In…
Continue reading “React Native Pitfalls – Anton Kulyk – Medium”
- Then there would be a function (computed) that you would need to subscribe to the correct event emitters to fire them whenever a value changes.
- After that, create a nice api around all that, so that the event emitters are hidden inside property getters / setters.
- Then you just have the raw inefficient basics covered; you would need to make sure after that that no events are fired if the values don’t actually change even if they are recomputed, and that if a computed value depends on another computed value, the event emitters, which are completely unaware of each other, are triggered in the right order 🙂
- The rough equivalent of MobX without MobX would be to have an event emitter for each object property, array entry etc. that lives in your state.
- Never miss an answer from Michel Weststrate , when you sign up for Hashnode.
I have begun to learn the flux architecture, reading about which, I have found Mobx, whose idea is good.
But before starting with the lib
- Let’s add one more test on handling submit.
- Our test code encourages to do everything through Page object.
- Page object wrapper gives you nice API to interact with your component, so test code will be more expressive and neat.
- I also work a lot on developer infrastructure, especially in terms of testing.
- We don’t test the whole web page, only one component, but we can think that our component is actually a little page, that we are going to interact with.
Today I will tell you a little trick how to make your test code a bit fancier and easier to maintain. The PageObject pattern is quite…
Continue reading “Page object for testing React.js components – Medium”