Example block should not include Gutenberg in the front end

Created on 3 March 2025, about 1 month ago

Problem/Motivation

This has bit me twice, as I tent to copy this block to make a new one: the example block includes the full Gutenberg library in the front end code by including the same library by default in both edit and view mode:

# Libraries to be added to the node/entity edit form when using Gutenberg editor.
libraries-edit:
  - example_blocks/blocks
# Libraries to be added to the node/entity view.
libraries-view:
  - example_blocks/blocks

This effectively adds the whole Gutenberg library, with React and other dependencies, to the front end code where it in most (all?) cases should not be. It will add around 6-8 mb per request. I'll add a MR with a possible solution.

📌 Task
Status

Active

Version

3.0

Component

Code

Created by

🇳🇴Norway vegardjo

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024