Skip to content

fix(v8.18.3) : fix 2 minor typos #2

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion v8.18.3/guides/amp.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ ctx.renderPage = async () => {

## Two-way data binding

AMP and React have fundamentally different patterns for managing state. React allows you to respond to events with javascript and update state using the update function returned by the `useState` hook. AMP uses a more declarative approach with [amp-bind](https://amp.dev/documentation/components/amp-bind/) that resembles to-way data-binding. In order to create a common approach to state management that works in both react and amp, `react-storefront-amp` provides two-way databinding via a `DataBindingProvider` component and the `bind` prop.
AMP and React have fundamentally different patterns for managing state. React allows you to respond to events with javascript and update state using the update function returned by the `useState` hook. AMP uses a more declarative approach with [amp-bind](https://amp.dev/documentation/components/amp-bind/) that resembles two-way data-binding. In order to create a common approach to state management that works in both react and amp, `react-storefront-amp` provides two-way databinding via a `DataBindingProvider` component and the `bind` prop.

Here's a simple example from `pages/p/[productId].js` that shows how the quantity selector updates the page state in both AMP and React using the same code:

Expand Down
2 changes: 1 addition & 1 deletion v8.18.3/guides/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ mainProductImage.src = await getBase64ForImage(mainProductImage.src)

### defer vs async

Oue tests show that using `defer` instead of `async` when importing client-side JavaScript generally improves Lighthouse performance scores by a few points. It usually improves FCP and LCP, but makes TTI and TBT a bit worse. Normally this trade-off nets a higher Lighthouse score. This may or may not be the case for your app. You can experiment by changing the `mode` prop from `defer` to `async` in `NextScript` in `pages/_document_.js`
Our tests show that using `defer` instead of `async` when importing client-side JavaScript generally improves Lighthouse performance scores by a few points. It usually improves FCP and LCP, but makes TTI and TBT a bit worse. Normally this trade-off nets a higher Lighthouse score. This may or may not be the case for your app. You can experiment by changing the `mode` prop from `defer` to `async` in `NextScript` in `pages/_document_.js`