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

Route registry #6600

Merged
merged 5 commits into from
Jan 17, 2025
Merged

Route registry #6600

merged 5 commits into from
Jan 17, 2025

Conversation

sneridagh
Copy link
Member

Added registerRoute API for the config.
It allows to add a ReactRouter route to the configuration, that we can process and load later.
Quite simple, it only saves the configuration given a specific object.

@sneridagh sneridagh requested a review from pnicolli January 17, 2025 11:57
Copy link

netlify bot commented Jan 17, 2025

Deploy Preview for plone-components canceled.

Name Link
🔨 Latest commit b7dfaa0
🔍 Latest deploy log https://app.netlify.com/sites/plone-components/deploys/678a5da2473b170008408672

@sneridagh sneridagh merged commit 5c71a35 into main Jan 17, 2025
72 checks passed
@sneridagh sneridagh deleted the routeRegistry branch January 17, 2025 14:51
Copy link
Member

@davisagli davisagli left a comment

Choose a reason for hiding this comment

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

@sneridagh No documentation?

@stevepiercy
Copy link
Collaborator

@sneridagh if docs are needed—and I think they are needed, especially for an API—then at least create a new issue referencing this PR. Otherwise it will go unnoticed and unused.

@sneridagh
Copy link
Member Author

sneridagh commented Jan 18, 2025

@davisagli @stevepiercy incoming, I promise, I needed it to see if something I wanted to try would work... and it did :)
Also, this is not intended for current Volto version, but for the Plone 7 one.

@sneridagh
Copy link
Member Author

@stevepiercy @davisagli Which brings the point on how to document something that will be only usable in the next Plone (Volto) major, or in this case, only relevant for React Router 7 projects.

@stevepiercy
Copy link
Collaborator

@sneridagh if by "how to document" you mean "where to document", and assuming this would be a how-to guide to configure routing in Volto, then it would be a new page under Development. If a reference, then under Configuration. If explanation, then under Conceptual guides.

In all cases, we would need to add an admonition and use a title that includes "Plone 7". We could try a collapsible admonition, initially closed, so that the reader would have to click on the admonition title to reveal the content, effectively serving as a "I understand and accept the risks" thing.

https://myst-parser.readthedocs.io/en/latest/syntax/admonitions.html#collapsible-admonitions

# Routes in Plone 7

```{admonition} Warning! This feature is experimental. Click to accept the risks and read details.
:class: warning

All the content here.
```

If that's too much, we can just use an admonition at the top of the page without a toggle.

We also have this ridiculously shameless document Contributing to Volto > Routing, so whatever you write will not conflict with what does not exist. There may be other relevant docs, but I don't know which they would be from a search for "routing".

sneridagh added a commit that referenced this pull request Jan 18, 2025
* main:
  Route registry (#6600)
@sneridagh
Copy link
Member Author

@stevepiercy let's talk about this, because I started to write it, and it's not that easy.

For example, let's assume we start to document all the new things in Plone 7. If we mix it up with the "Plone 6" things it will be a complete mess. Specially when we will have to "switch" to Plone 7 is default eg. "https://7.docs.plone.org"...

So I think we really need a sound strategy with this. TBH, I'd start a new completely different "Canary docs" section, going full diataxis in there.

It's easier to document the new feature in @plone/registry alone for now. I'll start doing it.

@sneridagh
Copy link
Member Author

@stevepiercy @davisagli #6604

sneridagh added a commit that referenced this pull request Jan 21, 2025
* main: (741 commits)
  Improve the usability of the ObjectBrowser when inputting a manual value, checking it on blur, and adding a local validator (#6576)
  fixing Markdown heading (#6588)
  fix site logo issue (#6591)
  Route registry (#6600)
  Release @plone/client 1.0.0-alpha.21
  Export the getContent bare fetcher (#6594)
  fix: incorrect copied state useClipboard (#6585)
  [RR7] Update to latest RR7 and conventions, fix index page (#6589)
  Release 18.6.0
  Release @plone/slate 18.1.0
  Revert "added swedish translation" (#6578)
  Slate Italian translations (#6563)
  Release 18.5.0
  Fix robots.txt in devmode (#6571)
  added swedish translation (#6557)
  Depth search issue (#6558)
  Block examples documentation (#6560)
  Fixed folder contents issues with persistent selection (#6554)
  Fix redirects to MDN responsive images (#6552)
  Bugfix remove query string inclusion in body class generation logic (#6547)
  ...
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.

3 participants