Skip to content

Some quick tips on updating the upstream Gutenberg packages? #2

@JosephusPaye

Description

@JosephusPaye

Hi @mauricewijnia,

Thanks a lot for your work on this project! I've recently started integrating the block editor into a project of mine and your work here was a great help.

Could you please share (some quick dot points will do) how you go about updating the Gutenberg packages, and what to look out for when doing this?

More details

The script https://github.com/VanOns/block-editor/blob/main/versions.sh that extracts the version numbers of the packages for a local Gutenberg clone is very useful.

I was able to run that after making a slight change (see below), and installed the versions extracted.

versions.sh change

Changed the \d character class to [0-9] due to https://stackoverflow.com/a/3185498

-        VERSION=$(cat $FILE | egrep -o '"version": (".*")' | egrep -o '\d+\.\d+\.\d+')
+        VERSION=$(cat $FILE | egrep -o '"version": (".*")' | egrep -o '[0-9]+\.[0-9]+\.[0-9]+')

I then built the library and fixed a few issues like replacing ReactDOM.render() with createRoot().

Then I ran into other runtime issues that I'm now working my way through, like the one below that occurs whenever a dropdown menu is opened in the editor: it crashes the editor and shows a blank screen:

View error

image

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions