Skip to content

fix(screen): broken link when there's no document #764

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

Closed

Conversation

MatanBobi
Copy link
Member

What: Fix a broken link when there's no document defined

Why: The link is broken

How: I've put a link to the screen api definition. I couldn't find the page that was there before in the docs repo neither in the commits history.

Checklist:

  • Documentation added to the
    docs site - N/A
  • Tests
  • Typescript definitions updated - N/A
  • Ready to be merged

@codesandbox-ci
Copy link

codesandbox-ci bot commented Sep 10, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit db1e72e:

Sandbox Source
kentcdodds/react-testing-library-examples Configuration

@codecov
Copy link

codecov bot commented Sep 10, 2020

Codecov Report

Merging #764 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #764   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           25        25           
  Lines          702       702           
  Branches       183       183           
=========================================
  Hits           702       702           
Impacted Files Coverage Δ
src/screen.js 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3154dc4...db1e72e. Read the comment docs.

Copy link
Member

@eps1lon eps1lon left a comment

Choose a reason for hiding this comment

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

I think we just want to update the redirect in testing-library-docs. Links in error messages should always work since some users might not be able to upgrade the library.

@MatanBobi
Copy link
Member Author

MatanBobi commented Sep 10, 2020

I think we just want to update the redirect in testing-library-docs. Links in error messages should always work since some users might not be able to upgrade the library.

That's a good point.. I think we should add it there but IMO we shouldn't count on a redirect to always be there and also fix the link..
WDYT?

@eps1lon
Copy link
Member

eps1lon commented Sep 16, 2020

We don't need this anymore, right? The link is now valid.

@MatanBobi
Copy link
Member Author

MatanBobi commented Sep 16, 2020

We don't need this anymore, right? The link is now valid.

The link is valid but as I wrote above, I think that this fix should be in both places.. IMO we shouldn't rely on a redirect to always exist and should fix this here also..
This way we're backwards compatible and we're doing steps to decouple this from the redirection, WDYT?

@eps1lon
Copy link
Member

eps1lon commented Sep 16, 2020

We're actually less backwards compatible. Note that we can't change these links once published. If we decide to move the page then any version published will have 404 links. We could then decide to make redirect but we might as well use a permalink to begin with. Otherwise we have to maintain redirects for every published version of the library.

I believe this is the same rationale that React is using for links in dev warnings. All of these links redirect to the actual page.

@MatanBobi
Copy link
Member Author

MatanBobi commented Sep 16, 2020

We're actually less backwards compatible. Note that we can't change these links once published. If we decide to move the page then any version published will have 404 links. We could then decide to make redirect but we might as well use a permalink to begin with. Otherwise we have to maintain redirects for every published version of the library.

I believe this is the same rationale that React is using for links in dev warnings. All of these links redirect to the actual page.

That's a good point, I didn't think about it that way..
I'll close this one :)
Thanks!

@MatanBobi MatanBobi closed this Sep 16, 2020
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.

2 participants