-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
chore(gatsby): convert build-html to typescript #20535
Conversation
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.
Great stuff. My request is to combine the regexes. Otherwise it's mostly questions.
const buildRenderer = async ( | ||
program: IProgram, | ||
stage: BuildHTMLStage, | ||
parentSpan: IActivity |
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.
parentSpan
is destructured in the previous code. Was that a mistake? It does seem a bit odd to destructure it then immediately recreate the object below.
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.
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.
Approving with a couple of suggestions
nodes?: any // TODO | ||
nodesByType: Map<any, any> // TODO | ||
status: ProgramStatus | ||
nodes?: { |
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.
If you extract this into an interface, you can then easily type nodesByType below
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.
sounds great, i'll follow that up in a future PR. I didn't fully understand yet what nodesByType
was
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.
lgtm
Converts
commands/build-html
to typescript. Also moves some shared types in the commands folder into a relative/types
folder. There is likely a use-case to move the shared types even further up, but I'm thinking we'll wait until that structure becomes more obvious