-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Open
Labels
Needs Technical FeedbackNeeds testing from a developer perspective.Needs testing from a developer perspective.[Feature] Block APIAPI that allows to express the block paradigm.API that allows to express the block paradigm.[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Description
Description
viewScriptModule file defined in the block.json is meant to be loaded only in the frontend when the block is displayed but right now is also being loaded in the block editor
Step-by-step reproduction instructions
- Go to the plugins folder of a WordPress instance
- Run
npx @wordpress/create-block@latest demo-iapi-block --template @wordpress/create-block-interactive-templateto quickly create a block with aviewScriptModuledefinition - Enter into that folder (
cd demo-iapi-block), install dependencies (npm install) and run the build process (npm run build) - Activate the plugin, open any post and insert
Demo Iapi Block - Save and reload the Block Editor
Current behaviour
view.js defined as viewScriptModule is loaded in the Block Editor
Expected behaviour
view.js defined as viewScriptModule should not be loaded in the Block Editor. It should only be loaded in the frontend when the block is displayed.
Screenshots, screen recording, code snippet
No response
Environment info
- WP Version: 6.8.3
- Tested with WordPress Studio and
wp-env - No other plugins activated
Please confirm that you have searched existing issues in the repo.
- Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
- Yes
Please confirm which theme type you used for testing.
- Block
- Classic
- Hybrid (e.g. classic with theme.json)
- Not sure
Metadata
Metadata
Assignees
Labels
Needs Technical FeedbackNeeds testing from a developer perspective.Needs testing from a developer perspective.[Feature] Block APIAPI that allows to express the block paradigm.API that allows to express the block paradigm.[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended