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

Replace row_pivots with group_by, column_pivots with split_by, add convert() migration utility #1709

Merged
merged 2 commits into from
Feb 1, 2022

Conversation

texodus
Copy link
Member

@texodus texodus commented Jan 20, 2022

Renames row_pivots to group_by, and column_pivots to split_by, and adds a new method convert() to the @finos/perspective-viewer package which can auto-update layouts to the new format. This is a breaking change, but trivial to mitigate via convert()

From the documentation for convert():

convert(old, options)

A migration utility for @finos/perspective-viewer and @finos/perspective-workspace persisted state objects. If you have an application which persists tokens returned by the .save() method of a Perspective Custom Element, and you want to upgrade Perspective to the latest version, this module is for you! You know who you are!

Say you have a <perspective-viewer> Custom Element from @finos/perspective-viewer>=0.8.3, and have persisted an arbitrary persistence token object:

const old_elem = document.querySelector("perspective-viewer");
const old_token = await old_elem.save();

To migrate this token to the version of @finos/perspective-migrate itself:

import {convert} from "@finos/perspective-viewer";

// ...

const new_elem = document.querySelector("perspective-viewer");
const new_token = convert(old_token);
await new_elem.restore(new_token);

@texodus texodus force-pushed the migration branch 2 times, most recently from b6c2dbc to a413d5e Compare January 20, 2022 02:46
@texodus texodus marked this pull request as ready for review January 20, 2022 02:46
@texodus texodus force-pushed the migration branch 2 times, most recently from 3e1941e to 314c406 Compare January 29, 2022 05:24
@texodus texodus changed the title Add @finos/perspective-migrate Replace row_pivots with group_by, column_pivots with split_by, add convert() migration utility for @finos/perspective-viewer Feb 1, 2022
@texodus texodus changed the title Replace row_pivots with group_by, column_pivots with split_by, add convert() migration utility for @finos/perspective-viewer Replace row_pivots with group_by, column_pivots with split_by, add convert() migration utility Feb 1, 2022
@texodus texodus added breaking enhancement Feature requests or improvements labels Feb 1, 2022
@texodus texodus merged commit 135c84f into master Feb 1, 2022
@texodus texodus deleted the migration branch February 1, 2022 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking enhancement Feature requests or improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant