Skip to content

Block dev & hot module reloading #36

@cr0ybot

Description

@cr0ybot

The Human Made Webpack Helpers package includes hot module reloading for blocks. Digging into the code, it looks like this is provided by the block-editor-hmr package.

Even though we're using Gulp, Webpack is used under the hood for both the blocks and scripts tasks. It isn't immediately clear to me how the block-editor-hmr package is linked; there's a root hmr.js file that requires it, and the built-in HotModuleReplacementPlugin is added to the Webpack config. Maybe that's all that is required, but the block-editor-hmr package seems to have some unique requirements that certain things are exported from each block script, which looks like an old way of handling blocks all from one central entrypoint. It also hasn't seen an update published to npm for 3 years (though it looks like there is more recent activity in the repo), which could explain the outdated approach.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions