ampproject / ampproject/amphtml

AMP Runtime: allow usage of iterator/destructure/spread/rest

Open
#35,694 8 comments 0 reactions 0 assignees View on GitHub
Stale Type: Feature Request
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

## Description

Awhile back we decided to start allowing for iterator to be used (https://github.com/ampproject/amphtml/pull/34249). The logic was that it only adds 0.12kb to any bundle which uses it, and only `.js` builds as opposed to `.mjs` builds. We started implementation of this change, but ran into roadblocks (https://github.com/ampproject/amphtml/pull/34282#pullrequestreview-657290325)

### To do:

Update these plugins/rules to handle `ArrayExpression`:
- [x] build-system/eslint-rules/no-deep-destructuring.js: https://github.com/ampproject/amphtml/pull/35698
- [ ] build-system/eslint-rules/unused-private-field.js
- [ ] [Descoped] ~build-system/eslint-rules/prefer-destructuring.js~

Can be removed:
- [x] build-system/babel-plugins/babel-plugin-transform-simple-array-destructure/index.js (https://github.com/ampproject/amphtml/pull/35695)
- [x] no-array-destructuring, no-rest, no-spread (https://github.com/ampproject/amphtml/pull/35699)

cc @ampproject/wg-performance

Contributor guide

Open the contributing guide

Research direction

Start with build-system/eslint-rules/unused-private-field.js and compare its handling of ArrayExpression with the completed no-deep-destructuring.js change linked in the issue. Review the related Babel and rule-removal pull requests for context, then verify that the remaining rule handles ArrayExpression without breaking its existing checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
build-system, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.