Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Split blocks into separate JS files #305

Merged
merged 1 commit into from Jan 10, 2019
Merged

Conversation

ryelle
Copy link
Member

@ryelle ryelle commented Jan 9, 2019

This lets us use the functionality of register_block_type to automatically enqueue the scripts and styles used by blocks in the editor, and eventually, styles on the frontend as well. Also adds cssnano to minify our CSS.

Why go back to separate files after combining them in #220 ? By having each block as its own file, we can take advantage of the register_block_type php function to automatically enqueue our CSS on the frontend, which will be useful for the Featured Product block, and also when we move to the custom grid display.

There should be no functionality changes.

How to test the changes in this Pull Request:

  1. Load each block, check that they still work as expected.

Note: I need to figure out a solution for separating out editor & front end styles via webpack, but this is eluding me at the moment. This will work for now, so I'm switching to "needs review".

@ryelle ryelle added [Status] In Progress tools Used for work on build or release tools. labels Jan 9, 2019
@ryelle ryelle self-assigned this Jan 9, 2019
@ryelle ryelle requested a review from a team January 10, 2019 01:38
@ryelle ryelle added this to the 1.3.0 Sprint 2 milestone Jan 10, 2019
Copy link
Contributor

@timmyc timmyc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All is functioning as expected for me 👍

This lets us use the functionality of `register_block_type` to automatically enqueue the scripts and styles used by blocks in the editor, and eventually, styles on the frontend as well. Also adds cssnano to minify our CSS.
@ryelle ryelle force-pushed the update/blocks-registration-build branch from a924e2f to 3192168 Compare January 10, 2019 18:09
@ryelle ryelle merged commit ac52ef6 into master Jan 10, 2019
@ryelle ryelle added this to 1.2 Done in WooBlocks via automation Jan 10, 2019
@ryelle ryelle deleted the update/blocks-registration-build branch January 10, 2019 18:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
tools Used for work on build or release tools.
Projects
No open projects
WooBlocks
  
1.2 Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants