-
Notifications
You must be signed in to change notification settings - Fork 699
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
Support rails 6.1 #1221
Support rails 6.1 #1221
Conversation
226af49
to
92f1c64
Compare
If I remember correctly, there were also issues with our asset pipeline (specifically with webpack, if I'm not mistaken). Have those issues been solved? |
Is there an issue/discussion for more context around this? I can see if this is still outstanding |
^ Ah, that issue is not so informative. I think there's more detail elsewhere... |
a5a1fa8
to
ceb7a52
Compare
rails (> 5.2.1, < 6.1) | ||
rails (> 5.2.1, < 6.2) |
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.
I wonder if we can just change this requirement to ~> 6.1
now that we know it'll be safe until v7.
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.
Yeah same here, I think we can probably just keep the rails requirement to be: rails (> 5.2.1, < 7)
f77d7ba
to
2fa47d1
Compare
* This comes as part of an update to Rails to remove dependency on mimemagic
67624a1
to
9f6e057
Compare
9f6e057
to
be7d58a
Compare
I tested running the code for this PR with Ruby v3 to see if that fixed the problems we had with returning JSON, and it seems to. We may want to tag that this closes #1178 as well! |
bf7988d
to
6a98e2b
Compare
@andyw8 @paulomarg it looks like there are a few Shopify teams waiting for this change. I'm confident to merge it, but I'd like to get your final opinions on the gemspec constraint I've added. Is it better to restrict support to Rails version |
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.
LGTM
I'm fine with this, it even fixed other problems 🙂 As for the version, I think either works for now and we can always tweak that later. |
The README.md still tells that Rails 6.1 or above is not yet supported. |
What this PR does
This PR introduces support for Rails 6.1. The key thing to support for Rails 6.1 is the following:
action_dispatch.cookies_same_site_protection = :lax
by default. This setting will not work with apps embedded in the Shopify Admin.To fix this, embedded apps built with the next version of the Shopify App gem will have all their cookies set to
SameSite=None
using theSameSiteCookieMiddleware
:For existing apps that wish to bump their Rails versions to
6.1
, but do not want to upgrade their shopify_app gem version, this PR provides a troubleshooting guide to configure the following in theirapplication.rb
config:+ action_dispatch.cookies_same_site_protection = :none
Reviewer's guide to testing
To test this, I used this branch as the source of the shopify_app gem path using a new app built with Rails
v6.1.3
:rails _6.1.3_ new test-shopify-app
cd test-shopify-app
gem 'dotenv-rails'
andgem 'shopify_app', path: 'local/path/to/shopify_app'
to the app's Gemfile.env
rails g shopify_app
✅ Cookie behaviour using the current release of shopify_app `v8.3`
Rails 6.1 sets all cookies to
LAX
by default✅ Cookie behaviour using this branch's `SameSiteCookieMiddleware`
Middleware sets all cookies to
None
by default if the app is embedded✅ Cookie behaviour using Rails `application.rb` configurations
By adding the following:Rails 6.1 sets all cookies to
None
by defaultThings to focus on
v17.2
). Is there any reason why this should be a major release?Checklist
Before submitting the PR, please consider if any of the following are needed:
CHANGELOG.md
if the changes would impact usersREADME.md
, if appropriate./docs
, if necessary