Skip to content
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

Investigate setup and use of wp data #45

Closed
jconroy opened this issue Nov 3, 2020 · 8 comments
Closed

Investigate setup and use of wp data #45

jconroy opened this issue Nov 3, 2020 · 8 comments
Assignees

Comments

@jconroy
Copy link
Member

jconroy commented Nov 3, 2020

Look into whether there is any base setup we need to implement WooCommerce Admin data store and utilities.

WordPress’ data module serves as a hub to manage application state for both plugins and WordPress itself, providing tools to manage data within and between distinct modules. It is designed as a modular pattern for organizing and sharing data: simple enough to satisfy the needs of a small plugin, while scalable to serve the requirements of a complex single-page application.

https://www.npmjs.com/package/@wordpress/data

Some great reading https://unfoldingneurons.com/2020/wordpress-data-series-overview-and-introduction (which is linked from an internal post p90Yrv-1Ay-p2 )

Also in consideration with investigating integrating with AssetDataRegistry - where it can be used to pre-hydrate the store (it was suggested we might need to look at the AssetDataRegistry)


We'll likely need to create a few different data stores as we develop the UI:

  • Merchange Center Onboarding? / Ads Onboarding?
  • Product/Offer Data?
  • General plugin settings? Or options?
@jconroy jconroy changed the title Investigate using wp data Investigate setup and use of wp data Nov 3, 2020
This was referenced Nov 11, 2020
@jconroy
Copy link
Member Author

jconroy commented Nov 12, 2020

I need to check with the wc-admin folks if we can use the woocommerce/data package or if we should be building out something for ourselves from wordpress/data.

I put together a quick example today and it was requiring me to have a bunch of extra dependencies it doesn't seem like we'd need

@tomalec tomalec self-assigned this Nov 13, 2020
@jconroy
Copy link
Member Author

jconroy commented Nov 16, 2020

if we can use the woocommerce/data package or if we should be building out something for ourselves from wordpress/data.

We can use the stores in woocommerce/data 👍 So likely won't need to set up stores ourselves for options etc. but probably makes sense for our own onboarding

it was requiring me to have a bunch of extra dependencies it doesn't seem like we'd need

Apparently they are needed woocommerce/woocommerce-admin#5636


New package coming to help with dependency extraction https://github.com/woocommerce/woocommerce-admin/tree/main/packages/dependency-extraction-webpack-plugin (I couldn't get it to work for us.)

@tomalec
Copy link
Member

tomalec commented Nov 20, 2020

Are there any hidden docs for @woocommerce/data? The README.md is extremely limited, and there are no JSDocs.
I tried https://woocommerce.github.io/woocommerce-admin/#/ and https://woocommerce.github.io/code-reference/.
And I find nothing, but the code to read with almost no code comments :(

@jconroy
Copy link
Member Author

jconroy commented Nov 20, 2020

Hey @tomalec have you taken a look at

Some great reading https://unfoldingneurons.com/2020/wordpress-data-series-overview-and-introduction (which is linked from an internal post p90Yrv-1Ay-p2 )

@tomalec
Copy link
Member

tomalec commented Nov 20, 2020

Yes, I did, they give a nice overview of wp-data. What I look for is a more detailed documentation of each and every feature/export for woocommerce/data.

@tomalec
Copy link
Member

tomalec commented Nov 20, 2020

I'm looking for something like https://developer.wordpress.org/block-editor/packages/packages-data/ but for woocommerce-data.

@jconroy
Copy link
Member Author

jconroy commented Nov 20, 2020

Unfortunately, I don't think there is anything more detailed.

One thing that I just saw flagged this morning is there is a new package coming WordPress/gutenberg#26866

@ecgan
Copy link
Member

ecgan commented Feb 10, 2021

I'm closing this issue. We are using wp-data since #138.

@ecgan ecgan closed this as completed Feb 10, 2021
@ecgan ecgan self-assigned this Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants