Resolve #3459235 POC "React router"
Closes #3459235
POC of how I would like to implement React Router to put in place the architecture for handling tying UI state/views to the URL route.
At the moment it ties the route param of componentID to the selectedComponent in the UI slice. Updating the state will update the URL and updating the URL will update the state. I am unsure if this is wise - or if a better approach would be a single source of truth in the URL and remove the selected component from the state altogether.
While this PoC is very basic as there is very little to the XB app so far, I think React Router provides a robust, scalable solution for navigation and view management. What I hope to enable with this architecture, in the future, is the ability for us to easily scale the XB app to have more views, different settings pages, navigation between editing components and pages and templates etc. In addition it will allows users to navigate using URLs by copy and pasting the URL to other people they are collaborating with - just as they might expect to do with a backend application (hey Jane, please take a look at www.foo.com/admin/node/1/edit and review the copy)
Merge request reports
Activity
added 18 commits
-
7ce44197...b987c31e - 16 commits from branch
project:0.x
- bf8f2a8a - Merge branch '0.x' into 3459235-react-router
- 963756c3 - Migrate router from components to code/config. Implemented POC of loading...
-
7ce44197...b987c31e - 16 commits from branch
added 5 commits
-
963756c3...f1cf2f77 - 4 commits from branch
project:0.x
- 13a31103 - Merge branch '0.x' into 3459235-react-router
-
963756c3...f1cf2f77 - 4 commits from branch
added 2 commits
added 1 commit
- 48ee1d7e - removed lefter php change that I didnt make in the end
added 1 commit
- a5e11e39 - update tests to reflect the new container for the contextual form
added 1 commit
- fdb3d5ba - update tests and use drupalSettings for router base URL
- Resolved by Ben Mullins
- Resolved by Ben Mullins
- Resolved by Ben Mullins
added 4 commits
-
2add475f...0202b5b5 - 2 commits from branch
project:0.x
- 62edfe12 - merge with 0.x
- f235cc4c - Merge branch '3459235-react-router' of...
-
2add475f...0202b5b5 - 2 commits from branch
added 1 commit
- e71d05d1 - linting and better messages to help explain WTH back button does not seem to work on Gitlab CI
added 3 commits
-
30dbb90a...a7536ec2 - 2 commits from branch
project:0.x
- 7b73617a - merge 0.x
-
30dbb90a...a7536ec2 - 2 commits from branch
25 27 </html> 26 28 HTML; 27 29 28 public function content() : HtmlResponse { 30 public function content(string|null $react_route = NULL, string|null $react_subroute = NULL) : HtmlResponse|RedirectResponse { 31 if (!empty($react_route)) { 32 // Temporary measure so refreshing a page with a component selected does 33 // not result in a 404. - Comment on lines +32 to +33
32 // Temporary measure so refreshing a page with a component selected does 33 // not result in a 404. 32 // Temporary measure so refreshing a page with a component selected does 33 // not result in a 404. 34 // @todo Investigate how https://www.drupal.org/project/decoupled_pages solved this same problem. I wonder why we didn't use the Hash router - feels like it would have been the better option
added 1 commit
- bdaa0d35 - Add `@todo` to make connection of this problem with...
added 7 commits
-
bdaa0d35...9540e1ee - 6 commits from branch
project:0.x
- 843639a2 - whoa that was a reroll wasn't it
-
bdaa0d35...9540e1ee - 6 commits from branch
added 5 commits
-
843639a2...7047b8a8 - 2 commits from branch
project:0.x
- 35402054 - no unused
- 2ed217d1 - no unneeded changes
- 670bf1e3 - zero again
Toggle commit list-
843639a2...7047b8a8 - 2 commits from branch
- Resolved by Harumi Jang
mentioned in merge request !84 (closed)