Skip to main content

Migration Guide

v1.x -> v2.1

version 2

Lage has many changes from 1.x to 2.x. This migration guide will go over major changes and breaking changes since 1.x.

New Features

  • Revamped Website! You're reading it now!
  • New non-npmlog-based default logger
  • The reporter adoLog has been renamed to azureDevops (old name is still useable, just deprecating in the next major version!)
  • WorkerRunner to help make tools like lint or TypeScript run super fast by reusing context (e.g. ESLint instance, TypeScript program) in a dedicated worker. This must be configured per tool; see examples for TypeScript, ESLint, and Jest.

Breaking Changes

  • lage requires Node 16, or using the --experimental-abortcontroller flag in Node 14
  • lage now will automatically write remote cache if the typical environment variable is set (e.g. CI or TF_BUILD)
  • info command is not implemented yet
  • graph command is not implemented yet

Using lage v2 with Node 14

If you're still on Node 14, you can use Lage v2 by wrapping it with a script which passes the --experimental-abortcontroller flag, and using that wrapper in your other scripts.

Relevant parts of package.json (omit the comments):

package.json
jsonc
{
"scripts": {
// cross-env sets environment variables on any platform
"lage": "cross-env NODE_OPTIONS=\"--experimental-abortcontroller\" lage",
// Be sure to use `yarn lage` rather than only `lage` in your other scripts!
"build": "yarn lage build"
},
"devDependencies": {
"cross-env": "^7.0.0",
"lage": "^2.0.0"
}
}
package.json
jsonc
{
"scripts": {
// cross-env sets environment variables on any platform
"lage": "cross-env NODE_OPTIONS=\"--experimental-abortcontroller\" lage",
// Be sure to use `yarn lage` rather than only `lage` in your other scripts!
"build": "yarn lage build"
},
"devDependencies": {
"cross-env": "^7.0.0",
"lage": "^2.0.0"
}
}

v0.x -> v1.x

version 1

Lage is graduating to 1.0.0! We have a breaking change. Namely, the remote cache mechanism is changing. See this PR #172 for details. The behavior is described here. The behavior is changed for remote cache:

  1. lage only write to a remote cache if the environment variable LAGE_WRITE_REMOTE_CACHE is set to true
  2. remote cache now works as a fallback; always reading & writing to the local cache first