How to provide ECMAScript 5 (ES 5)-shim?

后端 未结 3 1021
有刺的猬
有刺的猬 2021-02-02 07:09

ECMAScript Fifth Edition (released December 2009) introduces a bunch of new methods (see this table for details). However, there still are older browsers out there which do not

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-02 07:53

    At present, the solution that works best with ES5-Shim is to use the library in all environments and allow it to detect which features it needs to patch at run-time. It would be even better to deliver it from a community CDN to maximize cross-site cache hits.

    That being said, there is an open opportunity to create systems that combines feature detection, agent fingerprinting, and dynamic bundling to automatically generate and deliver targeted shim subsets. The scope of the problem extends far beyond just ES5-Shim and could be applied to all sorts of shims.

提交回复
热议问题