Skip to content

Conversation

beeman
Copy link
Contributor

@beeman beeman commented Apr 26, 2020

This PR updates NestJS to the latest version. I've added the same versions that are used when creating a new app using the NestJS cli, including RxJS.

I've tested it in a playground and all seems to work as expected.

@beeman beeman force-pushed the beeman/nest-deps branch from cb8b6b2 to adb2319 Compare April 29, 2020 21:33
@FrozenPandaz
Copy link
Collaborator

FrozenPandaz commented May 5, 2020

@beeman

Thanks for the contribution!

Would you mind listing out any Breaking Changes in NestJS 7.0.0 and highlight any changes that were made? I see rxjs is now a peer dependency?

@beeman
Copy link
Contributor Author

beeman commented May 6, 2020

@FrozenPandaz thanks for reviewing!

(As far as I can tell...)

The only real breaking change in NestJS core is dropping support for Node v8.

Other than that, users of the packages @nestjs/microservices, @nestjs/graphql and @nestjs/terminus are advised to read the migration guide see what changed for them.

I've been using Nest v7 it since it's release in my Nx projects and I only needed to change how I used GraphQL.

Since Kamil did an awesome job keeping @nestjs/graphql backwards compatible, migration is trivial:

  • Search/replace type-graphql with @nestjs/graphql
  • Search/replace ResolveProperty with ResolveField.

After that we can get rid of the type-graphql dependency and the migration is done.

Let me know if you need anything else, or if you want me to list this somewhere specific.

The rxjs dependency is a peerDependency, so not essential to start a new NestJS api but recommended to install.

From looking at it though, we should probably also add reflect-metadata as a peerDependency to get rid of these:

warning " > @nestjs/core@7.0.9" has unmet peer dependency "reflect-metadata@^0.1.12".
warning " > @nestjs/common@7.0.9" has unmet peer dependency "reflect-metadata@^0.1.12".

@beeman beeman force-pushed the beeman/nest-deps branch 2 times, most recently from 9782e5c to 7884038 Compare May 7, 2020 05:02
@beeman
Copy link
Contributor Author

beeman commented May 7, 2020

@FrozenPandaz I pushed an updated version.

The PR now also updates the dependencies in the top-level package.json (this is what breaks CI?).

I also gave a shot at adding a migration script. Not sure if that's something that's desired, happy to remove again it if not :)

@beeman beeman force-pushed the beeman/nest-deps branch 2 times, most recently from 5c58716 to 16bacff Compare May 15, 2020 21:42
@juristr juristr mentioned this pull request May 21, 2020
4 tasks
@juristr juristr self-assigned this May 21, 2020
@beeman beeman force-pushed the beeman/nest-deps branch from 16bacff to 37b6854 Compare May 22, 2020 18:58
Copy link
Collaborator

@FrozenPandaz FrozenPandaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for adding the migration file.

I think we should also provide migrations for the changes to imports.

Would you be able to give that a shot?

@beeman
Copy link
Contributor Author

beeman commented May 23, 2020

@FrozenPandaz for sure happy to take a look at that. Do you know of a similar migration that I could use as an example?

@FrozenPandaz
Copy link
Collaborator

Here is somewhere you can start? You may want to be more careful about which Symbols are brought over?

https://github.com/nrwl/nx/blob/master/packages/react/src/migrations/update-8-3-0/update-8-3-0.ts#L98

@beeman beeman force-pushed the beeman/nest-deps branch 2 times, most recently from 4161216 to b86e3a6 Compare May 26, 2020 17:14
@beeman
Copy link
Contributor Author

beeman commented May 26, 2020

@FrozenPandaz that was a great pointer, I updated the migration to update the import from type-graphql to @nestjs/graphql, and remove the type-graphql dependency from package.json.

However, I have tried to rename the decorator (ResolveProperty -> ResolveField) but I could not get it working, my AST knowledge is not sufficient yet. Any pointers on how we can do that?

@vsavkin vsavkin force-pushed the master branch 3 times, most recently from 738e12c to d1679ce Compare May 29, 2020 18:43
@juristr juristr force-pushed the beeman/nest-deps branch from b86e3a6 to 215905b Compare June 22, 2020 20:53
@juristr juristr force-pushed the beeman/nest-deps branch from 215905b to 6ca2fb9 Compare June 22, 2020 21:06
@juristr
Copy link
Member

juristr commented Jun 22, 2020

@beeman just adjusted a couple of things on top of ur PR. Thx again for all ur contributions 🙏 .

I also added a link to the NestJS migration docs, so ppl can check it out.

image

If the pipeline looks good I'll merge it tomorrow

@github-actions
Copy link
Contributor

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants