V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
shanechiu
V2EX  ›  前端开发

What does 'polyfill' mean?

  •  
  •   shanechiu ·
    shanezhiu · 2017-12-07 10:15:35 +08:00 · 1940 次点击
    这是一个创建于 2575 天前的主题,其中的信息可能已经有所发展或是发生改变。

    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.

    8 条回复    2017-12-08 17:17:03 +08:00
    hjdtl
        1
    hjdtl  
       2017-12-07 10:34:38 +08:00
    百度了一下,感觉这个答案还不错: https://segmentfault.com/a/1190000002593432
    SourceMan
        2
    SourceMan  
       2017-12-07 10:36:58 +08:00
    kamal
        3
    kamal  
       2017-12-07 11:04:02 +08:00
    serco
        4
    serco  
       2017-12-07 11:13:06 +08:00
    英文不忍直视啊。。。
    robinlovemaggie
        5
    robinlovemaggie  
       2017-12-07 11:26:39 +08:00
    简单点说兼容新老浏览器的库就是 polyfill,否则不是。例如,jQuery 不是,Polymer, FlashCavas 是。
    Mutoo
        6
    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
        7
    shanechiu  
    OP
       2017-12-08 17:13:46 +08:00
    @Mutoo well,thanks a lot.
    shanechiu
        8
    shanechiu  
    OP
       2017-12-08 17:17:03 +08:00
    @hjdtl I read the article throughly, it is fully. Thank you for your recommendation.
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   4479 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 01:05 · PVG 09:05 · LAX 17:05 · JFK 20:05
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.