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

Bug/issue 1026 deeply nested direct hash links #1028

Merged
merged 6 commits into from
Dec 10, 2022

Conversation

thescientist13
Copy link
Member

@thescientist13 thescientist13 commented Dec 8, 2022

Related Issue

resolves #1026

Summary of Changes

  1. Make sure to handle a case where a hash link is clicked before its preceding pathname
  2. Make loadRoute async to account for loading content before trying to change a hash (race condition)
  3. Mark staticRouter as experimental in the Configuration docs
  4. Validated existing test cases from router refactor to better handle hash URL changes and history navigation events #937

TODO

  1. Final Production cross browser sanity check / clean up remaining console logs
    • Chrome
    • Safari
    • Firefox
  2. Track a discussion about router future - Static Router Enhancements #1033
    • can this all be done (pathname, hash, etc) through pushState in one go?
      history.pushState({}, '', `${targetUrl.pathname}${targetUrl.hash}`);
    • Bury more of the logic into RouteComponent?
    • should loadRoute take a callback?
    • better scroll up on back button
    • what about SSR capabilities, including on-demand fragment routing?
  3. Track No JS fallback option for website menu, as part of Website redesign, branding, and long term structure #978
  4. We really need to get some E2E setup for this website

Test Cases

  • -> - click menu
  • > - expand menu

Home -> Plugins + side nav

1. Home
2. -> Plugins
3.   -> Copy
4.   -> Resource
5.   -> Renderer
6.   -> Rollup

Home -> Getting Started + side nav + nested items

1. Home
2. -> Getting Started
3.  -> Project Setup
4.  -> Key Concepts
5.   -> Creating Content
6a.     -> Home Page Template
6b.     -> Blog Posts Template
6c.     -> App Template
6d.     -> Creating Pages
7.   -> Optimizing
7a.     -> Prerendering
Home -> Getting Started + side nav + nested items ✅ *
1. Home
2. -> Getting Started
3.  > Project Setup
4.  > Key Concepts
5.  > Creating Content
5a.     -> Home Page Template
5b.     -> Blog Posts Template
5c.     -> App Template
5d.     -> Creating Pages
6.   > Optimizing
6a.     -> Prerendering

Note: when going back, Key Concept and Project Setup should not be visited.

going from > -> -> and going back will result in two entries, not one.

Home -> Getting Started + side nav + nested items -> Blog ✅

1. Home
2. -> Getting Started
3.  -> Project Setup
4.  -> Key Concepts
5.   -> Creating Content
5a.     -> Home Page Template
5b.     -> Blog Posts Template
5c.     -> App Template
5d.     -> Creating Pages
6.   -> Optimizing
6a.     -> Prerendering
7.  Blog
8.   -> State of Greenwood 2022

Home -> Getting Started + side nav + nested items -> Blog ✅

1. Home
2. -> Getting Started
3.   > Project Setup
4.  > Key Concepts
5.   > Creating Content
5a.     -> Home Page Template
5b.     -> Blog Posts Template
5c.     -> App Template
5d.     -> Creating Pages
6.   > Optimizing
6a.     -> Prerendering
7.  -> Blog
8.   -> State of Greenwood 2022

Note: when going back, Key Concept and Project Setup should not be visited.

Docs -> About + side nav

1. Home
2. -> Docs
2a.   -> Configuration
2b.   -> Front Matter
3. About
4.   -> Goals

@thescientist13 thescientist13 added bug Something isn't working P0 Critical issue that should get addressed ASAP documentation Greenwood specific docs CLI Router labels Dec 8, 2022
@thescientist13 thescientist13 self-assigned this Dec 10, 2022
@thescientist13 thescientist13 added the website Tasks related to the projects website / documentation label Dec 10, 2022
@thescientist13 thescientist13 force-pushed the bug/issue-1026-deeply-nested-direct-hash-links branch from 39e0cce to 2cc3aa1 Compare December 10, 2022 02:19
@thescientist13 thescientist13 merged commit e7a08b6 into master Dec 10, 2022
@thescientist13 thescientist13 deleted the bug/issue-1026-deeply-nested-direct-hash-links branch December 10, 2022 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CLI documentation Greenwood specific docs P0 Critical issue that should get addressed ASAP Router website Tasks related to the projects website / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

deeply nested direct hash link breaks the router if pathname not already present
1 participant