Commit Graph

4 Commits

Author SHA1 Message Date
gziolo 56e4bf827d Build: Remove polyfills from block view scripts
Related changes in Gutenberg: https://github.com/WordPress/gutenberg/pull/35038.

When adding a block with a view.js script, the frontend loads an additional ~20kb of scripts that were previously not there. These are coming from polyfills that are defined as a dependency for view.js scripts.
Since WordPress dropped support for IE, these polyfills are no longer needed and can be removed.

Follow-up to [51501].
See #53690.
Props aristath.


Built from https://develop.svn.wordpress.org/trunk@52011


git-svn-id: http://core.svn.wordpress.org/trunk@51602 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-04 15:57:58 +00:00
gziolo 327852393a Build: Split packages and blocks to their webpack configs
It aligns with the changes proposed added in Gutenberg: https://github.com/WordPress/gutenberg/pull/33293.

The idea here is to split the growing webpack config into two parts: blocks and  packages.

We need to add handling for JavaScript files that are going to be used with blocks on the frontend. They didn't work quite well with the current setup for entry points created for packages.

As part of the effort, it adds support for `viewScript` in `block.json` metadata file that is later translated to `$view_script` in `WP_Block_Type` class and exposed as `view_script` from the REST API endpoint for block types.

Props youknowriad, desrosj, aristath.
Fixes #53690.


Built from https://develop.svn.wordpress.org/trunk@51501


git-svn-id: http://core.svn.wordpress.org/trunk@51112 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-28 10:06:59 +00:00
desrosj 8c3e1e9aa8 Build/Test Tools: Revert [51259-51256,51265].
[51259] introduced a PHP notice that was not actually fixed by [51265]. Reverting these changes in order to investigate further.

See #53397.
Built from https://develop.svn.wordpress.org/trunk@51268


git-svn-id: http://core.svn.wordpress.org/trunk@50877 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-30 02:14:56 +00:00
youknowriad 8e08c569c5 Build: Split packages and blocks to their webpack configs.
This also adds support for the viewScript for blocks fixing 
the PDF preview for file blocks.

Props desrosj, gziolo.
See #53397.

Built from https://develop.svn.wordpress.org/trunk@51259


git-svn-id: http://core.svn.wordpress.org/trunk@50868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-29 15:09:58 +00:00