It would be nice if contributors could quickly see where to go if they want to:
We could:
I like adding it at the top of the built files so when folks are looking through the code to figure out how something works, it is right there. The readme file in the blocks directory would be my second.
@sirreal Do you think that is something we could do in Calypso when building the blocks, with something like Webpack's BannerPlugin?
It does look like something that wouldn't be too difficult with the BannerPlugin and placeholders:
https://webpack.js.org/plugins/banner-plugin/#placeholders
This _should_ be simple so we _should_ be able to get this ready for the next release, but I don't have time right now so I'll leave this issue up for grabs.
A few thoughts…
editor.js files, index.json and index-beta.json further complicate things. A banner /*! */ comment in editor.js would be compiled for Calypso but not for the bundle. Adding a shared file that only contains a comment would require a fair amount of logic to get it into the editor bundle and the individual view files.I'm not sure what the best way forward is right now 😞
cc: @Automattic/luna @Automattic/poseidon
I would say lets go with the minimum which is to add readme into the preset. Which then gets added to jetpack/_inc/blocks.
We can always add more info later if we need to.
+100 for a simple approach as a first iteration.
We also might need to figure out also how to ship non-minified versions of bundles to Jetpack, so that folks have easier time to debug clashes with our scripts with WP_DEBUG turned on.
@jeherve do you recon the readme is enough and this could be closed?
https://github.com/Automattic/jetpack/tree/fbc64c64878dc2c88b2605b3464244d477219180/extensions
Yeah, I think that's fine now that the files live in the repo.
Most helpful comment
A few thoughts…
editor.jsfiles,index.jsonandindex-beta.jsonfurther complicate things. A banner/*! */comment in editor.js would be compiled for Calypso but not for the bundle. Adding a shared file that only contains a comment would require a fair amount of logic to get it into the editor bundle and the individual view files.I'm not sure what the best way forward is right now 😞
cc: @Automattic/luna @Automattic/poseidon