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

[PWA-2498] Rename Link's prefetchType prop #3646

Merged
merged 7 commits into from
Jan 27, 2022
Merged

Conversation

jimbo
Copy link
Contributor

@jimbo jimbo commented Jan 12, 2022

Description

For the Link component, rename the boolean prop prefetchType to shouldPrefetch. The former appears to indicate it will contain a type rather than a boolean, causing some confusion. The approach herein

  • Deprecates the existing prefetchType prop to Link and useLink, but does not remove it
  • Adds shouldPrefetch as a new prop to both component and talon
  • Ignores the value of prefetchType unless it is true

Related Issue

Closes #3647

Acceptance

Verification Stakeholders

Specification

Verification Steps

Links with either value of prefetchType should work the same as they do now. That said, we don't appear to have any.

Test scenario(s) for direct fix/feature

Test scenario(s) for any existing impacted features/areas

Test scenario(s) for any Magento Backend Supported Configurations

Is Browser/Device testing needed?

Any ad-hoc/edge case scenarios that need to be considered?

Screenshots / Screen Captures (if appropriate)

Breaking Changes (if any)

These changes should be non-breaking. Eventually, we should remove the deprecated prop, which would be a breaking change.

Checklist

  • I have added tests to cover my changes, if necessary.
  • I have added translations for new strings, if necessary.
  • I have updated the documentation accordingly, if necessary.

Resolved issues:

  1. resolves [Issue] Rename Link's prefetchType prop #3647: Rename Link's prefetchType prop

@pwa-studio-bot
Copy link
Collaborator

pwa-studio-bot commented Jan 12, 2022

Messages
📖 DangerCI Failures related to missing labels/description/linked issues/etc will persist until the next push or next nightly build run (assuming they are fixed).
📖

Access a deployed version of this PR here. Make sure to wait for the "pwa-pull-request-deploy" job to complete.

Generated by 🚫 dangerJS against d339f57

@supernova-at
Copy link
Contributor

@magento create issue from PR

@jeremycharron jeremycharron changed the title Rename Link's prefetchType prop [PWA-2498] Rename Link's prefetchType prop Jan 19, 2022
@jeremycharron jeremycharron added the version: Minor This changeset includes functionality added in a backwards compatible manner. label Jan 19, 2022
Copy link
Contributor

@jeremycharron jeremycharron left a comment

Choose a reason for hiding this comment

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

@jimbo
Code looks good except single comment about TODO. I added a minor version label + fixed the "closes issue" in description. Warning should be gone next checks run.

*/
const Link = props => {
const talonProps = useLink(props);
// TODO: remove `prefetchType`
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this TODO be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, the prop still exists so as not to be a breaking change. We can actually remove it in a future major release, and delete the comment at that time.

Copy link
Contributor

@jeremycharron jeremycharron left a comment

Choose a reason for hiding this comment

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

Code looks good. Approved.

@ericeoeur
Copy link
Contributor

QA has passed for this ticket and will be merged momentarily. Thanks!

@ericeoeur ericeoeur merged commit c760bb6 into develop Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:peregrine pkg:venia-ui Progress: done version: Minor This changeset includes functionality added in a backwards compatible manner.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Issue] Rename Link's prefetchType prop
5 participants