-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[new-platform] Explicitly define core setup types #34817
Conversation
Pinging @elastic/kibana-platform |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
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.
Functionally LGTM, just had some nits surrounding formatting consistency.
<b>Returns:</b> | ||
|
||
`string` | ||
|
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.
nit: Remove this extra trailing line.
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.
These docs are generated by api-documenter (I just bumped the version to include a PR I submitted to add a "do not edit header" so that this is clearer). At some point we might fork api-documenter to customize the formatting to our needs since I agree that the formatting like 4-space indentation is different from our standards.
`string` | ||
|
||
The basePath as defined by the server | ||
|
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.
nit: Remove this extra trailing line.
| [addToPath(path)](./kibana-plugin-public.basepathsetup.addtopath.md) | Add the current basePath to a path string. | | ||
| [get()](./kibana-plugin-public.basepathsetup.get.md) | Get the basePath as defined by the server | | ||
| [removeFromPath(path)](./kibana-plugin-public.basepathsetup.removefrompath.md) | Remove the basePath from a path that starts with 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.
nit: Remove this extra trailing line.
<b>Returns:</b> | ||
|
||
`string` | ||
|
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.
nit: Remove this extra trailing line.
|
||
```typescript | ||
Context: ({ children }: { | ||
children: React.ReactNode; |
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.
nit: indentation consistency.
children: React.ReactNode; | |
children: React.ReactNode; |
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 file is autogenerated. the problem should be fixed in https:/Microsoft/web-build-tools/tree/master/apps/api-documenter
@skaapgif did you create an issue for this problem or I should?
|
||
```typescript | ||
getPlugins: () => Array<{ | ||
id: string; |
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.
nit: indentation consistency.
id: string; | |
id: string; |
```typescript | ||
getPlugins: () => Array<{ | ||
id: string; | ||
plugin: DiscoveredPlugin; |
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.
nit: indentation consistency.
plugin: DiscoveredPlugin; | |
plugin: DiscoveredPlugin; |
getPlugins: () => Array<{ | ||
id: string; | ||
plugin: DiscoveredPlugin; | ||
}>; |
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.
nit: indentation consistency.
}>; | |
}>; |
| [getKibanaVersion](./kibana-plugin-public.injectedmetadatasetup.getkibanaversion.md) | <code>() => string</code> | | | ||
| [getLegacyMetadata](./kibana-plugin-public.injectedmetadatasetup.getlegacymetadata.md) | <code>() => {`<p/>` app: unknown;`<p/>` translations: unknown;`<p/>` bundleId: string;`<p/>` nav: unknown;`<p/>` version: string;`<p/>` branch: string;`<p/>` buildNum: number;`<p/>` buildSha: string;`<p/>` basePath: string;`<p/>` serverName: string;`<p/>` devMode: boolean;`<p/>` uiSettings: {`<p/>` defaults: UiSettingsState;`<p/>` user?: UiSettingsState | undefined;`<p/>` };`<p/>` }</code> | | | ||
| [getPlugins](./kibana-plugin-public.injectedmetadatasetup.getplugins.md) | <code>() => Array<{`<p/>` id: string;`<p/>` plugin: DiscoveredPlugin;`<p/>` }></code> | An array of frontend plugins in topological order. | | ||
|
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.
nit: remove extra trailing line for consistent file endings.
/** @public */ | ||
export type I18nSetup = ReturnType<I18nService['setup']>; | ||
/** | ||
* I18nSetup.Context is required by any localizable React component from \@kbn/i18n and \@elastic/eui packages |
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.
Can I ask why moving this comment now has forward slashes in front of @kbn
and @elastic
?
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 TSDoc standard uses @...
for tags, so anytime an '@' is used it needs to be escaped. Before these comments weren't exported as part of the type system, so they weren't interpreted by TSDoc/api-exporter, so it wasn't an issue.
|
||
## BasePathSetup.removeFromPath() method | ||
|
||
Remove the basePath from a path that starts with 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.
optional: if starts with 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.
👍
|
||
```typescript | ||
Context: ({ children }: { | ||
children: React.ReactNode; |
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 file is autogenerated. the problem should be fixed in https:/Microsoft/web-build-tools/tree/master/apps/api-documenter
@skaapgif did you create an issue for this problem or I should?
@@ -56,7 +78,7 @@ export class FatalErrorsService { | |||
}); | |||
} | |||
|
|||
public add = (error: Error | string, source?: string) => { | |||
public add: FatalErrorsSetup['add'] = (error, source?) => { |
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.
private. no-one should call it on an instance
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.
👍
💔 Build Failed |
@restrry for some reason github won't let me reply to this comment
I've created microsoft/rushstack#1215 which has been merged and released as [email protected]. I haven't yet updated Kibana's version, but I can do it as part of this PR 👍 |
💚 Build Succeeded |
@skaapgif what about other points in #32148 (review) ? do they have appropriate issues in https:/Microsoft/web-build-tools/ repo? should we create them? |
@restrry There's been quite a lot of changes in api-extractor, so I wanted to just make sure we're on the latest version of both extractor and documenter before creating issues. I've bumped api-extractor here: #34925 |
@skaapgif yeah, problems are still present 😞 |
💔 Build Failed |
💚 Build Succeeded |
Formatting issues are due to upstream dependency, I've created issues for these and will follow-up once there's progress.
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'd change method definition https:/elastic/kibana/pull/34817/files#r274024421 but overall everything is 🆗
💔 Build Failed |
This reverts commit fe9e6e6.
I totally agree with your reasoning here, but I'll open a new PR for this. |
💚 Build Succeeded |
* Explicitly define BasePathSetup type * Explicitly define I18nSetup type * Explicitly define InjectedMetadataSetup type * Explicitly define FatalErrorSetup type * Fix lint errors * Fix BasePathSetup types * Fix lint errors * Clarify basePath add() docs * Upgrade api-documenter for 'do not edit' header * Use @link references on CoreSetup to improve doc navigation * Add comment that links to upstream api-documenter issue * PR Comments: make FatalErrorsService.add() private * Revert "PR Comments: make FatalErrorsService.add() private" This reverts commit fe9e6e6.
* Explicitly define BasePathSetup type * Explicitly define I18nSetup type * Explicitly define InjectedMetadataSetup type * Explicitly define FatalErrorSetup type * Fix lint errors * Fix BasePathSetup types * Fix lint errors * Clarify basePath add() docs * Upgrade api-documenter for 'do not edit' header * Use @link references on CoreSetup to improve doc navigation * Add comment that links to upstream api-documenter issue * PR Comments: make FatalErrorsService.add() private * Revert "PR Comments: make FatalErrorsService.add() private" This reverts commit fe9e6e6.
* Explicitly define BasePathSetup type * Explicitly define I18nSetup type * Explicitly define InjectedMetadataSetup type * Explicitly define FatalErrorSetup type * Fix lint errors * Fix BasePathSetup types * Fix lint errors * Clarify basePath add() docs * Upgrade api-documenter for 'do not edit' header * Use @link references on CoreSetup to improve doc navigation * Add comment that links to upstream api-documenter issue * PR Comments: make FatalErrorsService.add() private * Revert "PR Comments: make FatalErrorsService.add() private" This reverts commit fe9e6e6.
Summary
Addresses the following services from #34416:
Instead of trying to address all services in a single big PR, I'm breaking this up into smaller PR's to minimize the potential for merge conflicts.
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.[ ] This was checked for cross-browser compatibility, including a check against IE11[ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support[ ] Documentation was added for features that require explanation or tutorials[ ] Unit or functional tests were updated or added to match the most common scenariosThis was checked for keyboard-only and screenreader accessibilityFor maintainers
[ ] This was checked for breaking API changes and was labeled appropriately[ ] This includes a feature addition or change that requires a release note and was labeled appropriately