WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.4k stars 4.15k forks source link

Docs: Interactivity API - Add @wordpress/interactivity as code requirement #61685

Closed juanmaguitar closed 2 months ago

juanmaguitar commented 4 months ago

As to create a store with the interactivity API we need to do something like...

import { store } from '@wordpress/interactivity';

I think we should add having the @wordpress/interactivity installed as a requirement at Reference Guides > Interactivity API Reference > Requirements of the Interactivity API > Code requirements

We could add another point to ensure this package is installed for the project

npm i @wordpress/interactivity -S
colorful-tones commented 4 months ago

This is definitely a needed clarification. Good catch @juanmaguitar :shipit:

I have one nitpick, and I leave it to your discretion, but I prefer not to use shortened command-line flags because some folks who may be newer to npm might now know what the shortened flags are, and it is just easier to be explicit. So, maybe: npm install @wordpress/interactivity --save?

juanmaguitar commented 4 months ago

So, maybe: npm install @wordpress/interactivity --save

Yes, I agree that would be much more clear 👍