-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
change docs to render stories out of context #14911
Conversation
fire an async event to render into placeholder removes need for prepareForInline and brings inline rendering of docs to all frameworks
Nx Cloud ReportCI ran the following commands for commit cdf70bd. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch
Sent with 💌 from NxCloud. |
This does require a change in all framework's renderers. so the ones we just extracted out (@shilman) might need a patch, if we decide that's worth it. |
🤯 this is awesome @ndelangen 🤯 |
… it when the story is about to get rendered into it This is much better then trying to replace-render in every framework.
@tooppaaa @gaetanmaisse @ThibaudAV |
When there is a navigation between two stroy of the same "stories" on the docs page all stories is loaded twice. I think it's a bug. You can see it with the logs. Do you think it is related to these changes? |
const storyFn = () => unboundStoryFn(storyContext); | ||
|
||
if (targetDOMNode.querySelector('[data-is-loadering-indicator="true"')) { | ||
targetDOMNode.querySelector('[data-is-loadering-indicator="true"').remove(); |
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.
for angular it forces the full rendering every time. 🤔
which differs from the canvas rendering which is optimized when only the args change
@ThibaudAV What can we do with this PR versus this PR: #15002 and what has recently been happening on next? |
if this is still intended to be taken for the next version. once rebase I would do the same for the one with angular (which will be greatly reduced ^^) and I would test it still works properly |
When we have a solution that works across the board we can assess if this is truly a breaking change or not. If it is, it's a 7.0 feature. We're not targeting 6.3. rather 6.4 or 7.0. |
There will be a 6.4 |
as you like ;) I'm pretty confident that it will work for angular with this PR |
Double check for feature flags if they aren't there then we need to add them and it should be off by default. Double check this works with Angular. |
I genericized feature flagging here: #15375 |
…'s `renderToDOM` Replaces #14911
What is the latest on this PR? |
Thanks @ndelangen, closing this! |
Issue: #13145 #13277 #10817 #8601 #12726 #14447 #14333 #13074
What I did
I've overhauled the way we render stories inline.
I've removed the need for prepareForInline:
When docs encounters a story it needs to render inline, it creates div element with a unique id on it.
Then it emits an event triggering the framework's renderer to render a story unto the targetted div.
How to test
I'm likely missing some features, this is a POC / draft after all!
Known issues:
I do not know how bad this is, I assume memory leaks