Skip to content

v2.0.0 Beta - new deps, spectron fixes, disabling nodeIntegration

Pre-release
Pre-release
Compare
Choose a tag to compare
@nklayman nklayman released this 09 Jan 21:57
· 304 commits to v2 since this release
f0c7709

Breaking changes

  • The testWithSpectron function requires you pass the spectron module as it's first arg, allowing you to specify the version of spectron to be used. You will need to install spectron as a devDependency
  • Jest tests must be run with testEnvironment set to node, see the examples for more details
  • Node integration is disabled by default

A few major deps were upgraded:
teser-webpack-plugin ^1.1.0 -> ^2.0.0
webpack-chain ^5.0.0 -> ^6.0.0
execa: ^1.0.0 -> ^3.0.0
electron-builder: ^21.2.0 -> 22.2.0

These upgrades may cause breaking changes depending on your specific application.

The internal tests are now run on vue cli v4, and it is recommended that you update your app to vue cli v4 as well.

Fixes and Features

  • Support electron v7, #555
  • nodeIntegration is now optional, #610
  • electron-builder will now work on macos catalina, #617
  • You can now use the proper spectron version, #467
  • Removed fonts duplication in build, #694

Known Issues

  • #647: stopServe() in testWithSpectron() may throw setTimeout(...).unref is not a function

Migrating a v1.x project:

  1. In your background.(js|ts), replace nodeIntegration:true with:
// Use pluginOptions.nodeIntegration, leave this alone 
// See https://github.com/nklayman/vue-cli-plugin-electron-builder/blob/v2/docs/guide/configuration.md#node-integration for more info 
   nodeIntegration: process.env.ELECTRON_NODE_INTEGRATION 
  1. If your app requires nodeIntegration, enable it in vue.config.js:
module.exports = {
  pluginOptions: {
    electronBuilder: {
      nodeIntegration: true
    }
  }
}
  1. If you used the testWithSpectron function, install the proper version of spectron according to the version map, and pass the spectron import at the first argument of all of your testWithSpectron calls. See the docs for more details.
  2. If you used jest, set the test environment to node in each electron test file. See the docs for more details.