What does 'polyfill' mean?

2017-12-07 10:15:35 +08:00
 shanechiu

I ofen see polyfill words in documents. I wonder know what it points?

I quote wikipedia:

In web development, a polyfill is code that implements a feature on web browsers that do not support the feature. Most often, it refers to a JavaScript library that implements an HTML5 web standard, either an established standard (supported by some browsers) on older browsers, or a proposed standard (not supported by any browsers) on existing browsers. Formally, "a polyfill is a shim for a browser API".

As a result, polyfill is a tools supporting a no-built in feature.

It is not just belong to web browsers,more than web development.

1921 次点击
所在节点    前端开发
8 条回复
hjdtl
2017-12-07 10:34:38 +08:00
百度了一下,感觉这个答案还不错: https://segmentfault.com/a/1190000002593432
SourceMan
2017-12-07 10:36:58 +08:00
kamal
2017-12-07 11:04:02 +08:00
serco
2017-12-07 11:13:06 +08:00
英文不忍直视啊。。。
robinlovemaggie
2017-12-07 11:26:39 +08:00
简单点说兼容新老浏览器的库就是 polyfill,否则不是。例如,jQuery 不是,Polymer, FlashCavas 是。
Mutoo
2017-12-07 11:53:44 +08:00
If you want to use an edge or modern feature on a widespread old browser (e.g. es2015 Promises), you can use the polyfill (e.g. Promises-polyfill), if the new feature is not internal provided but can be implemented within the current javascript's scope.
shanechiu
2017-12-08 17:13:46 +08:00
@Mutoo well,thanks a lot.
shanechiu
2017-12-08 17:17:03 +08:00
@hjdtl I read the article throughly, it is fully. Thank you for your recommendation.

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/412683

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX