Skip to content

v1.4.0

Compare
Choose a tag to compare
@rsms rsms released this 12 Mar 20:14
· 23 commits to master since this release
  • Improved file rename and move tracking; Estrella now tracks and handles rename of entryPoint files during -watch mode (only verified on macOS). #29
  • Breaking API change to the watch function (see details below)
  • Makes detection of CLI mode more robust. #31
  • Fixes a bug specific to Microsoft Windows where in some cases the default "projectID" would interfere with file system rules. #15
  • An internal change to how define entries in BuildConfig are handled might cause some build scripts to behave differently. See below for details. #23
  • Improved source maps. You can now embed the source code into the source map by setting sourcesContent:true in your build config. #28
  • Fixes a minor bug where a BuildProcess promise would resolve to undefined, when in watch mode and the user calls cancel() on the promise. This would effectively look like the build failed while in practice cancelling the build should not signal failure.
  • Fixes an issue where custom watchers (from the watch function) would react to self-originating file modifications.

Breaking API change to WatchCallback

WatchCallback used with the watch function now receives a list of objects describing file changes in more detail. In Estrella <=1.3x this function received a list of strings.

If you use watch here's an example of how to quickly update your code to work with Estrella >=1.4:

Before: (for Estrella <=1.3x)

watch(".", watchOptions, filenames => {
  doSomethingWithFilenames(filenames)
})

After: (for Estrella >=1.4.0)

watch(".", watchOptions, changes => {
  doSomethingWithFilenames(changes.map(c => c.name))
})

Note: This does not affect the onStart callback which continues to receive a plain list of filenames.

Change in behavior of BuildConfig.define

An internal change to how define entries in BuildConfig are handled might cause some build scripts to behave differently.
Prior to Estrella 1.4.0, values assigned to define would be implicitly JSON encoded. For example, {define:{foo:"window"}} would be equivalent to const foo = "window" in the compiled output. With Estrella 1.4.0 the same define config is equivalent to const foo = window (notice that window is a name here, not a string.)

Here's how you can fix up a build script making use of define:

Before: (for Estrella <=1.3x)

const version = "1.2.3"
build({
  define: { VERSION: version }
})

After: (for Estrella >=1.4.0)

const version = "1.2.3"
build({
  define: { VERSION: JSON.stringify(version) }
})

The rationale here is that sometimes you want to define a name with a variable value from the environment. For example, you could do this now to load a JSON file at runtime: define:{ somedata: "require('somedata.json')" } (which in prior versions of Estrella would end up just naming the string "require('somedata.json')".)