-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
ref(onboarding): Introduce content blocks #95224
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
base: master
Are you sure you want to change the base?
ref(onboarding): Introduce content blocks #95224
Conversation
const partialLoading = useMemo( | ||
() => children.includes(PACKAGE_LOADING_PLACEHOLDER), | ||
[children] | ||
); |
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.
Previously we had a separate prop partiallyLoading
on the configuration object, which was missing most of the time. I decided to drop it from the new format and rather autodetect the loading placeholder in the snippet. This solution is maybe a bit hacky but is much better DX when writing docs.
* | ||
* **Do not** use this with custom react elements but instead use the `custom` block type. | ||
*/ | ||
text: React.ReactNode; |
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.
Would love to only have string
here. Also the translation functions are making the docs so much harder to read...
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #95224 +/- ##
=======================================
Coverage 87.84% 87.85%
=======================================
Files 10469 10469
Lines 605374 605361 -13
Branches 23674 23672 -2
=======================================
- Hits 531819 531814 -5
+ Misses 73195 73187 -8
Partials 360 360 |
export type ContentBlock = | ||
| TextBlock | ||
| CodeBlock | ||
| CustomBlock | ||
| AlertBlock | ||
| ConditionalBlock; |
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 just added the most basic ones that I encountered while converting java & react docs.
In the future we will for sure add more like heading
, list
, ...
type: 'custom', | ||
content: ( | ||
<OnboardingCodeSnippet | ||
language="bash" | ||
onCopy={() => |
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.
onCopy
and onSelectAndCopy
was only supported for this one usage. Decided to resort to a custom block instead of bloating the interface.
Introduce specialized content blocks opposed to the current configuration object.
This makes it clearer what is rendered in which order and which properties are required -> enforced by types.
Converted react and java project creation onboarding docs.