垫片和填料的区别是什么? [英] What is the difference between a shim and a polyfill?
问题描述
两者似乎都在网络开发领域中使用,请参见 HTML5跨浏览器Polyfills ,表示:
Both seem to be used in web development circles, see e.g. HTML5 Cross Browser Polyfills, which says:
所以在这里,我们正在收集所有的垫片,后备和填料...
So here we're collecting all the shims, fallbacks, and polyfills...
或者,有一个 es5-shim 项目.
在我当前的项目中,我们使用了许多这样的工具,我想将它们全部粘贴在同一目录中.那么,我应该怎么称呼这个目录-shims
或polyfills
?
In my current project we're using a number of these, and I want to stick them all in the same directory. So, what should I call this directory---shims
, or polyfills
?
推荐答案
-
填充是执行API调用拦截并提供抽象层的任何代码.它不一定限于Web应用程序或HTML5/CSS3.
A shim is any piece of code that performs interception of an API call and provides a layer of abstraction. It isn't necessarily restricted to a web application or HTML5/CSS3.
polyfill 是填充程序的类型,通常使用Javascript或Flash使用现代HTML5/CSS3功能对旧版浏览器进行改造.
A polyfill is a type of shim that retrofits legacy browsers with modern HTML5/CSS3 features usually using Javascript or Flash.
回答特定问题时,如果要保持目录的通用性,请呼叫目录
shims
.Answering your specific question, call your directory
shims
if you want to keep the directory generic.这篇关于垫片和填料的区别是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!