Skip to content

Experimental support for HMR

Compare
Choose a tag to compare
@thetutlage thetutlage released this 15 Apr 10:58
· 12 commits to develop since this release

Alright, so we have finally landed support for HMR in experimental mode. Once you upgrade the @adonisjs/core and the @adonisjs/assembler packages to their latest releases, you can start using the HMR mode.

This is what you need to do.

npm i -D hot-hook @adonisjs/assembler@latest
npm i @adonisjs/core@latest

Next update the package.json file with the following configuration

"hotHook": {
    "boundaries": [
      "./app/controllers/**/*.ts",
      "./app/middlewares/*.ts"
    ]
  }

And start the HTTP server as follows.

node ace serve --unstable-hmr

If you use npm scripts, then make sure to update the dev script as well in the package.json file.

{
  "scripts": {
    "dev": "node ace serve --unstable-hmr"
  }
}

Commits

  • Merge pull request #4504 from adonisjs/feat/hmr (e472091)
  • refactor: remove unused symbols (fbdae40)
  • chore: update dependencies (4a9d201)
  • Merge branch 'develop' into feat/hmr (9b2aadc)
  • refactor: move to --unstable-hmr flag (cdc266a)
  • test: add test (6c2bff9)
  • feat: add serve --hmr flag (3e11c21)

What's Changed

Full Changelog: v6.6.0...v6.7.0