-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Foundation: Evolve API #9072
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
Foundation: Evolve API #9072
Conversation
|
Component perf results:
|
| const { factoryOptions = {} } = component; | ||
| const { factoryOptions = {} } = options; | ||
| const { defaultProp } = factoryOptions; | ||
| const displayName = (options && options.displayName) || view.name; |
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.
Something about this feels weird to me. The fact that the customization can come from either displayName or view.name confuses me a bit, especially because I don't actually see view.name as an explicit property of IViewComponent.
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.
name is a JavaScript prototype. This naming change is more symmetric with styled's behavior.
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 good to know about the name!
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's a good point about using it for customizations though.. we shouldn't use name there because it will be affected by minification and cause confusion. I'll make a quick change to only use options.displayName for Customizations.
|
Hello @JasonGore! Because this pull request has the Do note that I've been instructed to only help merge pull-requests of this repository that have been opened for at least 8 hours, a condition that is not currently met. No worries though, I will be back when the time is right! 😉 p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me and give me an instruction to get started! Learn more here. |
|
🎉 Handy links: |
Pull request checklist
$ npm run changeDescription of changes
Changes createComponent API from:
createComponent({ options });to:
createComponent(view, { options });Making
optionstruly optional andviewthe only required arg.It is now possible to use
createComponentlike this:createComponent(ButtonView);While allowing options to be added for further customization.
I had also planned on addressing #8331 as part of this PR but since my shield rotation moved up I'm going to make a change just for this for now.
Microsoft Reviewers: Open in CodeFlow