Polyfill 与 Shim
polyfill
The concept is Remy Sharp in 2010 proposed a.
polyfill
Or polyfiller
, expressed to provide developers with an old browser without native support for newer features of a code or a plug-in (using the old browser's native functions to achieve relatively new feature).
shim
It can be seen as polyfill
a superset, it would represent a new API introduced into an old environment , the environment and relying on old existing means to achieve.
The difference is that polyfill
for the browser , but shim
for any environment .
use
Before any other code immediate import
needs polyfill/shim
.
Both of which are typically used to repair damage to achieve that in the most modern, the latest version of the browser, it may need to use these polyfill/shim
, it is necessary indiscriminately, all loaded synchronously polyfill/shim
,
Of course, this can also cause problems related to: the additional volume (size) costs.