Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Add wp-init and other small adjustments #225

Merged

Conversation

luisherranz
Copy link
Member

What

Add data-wp-init and other small adjustments for this: WordPress/gutenberg#49868

Why

We need a basic version of wp-init, and there are some things that we won't need in Gutenberg.

How

For now, just add the wp-init copying wp-effect but using useEffect with an empty dependency array instead of useSignalEffect. Also add return's to be able to execute callbacks when the elements are removed.

I also removed the DOMContentLoaded event because we will use defer or type="module" in Gutenberg.

I also removed some unnecessary exports.

Copy link
Collaborator

@DAreRodz DAreRodz left a comment

Choose a reason for hiding this comment

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

LGTM! 👍

@DAreRodz DAreRodz merged commit 7bf74a9 into refactoring-for-gutenberg Apr 21, 2023
@DAreRodz DAreRodz deleted the add-wp-init-and-other-small-changes branch April 21, 2023 09:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants