You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the best to avoid including harmony-reflect by default. It's quite big and it would be nice if the library would not be loaded if the client already supports the required level of Proxy functionality?
The text was updated successfully, but these errors were encountered:
I'm not sure what the best approach is to this kind of problem (not loading a polyfill if the platform already supports it). Right now the library is smart enough not to patch the Proxy object if it is already conforming, but obviously the code necessary to patch it must be shipped regardless.
I try to keep reflect.js as free from external module loading dependencies as possible, so that it works unchanged in both the browser and node. I'm not sure how to do conditional loading in a platform-independent way.
Given that you're worried about code size, I assume you're mostly interested in using reflect.js in the browser. In that case it's always possible to conditionally load reflect.js based on a test such as if (typeof Reflect === undefined || typeof Proxy === undefined || typeof Proxy !== "function") { /* dynamically load <script src="reflect.js"/> */ }. Would that be sufficient or were you looking for a different kind of solution?
What is the best to avoid including harmony-reflect by default. It's quite big and it would be nice if the library would not be loaded if the client already supports the required level of Proxy functionality?
The text was updated successfully, but these errors were encountered: