@ampproject/toolbox-optimizer
2.10.1 · 14 Jun 2024Apache-2.052.9k / weekRepositoryHomepagenpmAtom feed
2.10.1 is the newest release of 2.x.
In short
7 new4 fixed4 changed
Release note
Migration notes:
The
SeparateKeyframetransformer'scompressoption has been renamed tominify. The same option will also be used by theMinifyHtmltransformer. The default value continues to betrue.The API for implementing a custom transformer has changed. We no longer monkey patch the node class, but instead rely on helper methods defined in
NodeUtils:const {firstChildByTag, appendChild, createElement} = require('@ampproject/toolbox-optimizer').NodeUtils; class CustomTransformer { constructor(config) { this.log_ = config.log.tag('CUSTOM'); } transform(tree, params) { this.log_.info('Running custom transformation for ', params.filePath); const html = firstChildByTag(tree, 'html'); if (!html) return; const head = firstChildByTag(html, 'head'); if (!head) return; const desc = createElement('meta', { name: 'description', content: 'this is just a demo', }); appendChild(head, desc); } }
:rocket: Enhancement
core, optimizer: Add MinifyHtml transformer (@sebastianbenz)
cli, optimizer: migrate to htmlparser2 (@sebastianbenz)
cli, optimizer: Auto inject missing AMP boilerplate (@sebastianbenz)
optimizer: Add AutoExtensionImporter (@sebastianbenz)
optimizer: Add Markdown transformer (@sebastianbenz)
cors: Remove AMP-Redirect-To from access-control-expose-headers for email (@fstanis)
:bug: Bug Fix
optimizer: Only trim whitespace in head (@sebastianbenz)
optimizer: AutoExtensionImporter: fix amp-carousel adding amp-lightbox-gallery (@sebastianbenz)
optimizer: Fix: Empty <amp-experiment> blocks boilerplate removal (@sebastianbenz)
optimizer: Fix: ReorderHead priorities (@sebastianbenz)
:house: Internal
cli, core, cors, optimizer, update-cache: Auto snapshot (@sebastianbenz)
linter, optimizer-express: update dependencies (@sebastianbenz)
cache-list, cache-url, cli, core, cors, lighthouse-plugin-amp, linter, optimizer-express, optimizer, runtime-version, script-csp, update-cache, validator-rules: Adds "repository" and "homepage" to every package.json (@fstanis)
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.