-
Notifications
You must be signed in to change notification settings - Fork 36
DOP-5744: TS - Chapters
#1467
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
DOP-5744: TS - Chapters
#1467
Conversation
✅ Deploy Preview for docs-frontend-stg ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Is there an existing staging link for this? If not, I can try to test locally!
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.
Looks good! Left some small questions/comments
const children = isString(data['description']) | ||
? ([{ type: 'text', value: data['description'] }] as TextNode[]) | ||
: data['description']; | ||
|
||
return { | ||
type: 'directive', | ||
name: 'card', | ||
children: data['description'], | ||
children, | ||
argument: [], |
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.
Just curious, but this was typescript showing us a potential issue here?
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! We've typed data.description as string | ASTNode[]
but children has to be ASTNode[]
- so we just have to make sure that if a string is the value it's turned into a TextNode
.
🔄 Deploy Preview for docs-frontend-stg processing
|
Stories/Links:
DOP-5744
Current Behavior:
Put a link to current staging or production behavior, if applicable
Staging Links:
Put a link to your staging environment(s), if applicable
Notes:
Typescriptify Chapters components.
Also, creates the
ASTNode
type.README updates