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

Framework: add schemas for themes state tree #3403

Closed
wants to merge 5 commits into from
Closed

Conversation

gwwar
Copy link
Contributor

@gwwar gwwar commented Feb 19, 2016

This adds JSON Schemas to themes, so we can avoid data shape change errors as described in #3101

  • I persisted every sub-tree in themes except themes-list because of transient isFetchingNextPagestate. We can persist this subtree after that is moved someplace else.
  • It doesn't appear that theme-details is currently in use.

Testing Instructions

  • Start Calypso with:
    ENABLE_FEATURES=persist-redux make run
  • In the console set localStorage.debug to calypso:state
  • Navigate to calypso.localhost:3000/design
  • Refresh the page.
  • Themes behaves normally and loads the persisted themes data from IndexedDB storage

Bonus:

  • Invalidate one of the themes schema by adding required: [ 'foo' ]
{
    type: 'object',
    required: [ 'foo' ],
    properties: { 
         //.... 
    }
}
  • Navigate to calypso.localhost:3000/design
  • Refresh the page.
  • A console warning is printed, letting us know that themes had some invalid data.
  • The Themes page still loads and works normally.

cc @ockham @aduth @artpi @retrofox @mtias @rralian

@gwwar gwwar added [Feature Group] Appearance & Themes Features related to the appearance of sites. Framework [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Type] Task labels Feb 19, 2016
@gwwar gwwar self-assigned this Feb 19, 2016
@gwwar gwwar added this to the Calypso Core: Offline 5 milestone Feb 19, 2016
@gwwar gwwar force-pushed the add/persist-themes branch from 3153952 to e3b3607 Compare February 27, 2016 01:32
@gwwar
Copy link
Contributor Author

gwwar commented Feb 27, 2016

@seear @aduth @rralian This is ready for another look

@seear
Copy link
Contributor

seear commented Feb 29, 2016

It doesn't appear that theme-details is currently in use.

theme-details is now in use (in dev and wpcalpyso.wordpress.com) though is very much 'in progress' with the schema likely to change, so we should probably not persist this until the feature is finished.

@gwwar
Copy link
Contributor Author

gwwar commented Feb 29, 2016

Thanks for the update @seear, I'll rebase this and not persist theme-details after going through review pings.

@gwwar gwwar added [Status] In Progress and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Feb 29, 2016
@gwwar
Copy link
Contributor Author

gwwar commented Mar 16, 2016

Closing this out due to time elapsed. I'll start fresh with a different PR

@gwwar gwwar closed this Mar 16, 2016
@gwwar gwwar deleted the add/persist-themes branch March 22, 2016 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature Group] Appearance & Themes Features related to the appearance of sites. Framework [Type] Task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants