MichalZalecki / react-portal-universal

Generic wrapper for React's createPortal allowing for rendering portals on the server
ISC License
67 stars 13 forks source link

Use ES5 target for build #8

Closed sanniassin closed 6 years ago

sanniassin commented 6 years ago

Makes react-portal-universal compatible with IE10, Safari 9 and other React-compatible browsers that don't support const.

sanniassin commented 6 years ago

@MichalZalecki If this PR is fine, could you please release an updated version?

eatsjobs commented 6 years ago

@MichalZalecki I need that too. Thanks for your work

MichalZalecki commented 6 years ago

@sanniassin @eatsjobs I understand your issue but don't you think that targeting ES5 assuming ES2015 lib is counterintuitive? const problem can be mitigated with allowing the library to be compiled by Babel.

sanniassin commented 6 years ago

@MichalZalecki If you're talking about lib property in tsconfig.json, it's required for tests, not for the library itself, as it doesn't use any ES2015 API. I can try to make different configs for build and tests if it's necessary.

I assume that, whenever possible, libraries and components for React shouldn't have stricter requirements for browsers or module bundlers than the oldest version of React from peerDependencies.

sanniassin commented 6 years ago

@MichalZalecki Is there anything to be fixed to merge this PR?

MichalZalecki commented 6 years ago

I believe that in 2018 it's ok to move responsibility of supporting browsers without basic ES6 features to developers. I understand your point that but it's not woth the cost in my opinion. I prefer developer who need ES5 as compilation target to add a one line to their webpack config and not make other users that do not need it to download bigger library just for the convenience of 1%. Sorry for the trouble though.