-
-
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
Addon-docs: Angular inline rendering support #8153
Comments
Would like to keep this open. Contribution is still pending the referenced issue above. |
@shilman Finally had a chance to look into this a bit more. Hoping I can get some feedback/guidance from you. The problem I see with using Angular Elements here is that creating an Angular Element requires more than simply defining an Angular Component and calling a function from Storybook to turn it to an Element. The Component needs to be declared in an app ngModule and have an app component which calls Angular's |
@bmayen I haven't dug into Storybook's codebase at all, but my company is using Storybook to develop a component library for Angular and I would be extremely interested in this feature for a lot of reasons. Is there anything I might be able to do to help you out here? |
Second this. Inline rendering for Angular would be ideal here rather than those ancient old slow rendering iframes. ;o) |
Looks like this might be the way forward for Angular inline rendering support: #3889 (comment) Any takers? cc @petermikitsh |
Removed my assignment as it sounds like we're looking in another direction now |
@bmayen any insight on that new direction to share please? |
@bmayen oh nice! didn't realize, thanks! |
This is definitely something I'd like to see happen! @shilman I'm interested to take it so that it goes forward (or even if it's not forward, at least it'll move 😄 ) Since it'd be my first contribution, I'd definitely enjoy having someone to help there. 👍 |
@costalvaro thanks so much for taking this on! 💯 i'd be happy to help you out with the |
Hi folks! While testing how to inline Angular components, I'v hit 2 main issues.
A demo is stronger than any word : https://stackblitz.com/edit/angular-to-react In a nutshell : Angular in React works for a single component, but atm won't for multiple occurences.
While my draft was an honorable way to get started, it simply pinpointed where an integration should be done.. without being even close to working. From my current understanding, this whole logic happens while displaying iframe.html so that the core is agnostic of any frameworks. In a nutshell : In it's current form, prepareForInline could integrate components that don't have any dependencies. @shilman Any hint about how to progress form this point on ? (Btw sorry if I'm being a captain obvious in some parts of my message, I'm just expressing what I understood from parsing the code in case it helps someone catching on 😄 ) |
@costalvaro awesome that you've been able to push this forward! re: angular and ID's, i don't have a good sense for that and will let an angular user respond re: the storybook side, i get it and have a couple thoughts on that.
also cc @kroeder and @stupidawesome who might have thoughts on this |
@costalvaro For the first point, I was able to modify the bootstrap process in your demo and make all three render. Instead of using the The reason I manually bootstrapped it was to customize the selector, by adding a "hopefully" unique attribute to the element by incrementing a counter each time I create one and using an attribute selector for the bootstrapping. I used an attribute, because I assume that would have the least chance of conflicting. |
@Marklb This is an amazing contribution! @shilman Thanks for the insights! FYI I'm being quite busy these days, so the issue is moving slower than I'd like.
|
Has this an impact on #2962 (comment)? |
@manuelmeister It could potentially be for that in docs maybe, but I don't think they are really related. That issue is about decorators, but this is mainly about rendering the stories in the same document. Currently an Angular story is rendered in an iframe, sort of like each story is it's own embeded app. For some stories that is great, but for others it is unnecessary and just causes a docs page to render slow when there are multiple iframes bootstrapping Angular. |
Great Caesar's ghost!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.2.0-alpha.19 containing PR #13525 that references this issue. Upgrade today to the
Closing this issue. Please re-open if you think there's still more to do. |
Hurrah!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.2.0-rc.3 containing PR #14270 that references this issue. Upgrade today to the
|
Some great work has been done in #7929 to to support inline rendering for Vue. This PR additionally paves the way for other framework support via
prepareForInline
. As is suggested in the docs in that PR, this could be implemented for Angular by wrapping Angular components as Angular Elements.Are you able to assist bring the feature to reality?
Once #7929 is merged and
prepareForInline
is available, I should be able to get a PR in for this.The text was updated successfully, but these errors were encountered: