V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
shanechiu

What does 'polyfill' mean?

  •  
  •   shanechiu ·
    shanezhiu · Dec 7, 2017 · 2401 views
    This topic created in 3064 days ago, the information mentioned may be changed or developed.

    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 replies    2017-12-08 17:17:03 +08:00
    hjdtl
        1
    hjdtl  
       Dec 7, 2017
    百度了一下,感觉这个答案还不错: https://segmentfault.com/a/1190000002593432
    SourceMan
        2
    SourceMan  
       Dec 7, 2017
    kamal
        3
    kamal  
       Dec 7, 2017
    serco
        4
    serco  
       Dec 7, 2017
    英文不忍直视啊。。。
    robinlovemaggie
        5
    robinlovemaggie  
       Dec 7, 2017
    简单点说兼容新老浏览器的库就是 polyfill,否则不是。例如,jQuery 不是,Polymer, FlashCavas 是。
    Mutoo
        6
    Mutoo  
       Dec 7, 2017
    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
       Dec 8, 2017
    @Mutoo well,thanks a lot.
    shanechiu
        8
    shanechiu  
    OP
       Dec 8, 2017
    @hjdtl I read the article throughly, it is fully. Thank you for your recommendation.
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5975 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 62ms · UTC 06:16 · PVG 14:16 · LAX 23:16 · JFK 02:16
    ♥ Do have faith in what you're doing.