Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix missing default component theme block in functional component doc pages #1920

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

HerrTopi
Copy link
Contributor

TEST_PLAN: Check Avatar (the only functional component at the moment) if it has the proper default themes block on it's docs page. Also check couple of others to check if they still have it

Closes: INSTUI-4493

@HerrTopi HerrTopi requested review from matyasf and balzss March 27, 2025 16:43
Copy link

PR Preview Action v1.6.0

🚀 View preview at
https://instructure.design/pr-preview/pr-1920/

Built to branch gh-pages at 2025-03-27 16:48 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@@ -33,6 +33,7 @@ import { SourceCodeEditor } from '@instructure/ui-source-code-editor'
import { withStyle, jsx } from '@instructure/emotion'

import generateStyle from './styles'
import functionalComponentThemes from './functionalComponentThemes.ts'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get a TS error in this line because the path has an extension

Comment on lines +27 to +30
avatar: async (theme) =>
(
await import('../../../../packages/ui-avatar/src/Avatar/theme.ts')
).default(theme)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could't we figure out the path from thge component ID? something like '../../../../packages/ui-${name}/src/${name.upper()}/theme.ts'.

I really don't like these 'enumerator' files, it's harder and harder to keep track on what is needed to have a working documentation. If its really needed could you put it into the root of the docs folder?

Also it would be great it we would see at least a console error if this thing is missing but should be there, but afaik this is not possible

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately you can not use stuff that is not defined build time. aka: you can't use variables in these async imports because it will only know its value in runtime, which is too late already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants