-
Notifications
You must be signed in to change notification settings - Fork 109
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
Migrate aws-sdk from 2 to 3. Update rewrites, gatsby 5 optimisation #457
base: master
Are you sure you want to change the base?
Conversation
Fixed up issues with client-only, serverless, and redirects. Need to get e2e testing running and green and we should be good. :) |
I've come up with a nicer solution for home page redirects (no longer need a dummy js file) and I've implemented a TODO to flip generateRedirectObjectsForPermanentRedirects to true. I also addressed an issue with auto-created buckets. Still working through e2e testing, but once this is working, I'll be ready to flip from draft to PR :) |
This looks fantastic, thanks for putting the effort into this. My work and life are both very busy at the moment, but I'll try to make some time to review this. (Hopefully on Sunday at the latest) |
It's ok. We actually critically depend on this module (as I expect many others do), so it's worth my time to invest in updating it. :) |
} | ||
|
||
provider "aws" { | ||
version = "~> 2.59" |
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 version should probably be kept as is or increased to something more recent!
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 version was shifted to terraform.required_providers to upgrade to the new terraform style.
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.
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.
ah! I missed that, this looks good then. My mistake.
Hi @tractorcow , I tried to test this out today but I ran into a couple of issues. \1. I'm unable to run \2. I'm unable to build the project using
\3. I'm unable to build the gatsby-plugin-s3 project with
I'm not sure why running the build through Lerna vs directly yields different results. I did some additional tests and found that both methods definitely use the workspace version of TypeScript. (Not the globally installed version) Please let me know if there's something I'm doing wrong. Thanks! |
hi @JoshuaWalsh I gave you write access to the fork in case you wanted to push up any changes. I'll get back to you today on this. |
Typescript errors have been fixed. My mistake was building at the module level, not using lerna. |
I think there's still a minor issue where typescript 4 / 5 might be used in different build contexts. It still builds correctly in either case. :) |
I'm encountering a strange issue while trying to test this on Windows. The e2e script is failing to build the sample sites:
It's strange because if I manually run the same I did try modifying the |
Ah, full disclosure, I have been testing on OSX, but I can try to setup a windows environment to test at some point too. I'll have a look over the diffs to see if anything jumps out as a possible red flag. |
Are you able to do a build on the gatsby-plugin-s3-example-with-redirects manually via |
Here's something that might work. Try testing with node 18/20
|
I suspect the issue I'm having with gatsby-config isn't introduced by one of your code changes, but rather is caused by upgrading the Gatsby version. I am using Node 18, as the new Gatsby version required me to update.
|
Thanks for giving it a good attempt; There may be some differences since I am on OSX and you are on windows, but at least between the two of us we can get a good OS testing coverage. :) |
Any chance of moving this forward anytime soon @JoshuaWalsh? This looks like a great addition |
Is there a way of doing a limited beta release that will let other users test and provide feedback? That might take some pressure off @JoshuaWalsh to do all the testing on his end. |
Good idea, we would be happy to help test this! |
It seems a lot of effort was put into this PR. I hope a maintainer can help get this moved along. PS: We don't need the change even - it's just a shame for good effort to go to waste. |
If it helps at all to have a user chime in, I've been running this branch live in production for about 2 months with no issues. Running against a ~3500 page Gatsby 4 deployment. |
@YoshiWalsh You mentioned here #422 (comment) |
I'm glad to hear others are finding this work helpful. I've also been using this on a few projects, but I understand that testing can be complicated. I suggest that we split this into a new major version to minimise the risk of existing sites unexpectedly breaking, especially with the lack of regression testing on older gatsby versions (although happy to hear 4 works as well as 5). Strictly this is a breaking change, so it would be good to have a good 1.0.0 (current) with 2.0.0 (this pr). |
I made an attempt to publish this to https://www.npmjs.com/package/@pixelfusion-nz/gatsby-plugin-s3 Forgive me if I made a mistake, this is my first time publishing an npm package. :) |
I've updated https://www.npmjs.com/package/@pixelfusion-nz/gatsby-plugin-s3 with a readme
I'll be testing this over the next week with some of my other projects to make sure I've published the package correctly. |
I've been using |
I have the basic logic and deployment working (with-redirects); I have a proof of concept deployed with a few issues.
Things I need to keep testing:
Update and run through testing.md(fixed)Resolve issue with client-only pages which work differently in gatsby 5 (they still get deployed to s3)(fixed)Test with serverless(fixed)Home page redirect gives a warning but still work fine(fixed)Notes from upgrade:
maxRetries
seems to have been ignored, andfixedRetryDelay
seems to have been set via env not config.The most significant update I've made is to do with rewrites:
With regards to release, it's my recommendation that you release a 1.0.0 under the current codebase, with legacy support for older gatsby versions, and tag this as 2.0.0 beta. I haven't tested this with gatsby 2,3. etc... and it should still work, but I have only tested this with gatsby 5, so you may want to target this version in order to prevent older sites immediately breaking on dependency updates.