-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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: Deprecate the story component attribute #13383
Angular: Deprecate the story component attribute #13383
Conversation
70a8166
to
5210e22
Compare
app/angular/src/client/preview/angular-beta/RenderNgAppService.ts
Outdated
Show resolved
Hide resolved
@shilman I'm not sure what to put in MIGRATION.md 🤷♂️ Can I let you do it? some comments :
|
499b74e
to
a6a833a
Compare
@@ -7,35 +7,35 @@ import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/t | |||
// eslint-disable-next-line import/no-extraneous-dependencies | |||
import { NO_ERRORS_SCHEMA } from '@angular/core'; | |||
import { addSerializer } from 'jest-specific-snapshot'; | |||
import { initModuleData } from './helpers'; | |||
import { RenderNgAppService } from '@storybook/angular/dist/client/preview/angular-beta/RenderNgAppService'; |
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.
Avoids redefining the rendering like before.
if you have a (simple) idea to avoid the /dist/
tell me :)
a6a833a
to
a28d590
Compare
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.
This is so awesome @ThibaudAV 💯 Thanks for pushing it forward.
I wrote a MIGRATION and added a couple comments to the PR including one change request.
Would be great to get more @storybookjs/angular eyes on it to critique from an Angular standpoint. From a CSF standpoint it looks like a big improvement to me. I also appreciate the example cleanup.
One more thing, can we leave around an "old-style" story as a test case, if there's not one already? Or create one?
app/angular/src/client/preview/angular-beta/RenderNgAppService.ts
Outdated
Show resolved
Hide resolved
ignore class like doc-injectable example
08e8a7a
to
0f55784
Compare
@ThibaudAV I think we can sneak in a breaking change if that's necessary and force users to regenerate their snapshots. But I don't understand why that's needed and would certainly prefer to avoid it if it's not too much work. |
@shilman To generate the snapshot storyshot needs some information built by the "render". If we continue with the same code as before the new internal storybook functionality will not work with storyshot anymore. and this will make the storyshot completely legacy. :/ To prevent snapshots from changing due to internal storybook modifications🤞 What do you think about adding also a message in MIGRATION to inform that storyshot is improving to contain fewer internal storybook properties? And that it will be necessary to regenerate them 🙈 but it's for a good reason I have a little talk with @gaetanmaisse who will surely be able to complete some information I don't know if it's reassuring or not but when angular or angular-material changes minor version and you have test snapshot on your project it's not uncommon to have to regenerate them. In any case, I thank you for accompanying me in these changes, it is very nice to have your opinion. 😌 |
Generates snapshots that will change less if the internal stroybook properties change
bf3a014
to
901759a
Compare
I think the final result we have for story snapshots is a huge improvement because:
So the remaining question is: are we ok to ask SB users to update all their snapshots when updating to 6.2? Or must we wait for 7.0 to do any change in I would prefer to merge and release this in 6.2 as it's part of major improvements of SB for Angular 🤷🏻 |
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.
The code LGTM, if we agree on making this land in 6.2 we have to add a section about snapshots update in MIGRATION.md
@ThibaudAV @gaetanmaisse thanks for getting this over the line. I've updated the MIGRATION instructions as I understand them:
I'm OK with this compromise, but since this is a breaking change in a minor release I'm going to give the rest of the maintainers a day or two to chime in before merging. |
Co-authored-by: Manuel Meister <[email protected]>
# Conflicts: # MIGRATION.md
app/angular/src/client/index.ts
Outdated
@@ -9,6 +9,8 @@ export { | |||
raw, | |||
} from './preview'; | |||
|
|||
export { RenderNgAppService } from './preview/angular-beta/RenderNgAppService'; |
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 hadn't dared to export this service in the public index. ^^
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'm not sure this is the right way. However, we recently introduced ESM into the codebase and it broke things: #13013. If there's a less aggressive way to do it, I'm also open to that!
@@ -5,7 +5,7 @@ import { TestBed } from '@angular/core/testing'; | |||
// eslint-disable-next-line import/no-extraneous-dependencies | |||
import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing'; | |||
import { addSerializer } from 'jest-specific-snapshot'; | |||
import { RenderNgAppService } from '@storybook/angular'; | |||
import { RenderNgAppService } from '@storybook/angular/renderer'; |
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.
@ThibaudAV trying this as something less aggressive 😄
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.
yes but I can see that it doesn't seem simple 💪 . Tell me if you need help with this PR
@ThibaudAV I think this is ready to merge. WDYT? |
@shilman 🤞 yes |
cc @mandarini |
Issue: #8673
TODO :
What I did
How to test
If your answer is yes to any of these, please make sure to include it in your PR.