React Router as new stack for Storefront
Create a new app under apps/www
Add www.designsystemet.no frontpage, a guidelines site and maybe a blog article?
Add support for mdx
Some notes: Would be ideal if we can use react router with framework or data. This makes it possible to use loaders, which might be nice if we can render the MDX on server instead of client.
i18n: All content in norwegian and english URLs will always be english, the first / chooses language:
- /no/fundamentals/hello
- /en/fundamentals/hello
Update:
We had some problems publishing on Vercel, this problem was not related to react router. The vercel preset generated the wrong build-result file vercel needs.
I have set up the app with i18n and basic routing. For most of the app we route using files in /app/content. This works really well, and we prerender all the pages before we publish the app.
Content editors now only need to worry about one file, instead of having to update multiple.
In our nextjs app when adding a blog post you needed to update at least 3 files. Index, /bloggen and the actual blog page.
In the set up we use in RR, this is not needed, and when a new blog post is added, it is displayed where it is needed, using the date from frontmatter to do so.
Frontmatter is great now that we want content to be consumed from only content files. We can add anything we want, and can also hook that into displaying content, for example published: true/false.
In my opinion, using RR7 where we are not locked into using a specific routing pattern and having decisions taken for us, is much better than using nextjs. I have not yet ran into problems with RR7, and it better aligns with how I envision our storefront setup to look like.
As of today, april 29, this is what I think we are missing:
- Better language switcher (potentially a more cleaned up header without figma and github?)
- Check metadata on all pages
- Generate a sitemap (needs to be done manually, but we can do this while prerendering pages potentially)
- Proofread all english articles
- Fix styling descrepancies (icons mostly missing
font-size) - General cleanup
-
TokenList@mimarz has said he will do this
We might not need a sitemap: https://developers.google.com/search/docs/crawling-indexing/sitemaps/overview#do-i-need-a-sitemap
I'll omit doing it until we deem it important.
After PR #3514, we are missing:
- Proofreading on english articles, @mrosvik will do most of the pages
We have decided to not include TokenList for now, with @mimarz creating a new and more refined one later in May.
Edit: Issue: #3569