Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new optimizer readme #346

Merged
merged 3 commits into from Jun 7, 2019
Merged

new optimizer readme #346

merged 3 commits into from Jun 7, 2019

Conversation

sebastianbenz
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@ithinkihaveacat ithinkihaveacat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, a few small comments.


Currently the following options are supported:
```shell
$ npx @ampproject/toolbox-cli myFile.html
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no command required?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, but I'll try once it's deployed


// retrieve the latest runtime version
const runtimeVersion = require('amp-toolbox-runtime-version');
const ampOptimiser = require('@ampproject/toolbox-optimizer');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should be ampOptimizer, for consistency with the package name. (As an Australian used to British spelling, I am very reluctant to mention this…)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol - fixed


[![npm version](https://badge.fury.io/js/amp-toolbox-optimizer.svg)](https://badge.fury.io/js/amp-toolbox-optimizer)

AMP Optimizer - the performance optimizations of the AMP Cache on your own site.
AMP Optimizer is a tool to server-side enhance the rendering performance of AMP pages. AMP Optimizer implements [AMP performance best practices](https://amp.dev/documentation/guides-and-tutorials/optimize-and-measure/optimize_amp?format=websites) and supports [AMP server-side-rendering](https://amp.dev/documentation/guides-and-tutorials/optimize-and-measure/server-side-rendering?format=websites). By default, it will perform the following optimizations:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's worth mentioning that the optimizer generates valid AMP (given valid input) somewhere here for clarity (even if briefly) especially since this is a change from previous versions.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point! Done!

* The AMP boilerplate gets removed. Instead the `v0.css` is added.
* AMP layout classes are added to the `amp-img` extension.
* `<link rel="amphtml" href="canonical.amp.html">` gets added linking to the valid AMP version.
This transformer supports the following option:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/option/options/

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

AMP Runtime being loaded, which improves load times.
Example:
```
const ampOptimiser = require('@ampproject/toolbox-optimizer');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe change this to "optimizer" too…

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

to:
```
// globally
const optimizer = AmpOptimzer.create({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/AmpOptimzer/AmpOptimizer/

Copy link
Collaborator Author

@sebastianbenz sebastianbenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Michael!


// retrieve the latest runtime version
const runtimeVersion = require('amp-toolbox-runtime-version');
const ampOptimiser = require('@ampproject/toolbox-optimizer');
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol - fixed

* The AMP boilerplate gets removed. Instead the `v0.css` is added.
* AMP layout classes are added to the `amp-img` extension.
* `<link rel="amphtml" href="canonical.amp.html">` gets added linking to the valid AMP version.
This transformer supports the following option:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

AMP Runtime being loaded, which improves load times.
Example:
```
const ampOptimiser = require('@ampproject/toolbox-optimizer');
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


Currently the following options are supported:
```shell
$ npx @ampproject/toolbox-cli myFile.html
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, but I'll try once it's deployed


[![npm version](https://badge.fury.io/js/amp-toolbox-optimizer.svg)](https://badge.fury.io/js/amp-toolbox-optimizer)

AMP Optimizer - the performance optimizations of the AMP Cache on your own site.
AMP Optimizer is a tool to server-side enhance the rendering performance of AMP pages. AMP Optimizer implements [AMP performance best practices](https://amp.dev/documentation/guides-and-tutorials/optimize-and-measure/optimize_amp?format=websites) and supports [AMP server-side-rendering](https://amp.dev/documentation/guides-and-tutorials/optimize-and-measure/server-side-rendering?format=websites). By default, it will perform the following optimizations:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point! Done!

@sebastianbenz sebastianbenz merged commit 7349f80 into master Jun 7, 2019
@sebastianbenz sebastianbenz deleted the optimizer-readme branch June 7, 2019 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants