Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

notebooks: Group notebook routes#47897

Merged
fkling merged 4 commits into
mainfrom
fkling/notebook-routes
Feb 21, 2023
Merged

notebooks: Group notebook routes#47897
fkling merged 4 commits into
mainfrom
fkling/notebook-routes

Conversation

@fkling

@fkling fkling commented Feb 20, 2023

Copy link
Copy Markdown
Contributor

This PR consolidates notebook routes into a single component.

I hope that doesn't interfere with the React router migration efforts. It makes it easier to integrate notebooks with the SvelteKit app and is also more in line with how other product areas are structured (e.g. insights, code monitors, ...).

This also removes the use of showSearchNotebooks, which has been removed in https://github.com/sourcegraph/sourcegraph/pull/46086.

(note: Adding people as reviewers who have better knowledge about react router than me)

Test plan

  • When signed out I can see a list of public notebooks and open public notebooks
    • Going to /notebooks/new redirects to the notebooks list page
  • When signed in I see my own notebooks, can open my own notebooks and can create new notebooks.

App preview:

Check out the client app preview documentation to learn more.

@cla-bot cla-bot Bot added the cla-signed label Feb 20, 2023
@fkling fkling changed the title notebooks: Group routes notebooks: Group notebook routes Feb 20, 2023
@sg-e2e-regression-test-bob

sg-e2e-regression-test-bob commented Feb 20, 2023

Copy link
Copy Markdown

Bundle size report 📦

Initial size Total size Async size Modules
-0.03% (-0.78 kb) 0.00% (+0.22 kb) 0.01% (+1.00 kb) 0.13% (+1) 🔺

Look at the Statoscope report for a full comparison between the commits f219a35 and ccfa75c or learn more.

Open explanation
  • Initial size is the size of the initial bundle (the one that is loaded when you open the page)
  • Total size is the size of the initial bundle + all the async loaded chunks
  • Async size is the size of all the async loaded chunks
  • Modules is the number of modules in the initial bundle

@philipp-spiess philipp-spiess left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this makes sense for now in the very short term but with React router 6 we'd actually like to move more and more routes into a shared router map that is global so we can actually properly do data preloading (e.g. can't preload notebook data early if we don't know which specific page it even needs).

Any way that you could use the routes.tsx file instead somehow in Sveltekit?

@fkling

fkling commented Feb 20, 2023

Copy link
Copy Markdown
Contributor Author

Any way that you could use the routes.tsx file instead somehow in Sveltekit?

I guess I can just replicate whatever Layout is doing. Load the routes definition, pull out the ones I need and create routes for them.

@fkling

fkling commented Feb 20, 2023

Copy link
Copy Markdown
Contributor Author

I can also discard this PR and create my own Notebook specific routing logic for the SvelteKit app. The Notebooks subtree is just easier to test than insights or batch changes and it seemed to be a reasonable change.
But if that makes things more complicated for you we don't have to do it!

@valerybugakov

Copy link
Copy Markdown
Member

with React router 6 we'd actually like to move more and more routes into a shared router map that is global so we can actually properly do data preloading

Thanks for communicating this, @philipp-spiess! It's not planned for the short-term future because we're focused on top-level routes and the application shell at the moment, but eventually, we want to lift most of the routes to the top level. This means there won't be a standalone router for the notebooks section.

@valerybugakov valerybugakov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Commenting to remove from the review queue.

@fkling fkling force-pushed the fkling/notebook-routes branch from 0ad2195 to 4a6d460 Compare February 21, 2023 11:25
@fkling fkling force-pushed the fkling/notebook-routes branch from 08938b4 to f219a35 Compare February 21, 2023 13:38
@fkling fkling merged commit ae66f85 into main Feb 21, 2023
@fkling fkling deleted the fkling/notebook-routes branch February 21, 2023 14:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants