Skip to content
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

docs: Add conditional TypeScript block to migration guide #3216

Merged
merged 2 commits into from
Jun 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/guides/migrating.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ The new [schemas and resolvers](../api/schema/index.md) cover most use cases pre

## TypeScript

<LanguageBlock global-id="js">

You have selected JavaScript as the language which does not have type information.

</LanguageBlock>

<LanguageBlock global-id="ts">

The new version comes with major improvements in TypeScript support from improved service typings, fully typed hook context and typed configuration. You can see the changes necessary in the Feathers chat [here](https://github.com/feathersjs/feathers-chat-ts/compare/dove-pre).

### Application and hook context
Expand All @@ -53,6 +61,8 @@ Now `import { HookContext } from './declarations'` can be used as the context in

### Service types



Service types now only need the actual service class type and should no longer include the `& ServiceAddons<any>`. E.g. for the messages service like this:

```ts
Expand Down Expand Up @@ -94,6 +104,8 @@ declare module '@feathersjs/feathers/lib/declarations' {
}
```

</LanguageBlock>

## Deprecations and breaking changes

### Express middleware order
Expand Down