Easter Update

It’s been 17 years since I started this project (!), and I have a few nice updates to talk about that I’ve been tinkering on over Easter+, let’s go over them briefly.

Automate NPM Releases

After moving locutus to its own org on GitHub, in an effort to make it even more a community, than a solo effort, and giving several people admin access as core contributors, it remained an issue that only one person could push releases to NPM. This has now been fixed. If core contributors push a tag to git, our GHA CI will automatically cut an NPM release.

Change branches

In accordance with the new GitHub default, Locutus has also made the switch from master to main. If you visit the Repo as a contributor, GitHub will show you how to move over locally.

Upgrade deps

Nearly all dependencies have been upgraded. This includes:

  • Yarn 4, now managed by Corepack. If you have node (as of 18), you have corepack, and it will manage package managers for you, even multiple versions alongside one another, as specified by a project’s package.json. Yarn 4 is much faster than previous versions so you can even automatically run it now when switching branches.
  • Hexo, used for building the website
  • ESLint, standardJS

And we added Prettier, for more powerful auto-formatting of code

Improve docs & copy

We clarified CONTRIBUTING.md as well as our README.md, and added remark to automaticallt add table of contents to these files upon yarn fix.

Groom issues

I reviewed all issues and PRs and fixed the ones I could, resulting in the improved functions below. I also installed a Stale action so that issues and PRs will automatically be marked as stale, and then closed if there is no more interest, as to keep a healthy issue board. It’s always possible to continue discussing, and then a stale issue won’t be closed.

Improve functions

  • bin2hex: Add support for multi-byte characters (fixes #427)
  • escapeshellarg: Add Windows support (fixes #395)
  • file_exists: Introduced (in #461, thx @erikn69)
  • fmod: Fix Uncaught RangeError: toFixed() digits argument must be between 0 and 100 (thx @dekairi, fixes #417)
  • strtotime: Add support oracle dates (fixes #340)
  • unserialize: Fix fail when serialized array contains (fixes #458, thx @kukawski)
  • var_dump: Detect circular references (fixes #305)

Improve testing

It’s now possible to write custom tests instead of only writing tests as comments in function headers. For an example see src/php/var/serialize.mocha.js.

We added 'use strict' to generated tests to uncover more issues, and we made it clearer which tests are generated from function header comments.

In CI, we now test against Node 20.

Open Discussion Forum

Check out https://github.com/locutusjs/locutus/discussions/471 :)


All of these things should make it more enjoyable to hack on Locutus, and enable people to progress the project also when I’m not around, which happens :) Hope you’ll like it!