Skip to content
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

Angular/out of context docs rendering stories #15002

Conversation

ThibaudAV
Copy link
Contributor

@ThibaudAV ThibaudAV commented May 21, 2021

Issue:

Angular part after this : #14911

What I did

TODO 🙈

Sorry about refactoring. 😈
But to many case to handle like navigate between canvas and docs view or some particularities on each one need to use some patten to try to have clean code and not many function intertwined.
I hope it's better

How to test

  • Is this testable with Jest or Chromatic screenshots? Yes
  • Does this need a new example in the kitchen sink apps? na
  • Does this need an update to the documentation? na

@nx-cloud
Copy link

nx-cloud bot commented May 21, 2021

Nx Cloud Report

We didn't find any information for the current pull request with the commit dc6cf48.
Please make sure you set the \ NX_BRANCH\ environment variable in your CI pipeline .

Check the Getting started section to configure the app.


Sent with 💌 from NxCloud.

BREAKING CHANGE
@angular/elements and @webcomponents/custom-elements are now required as dependencies for angular app
@ThibaudAV ThibaudAV force-pushed the angular/out-of-context-docs-rendering-stories branch from 6818fb1 to f28c88e Compare May 21, 2021 16:00
@ThibaudAV ThibaudAV force-pushed the angular/out-of-context-docs-rendering-stories branch 2 times, most recently from 693da9b to 6e6ce8c Compare May 24, 2021 18:43
@ThibaudAV ThibaudAV changed the base branch from next to tech/out-of-context-docs-rendering-stories May 25, 2021 09:24
@ndelangen
Copy link
Member

Thank you so much @ThibaudAV 🙇🙇🙇

Rework the renderer to have 2 renderers : CanvasRenderer and DocsRenderer
The RendererService becomes deprecated with the ElementRendererService and can be removed soon
@ThibaudAV ThibaudAV force-pushed the angular/out-of-context-docs-rendering-stories branch from 6e6ce8c to 9dda9a5 Compare May 28, 2021 08:09
@github-actions
Copy link
Contributor

github-actions bot commented May 28, 2021

Fails
🚫

PR is not labeled with one of: ["cleanup","BREAKING CHANGE","feature request","bug","documentation","maintenance","dependencies","other"]

Generated by 🚫 dangerJS against dc6cf48

Copy link
Member

@kroeder kroeder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 👏 👏

I love the idea of an abstract renderer, great job

{
storyFnAngular: currentStory,
parameters: story.parameters,
// TODO : To change with the story Id in v7. Currently keep with static id to avoid changes in snapshots
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add an issue and link as TODO?
In my experience "TODO:" always get lost without an issue (that is taggable als 'do in v7' or something)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really know what to do. I don't use storyshots enough. So for me there is no real issue
Is it better to have shapshot with storybook-wrapper main div or with story id 🤷‍♂️

I can also change to a simple comment

};

// platform must be init only if render is called at least once
let platformRef: PlatformRef;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be _platformRef instead so devs won't tend to use this variable instead of getPlatform?
Highly opinionated code suggestion 😄 I don't mind if you leave it as is

To me _name always feels like "don't touch this, use something else"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's the idea don't touch this, use something else :p

I haven't found a clean way to make the new platformRef

but to avoid mistakes with storyshots the platformBrowserDynamic must be call only if the render is called at least once.

I thought of doing it in the factory to give it to all Renderer instance but it was more code, not much clearer so I hid it here 😈
But I take all your ideas :)

"@angular/cli": "^11.2.0",
"@angular/compiler-cli": "^11.2.0",
"@angular/elements": "^11.2.0",
"@angular-devkit/build-angular": "~0.1102.13",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In dependencies, you have installed 11.2.14 and here you install 11.2.13

@stale
Copy link

stale bot commented Jan 9, 2022

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Jan 9, 2022
@shilman
Copy link
Member

shilman commented Jan 13, 2022

Closing this as the original PR has also been canceled. If you think there are useful things to be extracted from this PR, please feel free to create a new PR in the current setup. Thanks so much for your work on this! 🙏

@shilman shilman closed this Jan 13, 2022
@stof stof deleted the angular/out-of-context-docs-rendering-stories branch May 25, 2022 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants