Adrià Fontcuberta
1 min readJul 30, 2018

--

Hi Cristi, and thanks for the great feedback!

Definetely I should add a warning in my post that Webpack is going to create a chunk for every component. Usually I have my “willing-to-split” components in a different folder so I don’t create unnecessary chunks. Thanks!

However, Webpack may be creating a lot of chunks, but your app will only consume the necessary ones, so you might end up with a “messy” compiled application, but not a less performant one.

Regarding the async code in the component declaration, the main difference here is that you are assuming the name of the component you want to import. Using the pattern of the post you would be able to import components while using a prop. Your approach is quite similar to main second approach, but improved by using code splitting. Which is cool indeed!

--

--

Adrià Fontcuberta

Words matter – Software product development, Front-end, UX, design, lean, agile and everything in between. https://afontcu.dev