-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
Improve docs dev server performance #1297
Conversation
Hmm weird that |
should be working now |
Tab, | ||
SyntaxTabs, | ||
SyntaxTab, | ||
...(await import("../../../components/AutoplayDemo.tsx")), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oof. In the future do you think there will be some way to do this that's less fragile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about Organise everything to a single mdx.tsx file and we export all MDX components there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That part doesn't matter to me a ton. I guess what I'm hoping for eventually would be when I create a new component, it would be automatically available.
Could add some kind of file watcher or something and try to handle it, but for now this is fine as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And if you're using the approach mentioned above, MDX components are automatically available once you exported them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if eventually there would be some way to hook into Next's file watching process or something and handles those exports in the background in .source
.
For now this is fine though, excited to give it a shot!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep that's great.
The experience you're looking for feels like Nuxt.js's components folder? I think that's possible by auto-generating an index.ts file to auto re-export all files in the directory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah exactly. I haven't messed around much with full-stack frameworks but that sounds like what I was hoping for.
Not sure if you noticed but I actually hackily implemented something kind of similar to generate TS snippets: https://github.com/arktypeio/arktype/blob/main/ark/docs/lib/writeSnippetsEntrypoint.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for taking the time to do this upgrade! I had no idea about the imports in Page.
Still feels a bit janky to enumerate all those, but it's nice they're not needed in MDX I suppose. Also of course anything that improves the perf would be very welcome 😊
Just wanted feedback on a couple small things and will be good to merge!
enableSystem: false, | ||
defaultTheme: "dark" | ||
enabled: false, | ||
enableSystem: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this still be dark by default? I don't have light colors configured so the goal here was to make sure they wouldn't render.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The exact purpose here is to disable next-themes and ensure it's always dark mode
@@ -3,10 +3,6 @@ title: Announcing ArkType 2.0 | |||
description: 100x faster validation with DX that will blow your mind | |||
--- | |||
|
|||
import { MainAutoplayDemo } from "../../../components/AutoplayDemo.tsx" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay so essentially because we list these imports in page.tsx, the names are available by default and don't have to be imported anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
What's Done
async
modepage.tsx
and pass down via MDX componentsnext-themes
configuration, disable it entirely and always use dark mode