Sponsored Content
The Wayback Machine - https://web.archive.org/web/20210817024835/https://github.com/google/site-kit-wp/issues/997
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

Scaffold googlesitekit-data JS package #997

Closed
felixarntz opened this issue Dec 27, 2019 · 2 comments
Closed

Scaffold googlesitekit-data JS package #997

felixarntz opened this issue Dec 27, 2019 · 2 comments

Comments

@felixarntz
Copy link
Member

@felixarntz felixarntz commented Dec 27, 2019 •

Feature Description

This should be a simple JS package exposing a Site Kit specific data store registry on a global googlesitekit.data (via wp.data.createRegistry()).


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • There should be a JS file googlesitekit-data.js that is registered in PHP as googlesitekit-data.
  • The script should simply expose an "empty" data store registry googlesitekit.data, using @wordpress/data.
  • The script should not have any internal dependencies (e.g. not rely on googlesitekit-api for now) - only the minimum dependencies necessary.

Implementation Brief

  • Create an assets/js/googlesitekit/data folder for the new code to reside in. Place code in these files and make sure they can be imported within the project.
  • assets/js/googlesitekit/data can start by being an empty module that doesn't export anything.
  • In assets/js/googlesitekit-data.js, import assets/js/googlesitekit/data and expose it globally as googlesitekit.data. If the googlesitekit global isn't available, create an empty object and place data inside it as a property.
  • Add webpack external for 'assets/]js/googlesitekit/data' that resolves to googlesitekit.data
  • Add an entry in Assets.php to allow googlesitekit-data to be loaded

Changelog entry

  • Introduce googlesitekit.data registry for JS datastores.
@felixarntz
Copy link
Member Author

@felixarntz felixarntz commented Jan 16, 2020

IB ✅

@felixarntz felixarntz removed their assignment Jan 16, 2020
@tofumatt tofumatt assigned tofumatt and unassigned tofumatt Jan 16, 2020
@tofumatt tofumatt self-assigned this Jan 27, 2020
@tofumatt tofumatt mentioned this issue Jan 27, 2020
6 tasks
@tofumatt tofumatt assigned aaemnnosttv and felixarntz and unassigned tofumatt Jan 27, 2020
@felixarntz felixarntz added this to the 1.3.0 milestone Jan 28, 2020
@cole10up cole10up self-assigned this Jan 28, 2020
@cole10up
Copy link
Collaborator

@cole10up cole10up commented Jan 29, 2020 •

Tested

Checked latest package and confirmed the following source file exists:
image

Content of the source file:
image

Checked the /dist/assets/js directory and also confirmed the file exits:
image

Content of the file:
image

Confirmed from a QA perspective.

@cole10up cole10up removed their assignment Jan 29, 2020
@ThierryA ThierryA removed this from the 1.3.0 milestone Feb 3, 2020
@ThierryA ThierryA added this to the Sprint 15 milestone Feb 3, 2020
@ThierryA ThierryA removed the JSR label Feb 3, 2020
@ThierryA ThierryA removed this from the Sprint 15 milestone Feb 3, 2020
@ThierryA ThierryA added this to the Sprint 16 milestone Feb 3, 2020
@felixarntz felixarntz closed this Feb 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants