You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AMP's infrastructure code in build-system/ is currently all ES5 and uses require to consume various packages. However, more and more packages are switching to ES6-only, and cannot be adopted in their current form. E.g. node-fetch and tempy (there are a few others, see #35032 (comment)).
Migrating all code in build-system/ to ES6 will modernize the codebase and solve the problem of not being able to use the latest version of some packages. However, the actual difficulty of doing this is unknown, since other packages may be ES5-only, and existing task implementations may need updates before they can work cleanly with ES6 packages.
The purpose of this issue is to discuss / experiment with a partial migration, and make a recommendation on how to proceed.
Alternatives Considered
Remain on ES5 and don't adopt the latest version of any ES6-only package
Partially move to ES6 and migrate only those tasks that can actually work with ES6-only packages
Fully move to ES6 and find replacements for any ES5-only packages
1 is not future-proof, 2 can be done gradually (assuming it's possible), and eventually lead to 3.
may be ES5-only, and existing task implementations may need updates before they can work cleanly with ES6 packages.
I believe ES5-only packages are usable via import syntax. See the Node docs
When importing CommonJS modules, the module.exports object is provided as the default export. Named exports may be available, provided by static analysis as a convenience for better ecosystem compatibility.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
Description
AMP's infrastructure code in
build-system/
is currently all ES5 and usesrequire
to consume various packages. However, more and more packages are switching to ES6-only, and cannot be adopted in their current form. E.g.node-fetch
andtempy
(there are a few others, see #35032 (comment)).Migrating all code in
build-system/
to ES6 will modernize the codebase and solve the problem of not being able to use the latest version of some packages. However, the actual difficulty of doing this is unknown, since other packages may be ES5-only, and existing task implementations may need updates before they can work cleanly with ES6 packages.The purpose of this issue is to discuss / experiment with a partial migration, and make a recommendation on how to proceed.
Alternatives Considered
1 is not future-proof, 2 can be done gradually (assuming it's possible), and eventually lead to 3.
Additional Context
/cc @ampproject/wg-infra @ampproject/wg-performance @ampproject/wg-components @ampproject/wg-bento
The text was updated successfully, but these errors were encountered: