-
-
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
Ts migration/client api #7147
Ts migration/client api #7147
Conversation
This pull request is automatically deployed with Now. Latest deployment for this branch: https://monorepo-git-ts-migration-client-api.storybook.now.sh |
lib/client-api/src/client_api.ts
Outdated
export default class ClientApi { | ||
constructor({ storyStore, decorateStory = defaultDecorateStory } = {}) { | ||
_storyStore: StoryStore; |
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.
could we use private fields here?
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 we can.
|
that's odd, I resolved those, will go back and check again. |
lib/client-api/src/config_api.ts
Outdated
@@ -14,10 +48,17 @@ export default class ConfigApi { | |||
|
|||
_renderMain() { | |||
// do initial render of story | |||
debugger; |
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.
hmm not sure it should be still here 😉
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 should not, i am actually battling with node-gyp and cannot build storybook anymore, will be updating PR HOPEFULLY tonight; post reformating
Committer: Jessica-Koch <jessicakoch136@icloud.com>
76239e9
to
8eb8ffb
Compare
8eb8ffb
to
bcf18cc
Compare
# Conflicts: # lib/client-api/package.json
@gaetanmaisse could you possibly help review this? |
parameters: { | ||
[key: string]: any; | ||
}; | ||
} | ||
|
||
export interface OptionsParameter extends Object { |
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.
Just wonder why extends Object
?
Thank you for the review @gaetanmaisse |
|
||
_data: StoreData; | ||
|
||
_legacyData?: LegacyData; |
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.
My guess is that you were trying to fix naming from _legacydata
to _legacyData
but somehow not finished or discarded changing?
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 fearful of changing too much, this SHOULd be an internal api, but I am aware of some integrations hooking into this, and preferably I would like to change it at a later point at the 6.0 release instead.
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.
@ndelangen what's _legacyData
?! Seems unused throughout the codebase?
# Conflicts: # lib/client-api/package.json
# Conflicts: # addons/ondevice-backgrounds/src/BackgroundPanel.js # lib/client-api/package.json # lib/client-api/src/story_store.ts
input.replace(/[^a-z0-9]+([a-z0-9])/gi, (...params) => params[1].toUpperCase()); | ||
|
||
const toChild = it => ({ ...it }); | ||
const toChild = (it: {}) => ({ ...it }); |
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.
@ndelangen unused?
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
@@ -130,26 +144,25 @@ export default class ClientApi { | |||
if (m && m.hot && m.hot.dispose) { | |||
m.hot.dispose(() => { | |||
const { _storyStore } = this; | |||
_storyStore.remove(); |
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.
Issue:
What I did
migrated the client-api to typescript, there are some errors, I wasn't sure how to type a couple of functions so I left them as is. Everything builds.
How to test
If your answer is yes to any of these, please make sure to include it in your PR.