ampproject / ampproject/amp-toolbox

[optimizer] not all transformers honor passed configuration

Open
#547 1 comment 0 reactions 0 assignees View on GitHub
enhancement good first issue toolbox-optimizer
Dominant language
HTML
Stars
459
Forks
242
PR merge metrics
No merged PRs in 30d

Description

When optimizer used in conjuction together with optimizer-express it's not possible to pass params to optimizer's `transformHtml` method, only configuration to the optimizer constructor.

And while some transformers honor those configurations:
https://github.com/ampproject/amp-toolbox/blob/efe5775c5ff93ebacd6f7bd336ba02d829eca579/packages/optimizer/lib/transformers/AmpBoilerplateTransformer.js#L30-L37

looks like a lot of other does not: https://github.com/ampproject/amp-toolbox/blob/efe5775c5ff93ebacd6f7bd336ba02d829eca579/packages/optimizer/lib/transformers/RewriteAmpUrls.js

Contributor guide

Open the contributing guide

Research direction

Start with the optimizer's transformHtml entry point and compare the configuration handling in AmpBoilerplateTransformer.js with RewriteAmpUrls.js. Review the other transformer files to identify which ones ignore passed configuration, then verify that each transformer honors configuration supplied to transformHtml.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.