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

feat: jumps to anchor in tabbed page #3626

Merged
merged 1 commit into from
Mar 17, 2023

Conversation

blakef
Copy link
Contributor

@blakef blakef commented Mar 16, 2023

We use tabs to nest whole pages. This means deep links might not aleady have the anchor referenced id on the page. For example:

https://reactnative.dev/docs/environment-setup#ruby

Only applies if the 'React Native CLI Quickstart' -> macOS -> iOS tabs have been selected. There's no guarantee this is the case until the document has loaded and the application have updated the DOM. Once a bunch of PRs have landed (), this type of link will work as expected:

https://reactnative.devdocs/environment-setup?os=macos&platform=ios&guide=native&package-manager=npm#rubys-bundler

This jump-to behaviour should only run on the initial load.

Dependencies

This can go in before, it'll just be a noop until it lands.

Demo

CleanShot.2023-03-16.at.13.40.46.mp4

We use tabs to nest whole pages. This means deep links might not aleady
have the anchor referenced id on the page. For example:

https://reactnative.dev/docs/environment-setup#ruby

Only applies if the 'React Native CLI Quickstart' -> macOS -> iOS tabs
have been selected. There's no guarantee this is the case until the
document has loaded and the application have updated the DOM.

This jump-to behaviour should only run on the the initial load.
@netlify
Copy link

netlify bot commented Mar 16, 2023

Deploy Preview for react-native ready!

Name Link
🔨 Latest commit 5aaefc0
🔍 Latest deploy log https://app.netlify.com/sites/react-native/deploys/64131deb101a3a000889866b
😎 Deploy Preview https://deploy-preview-3626--react-native.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

website/modules/jumpToFragment.js Show resolved Hide resolved
@motiz88
Copy link
Contributor

motiz88 commented Mar 17, 2023

There's no guarantee this is the case until the document has loaded and the application have updated the DOM.

We should probably migrate to a Next.js server-rendered site at some point...

@Simek
Copy link
Collaborator

Simek commented Mar 17, 2023

We should probably migrate to a Next.js server-rendered site at some point...

We are not using Next, we use Docusuaurus to power the site, which only supports SSG and SSR only partially.

@blakef blakef merged commit 758aac1 into facebook:main Mar 17, 2023
@blakef blakef deleted the feat-jump-to-fragment-id-with-tabs branch March 17, 2023 11:54
@motiz88
Copy link
Contributor

motiz88 commented Mar 17, 2023

@Simek Just to clarify: I'm aware that the site currently uses Docusaurus. I'm saying we might want to consider moving to a different stack.

@Simek
Copy link
Collaborator

Simek commented Mar 17, 2023

@motiz88 It would be a quite a big and complex task, probably even bigger than migration to V2 (which took few months and leverage the dedicated MHL group help), so not sure if it is worth the effort if only SSR is a gain, and we will need to reimplement a lot of features like versioning, MDX handling, remark plugins etc., but we definitely can discuss that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants