This file contains more detailed instructions on what's required when updating
an application between one release version of the gem to the next. It's intended
as more in-depth accompaniment to the notes in CHANGELOG.md
for each version.
No changes required.
No changes required.
No changes required.
The synchronise_all
method for models with the Synchronises
concern has been updated to use cursor-based pagination per the Shopify API deprecation. Ad hoc app code updates to address this may now be removed.
The HasMetafields
concern has been upgraded - it now handles updating existing
metafields, and can also properly support writing shop metafields. In order to
do this, the write_metafields
method now involves fetching existing metafields
from the relevant resource - you may need to account for this in tests. A large
number of Disco projects had their own implementation of the HasMetafields
concern to handle the update existing case - you may want to check and see if
you can now remove that from your application code.
Ensure new Shopify Flow Trigger Usage database migrations are brought across and run:
bundle exec rake disco_app:install:migrations
bundle exec rake db:migrate
Shop timezones are now calculated based on the iana_timezone
attribute in the shop's
data
attribute, rather than the old text-based timezone
attribute. If you have an
app with many old installs, you may need to ensure the iana_timezone
attribute is
set.
You can now easily restrict the fields that are sent in webhook payloads with the new
webhook_fields
configuration option:
DiscoApp.configure do |config|
config.webhook_fields = {
'orders/paid': [:id, :financial_status]
}
end
Upgrade to Rails 6 (guide).
Upgrade to Ruby 2.6.5.
Upgrade the following gems:
gem 'shopify_api', '~> 9.0'
gem 'shopify_app', '~> 12.0.7'
gem 'sidekiq', '~> 6.0'
Additionally, you might have to upgrade react-rails
, uglifier
, vcr
and webmock
gems.
Add SHOPIFY_APP_API_VERSION
env variable.
Upgrade your app to Rails version 5.2.2.
Set your shopify_api
version to 6.0:
gem 'shopify_api', '~> 6.0'
Ensure new Shopify Flow database migrations are brought across and run:
bundle exec rake disco_app:install:migrations
bundle exec rake db:migrate
Upgrade your app to Rails version 5.2. See the Rails upgrade docs.
One big change is the introduction of the Credentials API, which is intended to replace config/secrets.yml
and config/secrets.yml.enc
, and works much like Ansible Vault. There's no need to migrate old secrets usage, since the two behaviours can sit side by side. However, if you do want to try it out, make sure to add the following to your config/environments/*.rb
file:
config.require_master_key = true
No changes required.
Update your app's .ruby-version
to 2.5.0.
Upgrade your app to Rails version 5.1. See the wiki for detailed instructions on this upgrade.
Update your app's .ruby-version
to 2.4.1.
Upgrade your app to Rails version 4.2.8.
# when using homebrew and rbenv:
brew update
brew upgrade rbenv
rbenv install 2.4.1
A new default .editorconfig
configuration file has been added to the list of
default files copied over in an initial disco_app
install. For any existing
apps, you should copy this file from disco_app
into the root of your
application directory.
A Shopify Partner app generator has been added, which allows you to create a new app
for a given project via a task (refer to the README for setup).
For running this task on a pre-existing project, you will need to add the mechanize
gem into :development
group in the project's Gemfile
and bundle install
The implementation of as_liquid
has changed (to_liquid
remainins unchanged).
Please check to see if your app calls as_liquid
directly and update as required.
No changes required.
A rule to ignore *.pgdump
has been added to the default .gitignore
template.
You may want to add this to the app's current .gitignore
now.
We've made a change to turn off prepared statements in Postgres by default, as they can chew up a lot of memory without necessarily providing much in the way of speed increase (see rails/rails#21992).
You should follow suit and add prepared_statements: false
to the database.yml
in your application.
This release includes a migration that fixes a bug with a unique index on the
disco_app_users
table. Make sure you copy across the latest version of the
migration and run on your app with:
bundle exec rake disco_app:install:migrations`
bundle exec rake db:migrate
The renderErrors()
method in the React BaseForm
component was renamed to
getErrorsElement()
. If you were calling renderErrors()
directly in your
code (unlikely), you'll have to rename it.
Add .codeclimate.yml and .rubocop.yml from the root directory of disco_app
to the root directory of your app, refer to the Rubocop section in the README,
if you wish to change the rubocop configuration
No changes required.
Check that your usage of InputCheckbox
, if used, matches the updated component.
The previous component didn't work very well so it's unlikely you're using it.
Ensure you copy migrations from from disco_app
using
rake disco_app:install:migrations
, then rake db:migrate
.
To use the new Shopify user authentication functionality, refer to the User Authentication section in the README.
No changes required.
No changes required.
Set DISCO_API_URL
in production if your app should report subscriptions to the
Disco API.
Add the following to initializer/rollbar.rb
:
config.person_method = 'current_shop'
config.person_username_method = 'shopify_domain'
No changes required - only a bugfix release.
No changes required - only a bugfix release.
Remove the version specification for shopify_app
in your Gemfile
. Rename any
occurences of ShopifyApp::Controller
to ShopifyApp::LoginProtection
.
Remove redirect_uri
variables in:
.env
and.env.local
filesshopify_app
andomniauth
initializers
Ensure that your uglifier
gem dependency in your Gemfile
depends on ~> 3.0
.
The major difference for this upgrade is the change to the dependencies regime for
the disco_app
gem. The dependencies specified in the Gemspec are now much looser
and should lead to fewer "inconsistent version" issues. The generator now no longer
specifies gem versions when adding gems to the Gemfile
. After upgrading, you may
want to remove the specific version numbers from your app's Gemfile
and run a
bundle update
.
All migrations from the disco_app
engine have been consolidated into a single
migration. You can either consolidate the migrations for your own app by copying
your schema.rb
file into a single migration file, or just delete all migrations
added by the disco_app
gem and ensure your app's existing migrations make sense.
The Shopify API context helper .temp {}
is now aliased as .with_api_context {}
.
You should replace any usages of .temp
with the new method name.
No changes required - only a bugfix release.
The Ruby dependency for disco_app
was upgraded to the latest stable release of
Ruby (2.3.3). You should ensure the .ruby-version
and your Gemfile
is updated
to specify Ruby 2.3.3.
If you're using a shop's local anywhere, you can now replace your existing code
with the new DiscoApp::Shop.locale
helper.
There were some significant changes to the React component library and the styling of some of our components - you should visually inspect each page of your app after upgrading to check for breaking changes.
Bugfix release - no changes required.
The Sidekiq Web UI can now be accessed on production stores at /sidekiq
using
the same authentication credentials as the admin pages.
The find_shop
and validate_rate_params
methods have been added to the
carrier request controller concern, so you can now remove them from your own
controller implementations if present.
If you're calculating a shop's timezone anywhere in your app, you can now
replace your existing code with the new DiscoApp::Shop.time_zone
helper.
Instead of having to override DiscoApp::SynchroniseWebhooksJob
, you can now
specify the list of additional webhook topics to register for via configuration
in config/initializers/disco_app.rb
. You should be able to add:
DiscoApp.configure do |config|
...
config.webhook_topics = [:'orders/create', :'orders/paid']
...
end
and delete app/jobs/disco_app/synchronise_webhooks_job.rb
.
As with the specification of webhook topics, you can now specify the callback URL for any carrier service inside `config/initializers/disco_app.rb`` rather than having to override the synchronisation job.
Add something like this to your initializer (note the use of the lambda ->
syntax for lazy evaluation of URL helpers):
DiscoApp.configure do |config|
...
config.carrier_service_callback_url = -> { Rails.application.routes.url_helpers.carrier_service_callback_url }
...
end
and delete app/jobs/disco_app/synchronise_carrier_service_job.rb
.
Add the following to the end of config/initializers/rollbar.rb
:
...
# Add custom handlers.
config.before_process << proc do |options|
if options[:exception].is_a?(ActiveResource::ClientError) and options[:exception].message.include?('Too Many Requests')
raise Rollbar::Ignore
end
end
end
Upgrade activerecord-session_store
to version 1.0.0 in your Gemfile.
Add config.time_zone = 'UTC'
to your application.rb
.
If you're outputting a model for use in a Liquid template, you can now include
the DiscoApp::Concerns::CanBeLiquified
concern in your class.
If you're setting metafields for resources via the Shopify API, life just got a
whole lot easier with DiscoApp::Concerns::HasMetafields
and the
write_metafields
method it introduces.
No changes required - only additional features.
No changes required - only additional features.
No changes required - only additional features.
No changes required - only additional features.
You now need to specify a prefix (eg assets/
) to the assets:
argument of the
renders_assets
macro. See the README for more.
You now have access to the asset rendering pattern, for much simplified management of Shopify assets. See the section "Asset Rendering" in the README for further details.
Until now, when queueing a background task inheriting from DiscoApp::ShopJob
,
you had to provide the Shopify domain of the shop as the first argument to
perform
in order to indicate the shop context the job should execute in. This
argument is still required, but we now support passing a DiscoApp::Shop
instance directly as a (now preferred) alternative to using the Shopify domain.
This change is backwards-compatible, so you don't have to update you code, but it does offer a slightly nicer syntax and you avoid additional Shop lookups.
Before:
class MyJob < DiscoApp::ShopJob
def perform(shopify_domain, id)
... your code ...
end
end
@shop = DiscoApp::Shop.first
MyJob.perform_later(@shop.shopify_domain, 123)
MyJob.perform_later(@shop.shopify_domain, 456)
After:
class MyJob < DiscoApp::ShopJob
def perform(shop, id)
... your code ...
end
end
@shop = DiscoApp::Shop.first
MyJob.perform_later(@shop, 123)
MyJob.perform_later(@shop, 456)
The Shop model now has a data
attribute, which stores all shop information
from Shopify as a jsonb
attribute. As a result of this change, the following
attributes have been removed from the Shop model:
:email, :country_name, :currency, :money_format, :money_with_currency_format,
:plan_display_name, :latitude, :longitude, :customer_email, :password_enabled,
:phone, :primary_locale, :ships_to_countries, :timezone, :iana_timezone,
:has_storefront
You should replace any parts of your application code that uses these attributes
to access them through the data
attribute instead, eg: @shop.currency
becomes @shop.data['currency']
. For commonly-accessed attributes, you may wish
to simply add an accessor method on your model:
def currency
data['currency']
end
There is a new rake task, shops:sync
, which you should run from your app once
this change is deployed. It will pull in and update all shop information from
the Shopify API.
From this version onwards, the Bootstrap CSS styles were removed. Please use the UI Kit styles instead - these were already introduced in a previous version of disco_app.
As this file didn't exist prior to 0.9.2
, no detailed upgrade notes are
available. Please read through the CHANGELOG.md
and the commits themselves
when upgrading.