docs: add multi-version support and rebrand theme handling#2425
Conversation
|
0476a3e to
1a36846
Compare
a1d236b to
8a0ec21
Compare
matyasf
left a comment
There was a problem hiding this comment.
- There is something off with theme variables for subcomponents, e.g. check Table or Menu
- When I switch to v11.7 and reload the page I see v11.6. Would it be difficult to include in the URL the version I'm viewing?
- Do not show the rebrand themes in the dropdown when its not
?beta(a hacky temp solution is OK) - We should either add to the themes docs e.g.g
/rebrand-darkthat these are only from 11.7 or not show them for 11.6
|
|
||
| if (!fs.existsSync(exportFilePath)) { | ||
| // eslint-disable-next-line no-console | ||
| console.warn( |
There was a problem hiding this comment.
Shouldn't we throw an error in this case? as I understand this means, that the package.json specifies an export that does not exist
|
How do I switch back from beta mode, only with page reload? |
yes |
| pnpm run generate:component-overrides | ||
| ``` | ||
|
|
||
| ## Adding a new library version (e.g. v11_23) |
There was a problem hiding this comment.
I like the documentation and how you addressed all the use cases, nice work
| // triggered by the new docs uses the correct component references | ||
| updateGlobalsForVersion(newVersion) | ||
|
|
||
| // Clear current data to show loading screen, update selected version |
There was a problem hiding this comment.
Shouldn't state clearing come before calling updateGlobalsForVersion()? Could this cause any side effects?
There was a problem hiding this comment.
the comment makes it a bit misleading, order doesn't really matter here. will update the comment
packages/__docs__/src/versionData.ts
Outdated
| return undefined | ||
| } | ||
|
|
||
| type MinorVersionData = { |
There was a problem hiding this comment.
Just being nitpicky: a better place for this might be DataType.mts.
There was a problem hiding this comment.
my reasoning was that this is used runtime and DataType.mts contains build time code, but that separation is already a bit blurry in the current way we use the docs app so I'll move it there for simplicity's sake
0be86da to
b6b52d0
Compare
31bfd5d to
640bf73
Compare
640bf73 to
ff8efad
Compare
matyasf
left a comment
There was a problem hiding this comment.
looks good! Some smaller changes, see my comments
- for me its a bit confusing that we're displaying now the same info at
/and/v11_6/. Maybe route the oldest version to/and the others should have/vXYURLs? - We will have to do something with docs pages that change with minor version, e.g.
/using-theme-overrides-- this should be a different doc for v11.6 and v11.7, but this can be in a new PR
| const allThemeKeys = Object.keys(this.state.docsData!.themes) | ||
| const showRebrandThemes = | ||
| this.state.showMinorVersionSelector && | ||
| this.state.selectedMinorVersion !== 'v11_6' |
There was a problem hiding this comment.
This feels very hardcoded, I hope in the future it wont cause issues
There was a problem hiding this comment.
well, the fact that 11.6 has the old themes, and 11.7 has the new themes shouldn't change in the future so it feels strange but i think this is the correct way to do this. maybe a comment here would be nice to explain it
ff8efad to
221140d
Compare
|
matyasf
left a comment
There was a problem hiding this comment.
Very nice work!
Just 2 small issues from me
221140d to
1c1bbb2
Compare
HerrTopi
left a comment
There was a problem hiding this comment.
The comment I left will be handled later, in https://instructure.atlassian.net/browse/INSTUI-4950
There was a problem hiding this comment.
Could we generate/update this file during bump? I don't like to remember manual steps upon releases
INSTUI-4917
INSTUI-4918
Summary
/v11_7/Buttoninstead of/#Button). Added support for PR preview path prefixes (/pr-preview/pr-XXXX/).generate-component-overridesscript and auto-generatedcomponent-overrides.ts. Components are now imported directly based on package.json exports.Calendar.Day).publicPathdynamically for PR preview builds so assets load from the correct subdirectory on GitHub Pages. Prefixed all data fetch paths with the PR preview base path.Test plan
pnpm run bootstrap— builds cleanlypnpm run dev, open http://localhost:9090pnpm run build:docs— verify__build__/docs-versions.jsonand per-version subdirectories exist