npm sitespeed.io 27.0.0

latest releases: 34.14.0, 34.13.0, 34.12.1...
17 months ago

27.0.0 - 2023-04-04

Wow it's been many months since I did a new release wih sitespeed.io. I've had a lot to do in my personal life, a lot at work and low energy to finish the big changes I've done in both Browsertime and sitespeed.io. And here it is: 27.0.0. It can still have some rough edges so please report any bugs and I will try to fix them ASAP.

There's been many additions to Browsertime the last months and I'll update the CHANGELOG and make sure the documentation in uptodate the coming weeks.

Breaking changes

The project was transitioned to a pure ESM package both Browsertime #1859 and sitespeed.io #3769. That allow us to stay uptodate with dependencies. This is important for us and will make the project easier to maintain.

CLI users

If you are a command line user and use scripting, you will need to do a change to your scripts or add some extra configuration.

The quick fix: Rename your .js scripting files to .cjs that way NodeJS will treat your file as a common JS file and everything will just work. For example if you have a file names login.js you can rename that to login.cjs and make sure you load that new file. Then sitespeed.io 27.0.0 will just work as before.

The best fix:
Change your code so your scripts also follows ESM. If you have simple scripts you probably just need to change your exports. The old way looked like this:

module.exports = async function(context, commands) {
...
}

change that to:

export default async function (context, commands) {
...
}

If you have more complicated scripts, follow the ESM package guide.

Then rename your file to be named *.mjs. If your file is named collect.js change it to collect.mjs. This is the best fix and will work 100% of the time. That way NodeJS will know that you are using the ESM standard. You can read more in how NodeJs choose to load files.

Another quick fix alternative: As a last alternative add --browsertime.cjs as a parameter to your test. That way the scripting file will be treated as a commonjs file. This is a hack, so to make sure it works, the user that runs Browsertime need to have write privileges to the folder where you have your scripting files. Browsertime will create a package.json file on the same levels as yoru script file. If you already have a package.json there, it will be overwritten.

Non cli users

Documentation coming soon.

Read Sindre Sorhus Pure ESM package guide on how you can move your project.

Plugin creators

Documentattion coming soon. You will need to upgrade your plugin to ESM. You can check how we did it for the Lightouse plugin.

Remove ImageMagick dependency

We moved to use a new Visual Metrics script as default contributed by Gregory Mierzwinski that do not use ImageMagick. Mozilla has used this script for many months and we have internally used it in our test infrastructure since it was first released.

If you run sitespeed.io direct using NodeJs (and not using Docker) you need to install two new Python dependencies OpenCV-Python Numpy. They are used instead of ImageMagick.

python -m pip install --user OpenCV-Python Numpy

If you still want to use ImageMagick you can do that by setting browsertime.visualMetricsPortable false

Fixed

  • All dependencies has been updated to latest versions #3774.

Added

  • A lot of things has happened in Browsertime, checkout the changelog.
  • Updated to Chrome 111, Firefox 111 and Edge 111 in the Docker container.
  • The Lightouse plugin has been updated to Lighthouse 10.

Don't miss a new sitespeed.io release

NewReleases is sending notifications on new releases.