Page MenuHomeElementl

[docs] Custom Versioning
ClosedPublic

Authored by sashank on Feb 4 2021, 1:48 AM.

Details

Summary

Because Next is not letting us use periods in the locales, this diff implements custom versioning. This is for the best anyway, because using internationalization for versioning was very much a hack and we don't know how it can break down the line.

Test Plan

manual

Diff Detail

Repository
R1 dagster
Branch
versioning
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

sashank added a reviewer: yuhan.
docs/next/next.config.js
13–18

Not using internationalization anymore

docs/next/pages/[...page].tsx
142

Since we are doing custom versioning now, we can't use the _apidocs/[...page].tsx file separately, because routes like /0.9.19/_apidocs/abc would not match. Therefore, we have this catchall route take care of _everything_ and render data appropriately.

docs/next/util/useVersion.ts
60

This file has all the magic. It implements a hook (which is a wrapper around useRouter) that allows us to extract the version page and return the rest of the path to use in other parts of the site.

thanks! yea i think moving the logic off of locales is a good call!

This revision is now accepted and ready to land.Feb 4 2021, 6:27 AM
This revision was automatically updated to reflect the committed changes.