We're publishing client/gutenberg/extensions/presets/jetpack/
to npm as @automattic/jetpack-blocks
.
However, we're currently not stating any of its dependencies in its package.json
. Rather, we're using Calypso's own package.json
file to state some of them (example).
We should change jetpack-blocks
' package.json
to include all of its dependencies, and remove those that aren't otherwise needed by Calypso from the top-level package.json
.
/cc @Automattic/luna @Automattic/team-calypso
The published package doesn't have any dependencies, it bundles everything and is a standalone bundle.
If we start to declare dependencies on the packages, consumers will begin to redundantly install them on npm install
, but never use them from within the bundle.
This is a strange state of affairs. The Jetpack blocks aren't a traditional module in that it's essentially a compiled/bundled application.
The line between Calypso proper and the bundles that it can produce isn't very clear right now. Further along this may become clearer, something like:
I think it's important to separate out the notion of a built bundle, which is meant to be delivered to a browser, and a reuse-able module that's intended to be built into a bundle. Usually npm modules are the latter, not the former. I'd expect Jetpack to depend on modules from Calypso via npm and to use a common build tool itself to produce a bundle.
Closing since we no longer have @automattic/jetpack-blocks.
Most helpful comment
I think it's important to separate out the notion of a built bundle, which is meant to be delivered to a browser, and a reuse-able module that's intended to be built into a bundle. Usually npm modules are the latter, not the former. I'd expect Jetpack to depend on modules from Calypso via npm and to use a common build tool itself to produce a bundle.