Skip to content

Upgrade a Druxt site

Move a 0.x site to Druxt 1.0.0, then use deprecation warnings as the working to-do list for 2.0.0.

Before you start: this guide assumes a working 0.x site. For what the version numbers promise, see Support and versioning.

0.x to 1.0.0

1.0.0 declares stability rather than changing behaviour: it is not a breaking release, and a site current on the last 0.x releases upgrades by bumping versions. Update every druxt* package together so the versions stay aligned:

npm update druxt druxt-site

List the ones your package.json actually names; a partial bump across druxt packages is the main thing to avoid. Then build and browse the site in development mode:

npm run dev

Read the warnings

Deprecated APIs keep working through every 1.x release, and each use logs a console warning naming its replacement:

[druxt] The `hash` argument for `druxt/addResource` has been deprecated,
see https://app.feature-docs-review-5.druxtjs-org.au2.amazee.io/modules/druxt/deprecations#druxtstore-addresource-hash

Browse your site's main pages with the browser console open, and watch the terminal running npm run dev for the server-side render. Each warning links its ledger entry, which states the replacement and the removal version:

The 2.0.0 to-do list

Everything deprecated in 1.x is removed in 2.0.0, so the warnings you just collected are your migration list, and each can be fixed now: the replacements already work on 1.x. A site that renders warning-free today has no code changes waiting in the removal queue.

Where to go next