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

Use the deployment pattern to load ES5 and/or ES6 shims #13

Closed
unscriptable opened this issue Apr 23, 2014 · 1 comment
Closed

Use the deployment pattern to load ES5 and/or ES6 shims #13

unscriptable opened this issue Apr 23, 2014 · 1 comment

Comments

@unscriptable
Copy link
Contributor

At first it seems kinda strange, but it makes a lot of sense to use the deployment patterns to load shims. When using a boot.js-replacement deployment pattern, the initial script to load is boot.js. When using a <script>-replacement pattern, you would expect a previous <script> to inject shims.

Our default shim could be a browserified (or crammed) poly.js. (Via rave extension, people could decide to use the es5-shim or es6-shim projects, instead.)

One thought about using poly.js is that we could create two versions: an ES5 shim and an ES6 shim. The test to decide whether to load the ES5 shim is to test for an "early" ES6 feature such as Array.isArray or Object.observe. The reason this might work is because (afaik) all the browsers that support those features already support 100% of the ES5 features.

For the foreseeable future, we should always load the ES6 shim.

@unscriptable
Copy link
Contributor Author

My current thinking is that we should not make efforts to support non-ES5 browsers. Devs can add es5 polyfills in various ways. As regards ES6 polyfills, if we don't use ES6 features (besides Promises which come for free), then we don't have to worry about shimming.

If devs want to use es6 features in their app code, that's cool. They should install a set of polyfills.

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

1 participant