Polyfill 与 Shim

Polyfill 与 Shim

polyfillThe concept is Remy Sharp in 2010 proposed a.

polyfillOr 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).

shimIt can be seen as polyfilla 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 polyfillfor the browser , but shimfor any environment .

use

Before any other code immediate importneeds 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.

Guess you like

Origin www.cnblogs.com/zmj97/p/10943645.html