github dataform-co/dataform 2.6.6
2.6.6: Enforce tighter requirements around "automatic" importing of `includes` files

latest releases: 3.0.0, 3.0.0-beta.6, 3.0.0-beta.5...
10 months ago

We have fixed two bugs which inadvertently loosened our (expected) requirements around usage of "automatic" includes imports.

For context: in general, to reference the contents of a file in includes (specifically a file's module.exports object), the callsite should call require() on that file, e.g. const foo = require("includes/subdirectory/foo.js");.

Dataform simplifies this for "top-level" includes files, i.e. direct children of the includes directory, by automatically making these files available globally. For example, in order to use includes/foo.js, a callsite does not need to require("includes/foo.js"); instead, a foo object is made available to all Dataform code in the project.

Two bugs have been found and fixed:

  1. includes files can no longer implicitly depend on other includes files
  2. only top-level includes files are now automatically available globally

This unfortunately results in a potentially breaking change to some Dataform projects - but this will only happen upon upgrading @dataform/core to >= 2.6.6.

In order to fix any breakages, the calling file must be changed to explicitly require() the relevant includes file.

For example, in SQLX:

js {
  const whatever = require("includes/subdirectory/whatever.js");
}

Or in JavaScript:

const whatever = require("includes/whatever.js");

For more context, see https://issuetracker.google.com/issues/296162656#comment3.

Don't miss a new dataform release

NewReleases is sending notifications on new releases.