-
-
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
Addons and app changes for on demand store #16010
Addons and app changes for on demand store #16010
Conversation
@ThibaudAV there were a few more changes to Angular that you might want to take a look at. |
Nx Cloud ReportWe didn't find any information for the current pull request with the commit e29268c. Check the Nx Cloud Github Integration documentation for more information. Sent with 💌 from NxCloud. |
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.
Looking good! 🚀
forceRender, | ||
}: RenderContext) { | ||
const Story = unboundStoryFn as FunctionComponent<StoryContext>; | ||
export async function renderToDOM( |
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.
let's convert these to named exports 🙏
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.
That's coming
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.
|
||
export type Parameters = DefaultParameters & { | ||
/** Uses legacy angular rendering engine that use dynamic component */ | ||
angularLegacyRendering?: boolean; | ||
component: unknown; |
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.
why delete this type?
it allows to force the component of a story if the one defined in export default is not the one wanted
ex :
Line 13 in 8fe441d
component: MultipleSelectorComponent, |
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.
it seemed to me that the component
property in the story should be deprecated 🤔
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.
@shilman perhaps you care to respond to this one -- the rationale is that this method of overriding the component
was an implementation detail, and can be considered a bug.
@@ -45,7 +44,7 @@ export const getStorybookModuleMetadata = ( | |||
if (storyComponent) { | |||
deprecatedStoryComponentWarning(); | |||
} | |||
const component = storyComponent ?? parameters.component; | |||
const component = storyComponent ?? annotatedComponent; |
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 will be create braking change. i think
because before, to have a specific component for a story, you had to pass it through the parameters
Now if I understand correctly we can make a :
export const Primary: Story = () => ({});
Primary.component = AppComponent;
maybe add a message in the MIGRATION.md
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.
a big job 👏 👏 👏 .
there are a lot of changes. which version is it for?
It's for 6.4. There aren't intended to be any functional changes for the angular layer, mostly it is just due to updating types. Do you see any other changes that concern you (barring the |
Here is my understanding of the situation:
Given all that: Assuming it's OK to restrict If that is too restrictive, we can un-deprecate it. Or we can discuss other options. @ThibaudAV Please let me know if that all makes sense. I don't understand enough about the Angular use case, so let's please discuss here! 🙏 |
targetDOMNode, | ||
}: { | ||
storyFnAngular: StoryFnAngularReturnType; | ||
forced: boolean; | ||
component?: any; |
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 would tend to say that the correct ts type for the reference to an angular component class is :
Type
I'm not sure of myself. but it can avoid any
and show that we are referring to an angular component
🙃
mainStoryFn: StoryFn<StoryFnAngularReturnType>, | ||
decorators: DecoratorFunction<StoryFnAngularReturnType>[] | ||
): StoryFn<StoryFnAngularReturnType> { | ||
mainStoryFn: LegacyStoryFn<AngularFramework>, |
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.
how to get rid of the LegacyStoryFn ? ( in the future )
it's not the same type as ProjectAnnotations<...>['applyDecorators'];
or PartialStoryFn<AngularFramework>,
only for my personal understanding 😄 🙏
@shilman Ok. Thank you for the summary
I think it's good, it forces to have coherent stories. 🤷♂️ I'm thinking of some improvements on this or to be able to add to this same template only an inner template (
Nope 🚀 |
Merged as part of #15871 |
@ThibaudAV Can you please help me on how to use I am only finding examples of usage in React .. |
@shilman I think the codemod for |
Good call @manuelmeister opening an issue for that |
Part of #15871
Telescoping on #16009
What I did
Updated addons + apps for on-demand store. Mostly updating types