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

Make the Image component AMP-aware #826

Merged
merged 22 commits into from May 28, 2021
Merged

Make the Image component AMP-aware #826

merged 22 commits into from May 28, 2021

Conversation

michalczaplinski
Copy link
Member

@michalczaplinski michalczaplinski commented May 21, 2021

What:

Make the @frontity/components/Image AMP-aware and remove the Intersection Observer fallback which used to lazily load images in the absence of native lazy loading.

Why:

To complete making AMP a first-class citizen in Frontity: https://community.frontity.org/t/amp-package/388/

How:

Check if the state.frontity.mode === "amp"

Tasks:

  • Code
  • TSDocs
  • TypeScript
  • Unit tests
  • End to end tests
  • Add a changeset (with link to its Feature Discussion if it exists)

Unrelated Tasks

  • TypeScript tests
  • Update starter themes
  • Update other packages
  • Update community discussions

Additional Comments

Not linking the issue because I don't want to close it yet when this PR is merged.

@michalczaplinski michalczaplinski self-assigned this May 21, 2021
@changeset-bot
Copy link

changeset-bot bot commented May 21, 2021

🦋 Changeset detected

Latest commit: 5d41a34

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@michalczaplinski michalczaplinski changed the title Amp aware image Make the Image component AMP-aware May 21, 2021
@github-actions
Copy link
Contributor

github-actions bot commented May 22, 2021

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@michalczaplinski
Copy link
Member Author

Now, that the mode of the Frontity app can be set to a new value ("amp") I've noticed that in some places the default value was "default" but in others it was referred to as "html".

In order to avoid bikeshedding about it, I went ahead and changed the references to "html" mode to "default"

@github-actions
Copy link
Contributor

github-actions bot commented May 27, 2021

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@michalczaplinski michalczaplinski marked this pull request as ready for review May 27, 2021 23:34
@michalczaplinski
Copy link
Member Author

Copy link
Member

@luisherranz luisherranz left a comment

Choose a reason for hiding this comment

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

Looks great to me! I love when we remove code 😄

Thanks Michal!

packages/components/image.tsx Outdated Show resolved Hide resolved
packages/components/image.tsx Show resolved Hide resolved
@github-actions
Copy link
Contributor

github-actions bot commented May 28, 2021

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@michalczaplinski michalczaplinski merged commit 252a6e3 into dev May 28, 2021
@michalczaplinski michalczaplinski deleted the amp-aware-image branch May 28, 2021 21:23
This was referenced Jun 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants