-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
refactor(types): split into multiple files #7710
Conversation
// TODO improve type (not exposed by postcss-loader) | ||
export type PostCssOptions = {plugins: unknown[]; [key: string]: unknown}; | ||
|
||
type HtmlTagObject = { |
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.
not sure why: this type was not exported from this package and yet it was imported successfully in Docusaurus core 🤷♂️
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.
Because this is a d.ts file with no value export, so it's still ambient. We can fix this by adding an export {}
.
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.
Ah I see 😅
Not very familar with those TS rules and value exports, where is this documented? Should we add export {}
to all those .d.ts
files?
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.
This is the only file where we have a hand-written d.ts that's not ambient module declarations, AFAICT.
Last time I looked for it, there was no docs, only one GH issue. On my phone atm; I can share the link later.
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.
✅ [V2]
To edit notification comments on pull requests, go to your Netlify site settings. |
⚡️ Lighthouse report for the deploy preview of this PR
|
Size Change: 0 B Total Size: 802 kB ℹ️ View Unchanged
|
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.
Last time I tried to split it, I couldn't convince myself of any kind of splitting because all types are interconnected. I think this is good enough.
Pre-flight checklist
Motivation
Split our
@docusaurus/types
to separate into it subdomains, making the list of exports and the dependency between subdomains clearer.No type was refactored, it is just a split and the public API of this package remains the same as before.
Test Plan
CI