designsystemet icon indicating copy to clipboard operation
designsystemet copied to clipboard

React Router as new stack for Storefront

Open mimarz opened this issue 9 months ago • 7 comments

Create a new app under apps/www

Add www.designsystemet.no frontpage, a guidelines site and maybe a blog article?

Add support for mdx

mimarz avatar Mar 19 '25 14:03 mimarz

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.

Barsnes avatar Mar 31 '25 12:03 Barsnes

i18n: All content in norwegian and english URLs will always be english, the first / chooses language:

  • /no/fundamentals/hello
  • /en/fundamentals/hello

Barsnes avatar Apr 24 '25 08:04 Barsnes

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.

Barsnes avatar Apr 25 '25 06:04 Barsnes

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

Barsnes avatar Apr 29 '25 06:04 Barsnes

  • TokenList @mimarz has said he will do this

This will be done as part of #2946

mimarz avatar Apr 29 '25 06:04 mimarz

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.

Barsnes avatar Apr 30 '25 10:04 Barsnes

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

Barsnes avatar May 06 '25 09:05 Barsnes