-
-
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 migrate: lib/client-api + app/angular + app/react + dependency upgrades #7323
Conversation
tsc wants all imports to be under rootDir
# Conflicts: # app/angular/src/client/preview/index.js # yarn.lock
# Conflicts: # docs/package.json # docs/src/versions/next.json # lib/client-api/src/client_api.ts
# Conflicts: # addons/knobs/src/components/Panel.tsx # addons/knobs/src/components/types/Checkboxes.js # addons/knobs/src/components/types/Files.js # addons/knobs/src/components/types/Options.js # app/angular/package.json # app/react/package.json # lib/cli/lib/initiate.js # lib/client-api/src/story_store.ts # lib/components/package.json # lib/components/src/blocks/Preview.tsx # lib/ui/src/components/layout/container.js # lib/ui/src/components/sidebar/treeview/treeview.js # lib/ui/src/index.js # scripts/bootstrap.js # yarn.lock
lib/addons/src/types.ts
Outdated
export interface Parameters { | ||
fileName?: string; | ||
options?: OptionsParameter; | ||
[key: string]: 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.
do we really want to allow this wildcard?
addons can argument this interface to add their own params.
the same question applies to StoryContext
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.
Yeah these are extensible by design.
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 think we missunderstand.
export interface Parameters {
fileName?: string;
options?: OptionsParameter;
}
is just as extensible when using interface augmentation, it just doesnt allow untyped params (because no index signature). see https://www.typescriptlang.org/docs/handbook/declaration-merging.html#merging-interfaces
# Conflicts: # app/angular/package.json # app/react/package.json # app/react/src/client/preview/types.ts # jest.config.js # lib/addons/src/make-decorator.ts # lib/components/package.json # scripts/compile-babel.js # yarn.lock
I merged the PRs individually |
combines #7147 & #6570