graphile / starter

Opinionated SaaS quick-start with pre-built user account and organization system for full-stack application development in React, Node.js, GraphQL and PostgreSQL. Powered by PostGraphile, TypeScript, Apollo Client, Graphile Worker, Graphile Migrate, GraphQL Code Generator, Ant Design and Next.js
https://graphile-starter.herokuapp.com
Other
1.73k stars 218 forks source link

Upgrade all packages #295

Closed heracek closed 1 year ago

heracek commented 2 years ago

🚧 Disclaimer 🚧: This PR will not be merged any soon, as Benjie is focusing on V5 of PostGraphile. You may use this branch as basis for your work (if you want updated dev stack), but there may be some issues in production or on non-Mac platforms, as the code was not battle tested yet.

Plese let me know if you find any issues.


Description

Upgrade all possible NPM packages to latest versions. This was done especially for performance benefits of Next.js 12.

I've tested almost everything, and all seems to be working as before:

Untested:

There was an issue with rc-dropdown, but it's already fixed.

Only following package were not upgraded due to compatibility issues (log from yarn upgrade-interactive --latest):

   name          range   from         to       workspace        url
❯◯ @types/node   latest  16.11.21  ❯  17.0.13  @app/client      https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node
 β—― @types/redis  latest  2.8.32    ❯  4.0.11   @app/server      https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/redis
 β—― chalk         latest  4.1.2     ❯  5.0.0    @app/server      https://github.com/chalk/chalk#readme
 β—― chalk         latest  4.1.2     ❯  5.0.0    @app/worker      https://github.com/chalk/chalk#readme
 β—― graphql       latest  15.8.0    ❯  16.3.0   My_Project_Here  https://github.com/graphql/graphql-js
 β—― graphql       latest  15.8.0    ❯  16.3.0   @app/client      https://github.com/graphql/graphql-js
 β—― graphql       latest  15.8.0    ❯  16.3.0   @app/lib         https://github.com/graphql/graphql-js
 β—― redis         latest  3.1.2     ❯  4.0.2    @app/server      https://github.com/redis/node-redis

 devDependencies
   name          range   from         to       workspace        url
 β—― @types/node   latest  16.11.21  ❯  17.0.13  @app/server      https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node
 β—― dotenv        latest  10.0.0    ❯  14.3.2   My_Project_Here  https://github.com/motdotla/dotenv#readme
 β—― graphql       latest  15.8.0    ❯  16.3.0   @app/server      https://github.com/graphql/graphql-js

 resolutionDependencies
   name          range   from         to       workspace        url
 β—― graphql       latest  15.8.0    ❯  16.3.0                    https://github.com/graphql/graphql-js

Performance impact

Next.js 12 is much faster. Node.js v16 have native support on M1 Macs. 🀩

Security impact

Checklist

heracek commented 2 years ago

I've also upgrade Dockerfiles to Node.js v16 images.

Greatest benefit is that it runs much faster on macOS with M1 chip (Node 16 have native ARM support).

BTW it seems that there is some issue in production.Dockerfile. It produces 1.9GB image. Which is much larger then dev image:

REPOSITORY                           TAG       IMAGE ID       CREATED          SIZE
graphile-prod-server                 latest    f185329ea41c   20 minutes ago   1.9GB
graphile-starter_server              latest    9f7dc0a9ce3f   42 minutes ago   1.26GB

I used this command to create the image: docker build . --file production.Dockerfile --build-arg ROOT_URL="http://localhost:5678" --build-arg TARGET="worker" -t graphile-prod-server

heracek commented 2 years ago

@benjie are you iterested in this PR?

There are few issues after the upgrade of packages that I'd like to fix as part of this PR (e.g. replacing legacy next-with-apollo).

As mentioned in README, I should ask before cotributing bigger work.

Is there any hope that this PR will be merged? Should I continue in this direction? πŸ˜‡

benjie commented 2 years ago

Hi @heracek thanks for your efforts on this! I'm currently fully focussed on PostGraphile V5 development (I'm even taking significant time off from client work to work on it, which is not ideal from a cashflow point of view, and not something I can sustain much longer) so I'm afraid all the other projects are only undergoing simple maintenance currently - anything that requires significant time investment (such as checking that Starter continues to work in all environments and situations (Docker/not, Windows/Linux/Mac, production/development, deployment, etc)) is on the back-burner for now. Starter is in a known-good state, so I plan to leave it there until something upsets that or I find time to advance it again.

In the mean time, your PR is a great foundation for people who want to run newer dependencies to base their work on, so I do truly appreciate it :heart:

heracek commented 2 years ago

Hi, thanks for the explanation. Rumours about V5 looks very exciting, I'm looking forward for it! I hope this PR will be useful once V5 is ready.

triptec commented 1 year ago

@heracek I've started out from this branch but I'm having some trouble with the e2e tests, specifically 2 of the subscription tests are failing for me. Have you run them and do they all pass?

triptec commented 1 year ago

@benjie could this workflow get approval, it would be nice to see if the tests are passing?

benjie commented 1 year ago

Done πŸ˜”

benjie commented 1 year ago

Closing in favour of #328; thanks for your work on this!

heracek commented 1 year ago

@benjie thank you too! Upgrade to TS v5 and Next v13 is great news.