Git Product home page Git Product logo

Comments (4)

bobbingwide avatar bobbingwide commented on June 23, 2024

See #12 for a summary of required blocks.

from oik-blocks.

bobbingwide avatar bobbingwide commented on June 23, 2024

While developing the Fields block I discovered that the version of ServerSideRender that passes the post_id to the REST API is in wp.editor; not wp.components as currently documented.

The code was changed in PR 8720, but there don't appear to be any deprecation notices.
Each block developed so far should be updated.

Perhaps there should be a summary of where to import components from.

from oik-blocks.

bobbingwide avatar bobbingwide commented on June 23, 2024

If you register a Server Side Rendered block with

supports: { 
customClassName: true, 
className: true }

then you have to ensure that these fields are registered in the PHP.
If you don't then you'll get Error loading block: Invalid parameter(s): attributes when you attempt to complete the Additional CSS Class field.

The problem only occurs in the editor. When the post is displayed there isn't any checking.

Need to confirm what in the client end sets customClassName.

Also, it's not a good idea to set supports.html: true for this type of block.

from oik-blocks.

bobbingwide avatar bobbingwide commented on June 23, 2024

Closing this. I've developed a number of blocks that use Server Side Rendering. I experienced quite a few problems along the way. But I reckon I've got it sussed now. See bobbingwide/oik-bob-bing-wide#42

from oik-blocks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.