Packages

@ampproject/toolbox-optimizer

2.10.1 · 14 Jun 2024Apache-2.052.9k / weekRepositoryHomepagenpmAtom feed

Your version

2.0.0

major13 Feb 2020Where it was published

2.10.1 is the newest release of 2.x.

In short

7 new4 fixed4 changed

Release note

Migration notes:

  • The SeparateKeyframe transformer's compress option has been renamed to minify. The same option will also be used by the MinifyHtml transformer. The default value continues to be true.

  • 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

: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.