-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create @wordpress/interactivity with the Interactivity API #50906
Changes from 19 commits
2efa328
455396b
b48ac7c
596e4da
bbcd7fa
b24a7fb
97e0278
59ba71b
d80af2d
43af7ab
b19d9f5
e971cd6
02701e9
22d7543
04bf309
91e3fde
75159c4
df8563b
7b1953f
8a10636
ffa40e7
ea033b1
d9561b8
bec4852
8cb572c
1b7ed17
66c4c58
e740fff
2f86561
3ac4a7b
db7686e
4b0b87a
02a46bb
3d1a1c4
294bf69
1ed1e34
8758865
c745063
242a3ba
e409e41
2ad3cae
abf22e5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package-lock=false |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Interactivity | ||
luisherranz marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"name": "@wordpress/interactivity", | ||
"version": "0.1.0", | ||
luisherranz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"description": "API for developing interactive blocks.", | ||
luisherranz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"author": "The WordPress Contributors", | ||
"license": "GPL-2.0-or-later", | ||
"keywords": [ | ||
"wordpress", | ||
"gutenberg", | ||
"interactivity" | ||
], | ||
"homepage": "https://github.com/WordPress/gutenberg/tree/HEAD/packages/interactivity/README.md", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/WordPress/gutenberg.git", | ||
"directory": "packages/interactivity" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/WordPress/gutenberg/labels/%5BFeature%5D%20Interactivity%20API" | ||
}, | ||
"engines": { | ||
"node": ">=12" | ||
}, | ||
"main": "build/index.js", | ||
"module": "build-module/index.js", | ||
"react-native": "src/index", | ||
"dependencies": { | ||
"@preact/signals": "^1.1.3", | ||
"deepsignal": "^1.3.0", | ||
"preact": "^10.13.2" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,10 +3,6 @@ | |
*/ | ||
import { useContext, useMemo, useEffect } from 'preact/hooks'; | ||
import { deepSignal, peek } from 'deepsignal'; | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import { createPortal } from './portals.js'; | ||
|
||
/** | ||
* Internal dependencies | ||
|
@@ -57,16 +53,6 @@ export default () => { | |
{ priority: 5 } | ||
); | ||
|
||
// data-wp-body | ||
directive( 'body', ( { props: { children }, context: inherited } ) => { | ||
const { Provider } = inherited; | ||
const inheritedValue = useContext( inherited ); | ||
return createPortal( | ||
<Provider value={ inheritedValue }>{ children }</Provider>, | ||
document.body | ||
); | ||
} ); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @artemiomorales, could you please take a look at commit bec4852 and check if everything related to the There was a problem after rebasing this branch onto |
||
// data-wp-effect.[name] | ||
directive( 'effect', ( { directives: { effect }, context, evaluate } ) => { | ||
const contextValue = useContext( context ); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same side effects weren't added to the new
@wordpress/interactivity
package. I might cause issues in the long run.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Greg. Added to the roadmap 🙂👍