starter icon indicating copy to clipboard operation
starter copied to clipboard

Upgrade all packages

Open heracek opened this issue 3 years ago • 4 comments

🚧 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:

  • yarn test
  • yarn lint
  • yarn build
  • e2e tests
  • dev servers (local and in Docker)

Untested:

  • production deployment (Redis, AWS, production Docker)

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

  • I only noticed error in Antd component that is using rc-dropdown. useAccessibility uses setTimeout in very incorrect way (in checks for existence of triggerRef.current when timer is triggered (this may be too early, when user clicks on link in top right dropdown and navigates to different page - triggerRef.current will be null after 100ms). Error is: useAccessibility.js?5e4c:69 Uncaught TypeError: Cannot read properties of null (reading 'triggerRef')

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

  • unknown, but may solve few potential issues in outdated packages

Checklist

  • [x] My code matches the project's code style and yarn lint:fix passes.
  • [x] I've added tests for the new feature, and yarn test passes.
  • [x] I have detailed the new feature in the relevant documentation.
  • [x] I have added this feature to 'Pending' in the RELEASE_NOTES.md file (if one exists).
  • [x] If this is a breaking change I've explained why.

heracek avatar Jan 28 '22 16:01 heracek

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 avatar Jan 29 '22 12:01 heracek

@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? 😇

heracek avatar Feb 01 '22 11:02 heracek

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:

benjie avatar Feb 09 '22 17:02 benjie

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.

heracek avatar Feb 10 '22 19:02 heracek

@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 avatar Dec 13 '22 22:12 triptec

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

triptec avatar Dec 13 '22 22:12 triptec

Done 😔

benjie avatar Dec 14 '22 23:12 benjie

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

benjie avatar Mar 01 '23 14:03 benjie

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

heracek avatar Mar 01 '23 15:03 heracek