serverless / platform-sdk

Serverless Platform SDK
Apache License 2.0
17 stars 7 forks source link

Remove core js babel runtime #24

Closed SalvatorePreviti closed 5 years ago

SalvatorePreviti commented 5 years ago

https://github.com/serverless/platform-sdk/issues/3#issuecomment-453624473

core-js slows down loading and slows down javascript builtins adding polyfills serverless don't use at all. This problem becomes worse if a newer version of core-js is used.

At the moment, both this package and serverless seems to need only the regenerator runtime and not all other the polyfills.

This Pull Request removes babel-polyfill dependency and replaces it with regenerator-runtime.

A new file runtime.js is used both by jest and by the library to correctly load regenerator-runtime.

Many thanks to @paolopiaggio for discovering the problem and helping testing and come out with the idea.

SalvatorePreviti commented 5 years ago

(tests are failing because "snyk test requires an authenticated account. Please run snyk auth and try again.")