redux-connect icon indicating copy to clipboard operation
redux-connect copied to clipboard

Force the consumer to provide a polyfilled environment.

Open ruiaraujo opened this issue 8 years ago • 10 comments

This allows people that are using polyfill.io to not ship additional unneeded polyfills such as Promises polyfills.

If you're interested in merging this, I can add a mention of this to the README.

ruiaraujo avatar May 21 '16 13:05 ruiaraujo

This is an interesting change, but its not possible for many users to rely on external polyfilling, for instance, when SSR is primary use-case. What I would do is possibly release this under a specific tag or version, which, in turn, would allow users to choose what they want to use. Please add extra information in readme for both server and client sides, and I will work on a release script for creating multiple bundles

AVVS avatar May 21 '16 15:05 AVVS

Ok, until Monday I will do this.

ruiaraujo avatar May 21 '16 21:05 ruiaraujo

@ruiaraujo any progress on that?

AVVS avatar Jun 01 '16 06:06 AVVS

Nope, I will try to find the time today.

ruiaraujo avatar Jun 01 '16 07:06 ruiaraujo

@AVVS I was reading your comment to amend the README files, and I don't understand why many user can't rely on external polyfilling for the SSR user case. Node supports promise since 0.12.

ruiaraujo avatar Jun 03 '16 09:06 ruiaraujo

@ruiaraujo - idea is to have identical code for node & server-side. Furthermore, many companies do not allow link to external sources, since its a security risk. By forcing people to do one thing - we essentially shut off the others. Therefore, it has to be optional and it has to provide a clear readme on how to use it

AVVS avatar Jun 03 '16 09:06 AVVS

But if the users are using something babel polyfill, it stills provides a polyfilled environment. You don't need to load external resources. I moved the polyfill to that outside service because I already required it for the Intl polyfill. But I could also (and I did) just use it in my internal sources.

The only difference would be if redux-connect provided an UMD build which it doesn't. So for the server section there is no need to mention anything unless you plan to support node 0.10 and I will a add a section to the client side on how to polyfill Promises.

ruiaraujo avatar Jun 03 '16 09:06 ruiaraujo

But if the users are using something babel polyfill, it stills provides a polyfilled environment. You don't need to load external resources. I moved the polyfill to that outside service because I already required it for the Intl polyfill. But I could also (and I did) just use it in my internal sources.

Thats not true, because it can provide different environments by using different transforms on client and server, while the code is exactly the same. Thats why I want you to have this being mentioned on the server-side as well

AVVS avatar Jun 03 '16 09:06 AVVS

so, this is still pretty interesting, any effort to document it?

AVVS avatar Jun 23 '16 17:06 AVVS

I must admit that I am not sure what we need to document for the server part. Once I will do understand it, I will do it for both.

ruiaraujo avatar Jun 23 '16 17:06 ruiaraujo