Automattic / block-experiments

A monorepo of Block Experiments
127 stars 17 forks source link

Layout Grid: Don't write back to `props` in icon #329

Closed dsas closed 12 months ago

dsas commented 1 year ago

Writing to the props passed causes an error if it doesn't already have width and height properties as the object isn't extensible.

This is fixed by copying to an intermediary object and then using that.

This error is fatal - crashes the whole of GB when using current GB trunk (15d644f2)

 Testing steps

  1. Checkout this branch locally
  2. nvm use && yarn install
  3. Build these changes: yarn plugin layout-grid && yarn bundle
  4. Get the built plugin in your test environment
    1. For wpcom unzip the plugin: cd bundles && unzip jetpack-layout-grid.zip && cd jetpack-layout-grid
    2. Then copy it upscp -r * wpcom-sandbox:public_html/wp-content/plugins/gutenberg-blocks/jetpack-layout-grid/
  5. Make your test environment use the latest version of GB, for wpcom see the FGs gutenberg-plugin-on-wpcom

Closes #328

dsas commented 1 year ago

Note that the tests fail, but then they failed before and it looks unrelated so...