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

modularity #5935

Closed
AlexGalays opened this issue Jan 29, 2016 · 2 comments
Closed

modularity #5935

AlexGalays opened this issue Jan 29, 2016 · 2 comments

Comments

@AlexGalays
Copy link

Is there any work going on to make React a bit more modular?
Before you laugh it off, I'm not suggesting React should be based on thousands of "micro-libs" :)

Some things I never used, or don't have a need for:

  • Server side rendering -> Only use React in non SEO critical projects; Also absolutely not convinced about so-called performance benefits as we don't use node to begin with.
  • Support for older browsers -> This is a fast moving target; More and more people drop support for IE < 10-11 completely nowadays, especially on rich "apps" where it would be a complete bother anyway. Do Synthetic events do more than just patch old browsers quirks?
  • propTypes; Runtime type checks impossible to remove in production... Nowadays we can use typescript or flow to have quicker compilation feedback without any size overhead.

Just some thoughts, this is not meant as a critic, just wondering about the design direction for React. I know, all this might only remove a few dozens of kbytes and in the grand scheme of things, it's not hugely important, but I like to think every little detail count.

@quantizor
Copy link
Contributor

@AlexGalays I made a tool to get rid of the propTypes if you're interested: https://www.npmjs.com/package/deproptypeify Just use it on your "release" build if Browserify is in your bundling flow.

I agree on the SSR bit, it would be nice if that could be separate from react-dom. Tree-shaking build tools like Rollup will exclude those internal modules though if you don't make use of them.

@jimfb
Copy link
Contributor

jimfb commented Jan 29, 2016

  • Yes, we're already migrating toward a configuration where React can be built with only the features needed by your chosen renderer. That was one of the main points of 0.14 - it was the upgrade path as we migrate to such a system.
  • No, synthetic events are required for a whole host of reasons, including performance (event listeners are registered at the top, instead of each element along the DOM tree).
  • Proptypes are not checked in the production build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants