Replies: 2 comments 2 replies
-
I find I need polyfills to support IE9 in production for NHS applications in the UK. It may soon be possible to increase the minimum requirement to IE11. I don't yet know what will be needed there. |
Beta Was this translation helpful? Give feedback.
-
@thheller Thanks for starting this discussion. So you're saying if we bump the :output-feature-set to :es8 (we're already using :es6) in dev only we should be good? Is that still true if we cache .shadow-cljs in ci for the release build? Btw if you're looking to reproduce the issue, it should be pretty easy in our repo and I have the feeling the errors started showing up after we brought in https://github.com/d3/d3-require. On your question of needing polyfills for dev, it wouldn't be a big issue for us if they went away or if it was a more manual step like testing out an advanced build. |
Beta Was this translation helpful? Give feedback.
-
$jscomp
related Polyfills have been a problematic area in shadow-cljs for a while now. The problems are somewhat evasive and hard to reproduce properly. I would like to fix this at some point but I'm not actually sure how.The problem is somewhat in the Closure Compiler or rather how shadow-cljs uses it. CLJS itself mostly doesn't need polyfills and is not much affected by this but
node_modules
code often needs and uses them. I'm trying to avoid the situation where polyfills are injected bybabel
(only used on some JS code) and then maybe again by Closure.shadow-cljs will often run the compiler incrementally on
node_modules
code (eg. when you add a new(:require ["some-package"])
it won't recompile the ones it already has). It tries to collect polyfill information and maintain a set of used polyfills which it then generates at a later separate stage in the build. This seems to work most of the time but somehow doesn't sometimes. I don't know if its just lacking information from the Closure Compiler or shadow-cljs not collecting/maintaining it properly. Closure itself doesn't have this issue since it doesn't compile incrementally and is meant to receive all code at once when doing the polyfilling. In shadow-cljs however thenode_modules
code is part of a different compilation than the CLJS:advanced
parts. Things seem to be OK when only thenode_modules
code uses polyfills but sometimes things appear to go wrong when using polyfill-related code in CLJS or classpath-js.I do however feel that Polyfills are somewhat overused currently because of the default
:output-feature-set :es5
. Most problems would go away if this was bumped to:es6
which is very widely supported at this time. Pretty much all problems would go away when bumping this so:es8
.Things would be much easier when only doing polyfills for
release
builds. Or maybe I change my strategy to do polyfilling as a separate build step and not incrementally. Maybe that works better.I wonder how many of you actually need/want polyfills while developing? How many people still have to tolerate IE as a runtime target? Without IE support
:es8
would be mostly fine given that all other browsers have supported these features for years now.Beta Was this translation helpful? Give feedback.
All reactions