Skip to content

feat: add grid preference migrations - #21

Open
fabric0de wants to merge 1 commit into
mainfrom
feat/preference-migrations
Open

feat: add grid preference migrations#21
fabric0de wants to merge 1 commit into
mainfrom
feat/preference-migrations

Conversation

@fabric0de

Copy link
Copy Markdown
Contributor

Summary

  • Add explicit, sequential, forward-only migrations for persisted grid preferences.
  • Integrate migrations with parseGridPreferences and readGridPreferences.
  • Reject incomplete, duplicate, malformed, unsupported, future, or throwing migration chains safely.
  • Preserve the existing normalization of column visibility, sizing, ordering, pinning, and grid density.
  • Re-export the preference migration APIs from the React, Vue, and Svelte UI packages.
  • Add task-oriented documentation for preference storage, schema upgrades, storage-key decisions, and column allowlists.

Public API

  • Add GridPreferencesMigration.
  • Add GridPreferencesParseOptions.
  • Add migrateGridPreferences(value, migrations).
  • Extend parseGridPreferences(value, options) with migration support.
  • Extend readGridPreferences(storage, key, options) with migration support.
  • Re-export the new APIs from:
    • @open-grid/react-ui
    • @open-grid/vue-ui
    • @open-grid/svelte-ui

Behavior

  • Migrations must be sequential and forward-only.
  • Each migration result must match its declared target version.
  • Missing migration steps reject the stored payload.
  • Duplicate source versions reject the migration configuration.
  • Unsupported target versions and future schemas are rejected.
  • Exceptions thrown by product migrations are contained and return null.
  • Migrated preferences are normalized against the current column allowlist.
  • Sorting, filters, pagination, selection, focus, and editing remain excluded from persisted preferences.

Documentation

  • Add docs/preferences.md.
  • Update the React, Vue, and Svelte integration guides.
  • Update architecture documentation and the public roadmap.
  • Update README.md and CHANGELOG.md.

Verification

  • Tests cover successful preference migrations.
  • Tests cover missing, duplicate, malformed, unsupported, and throwing migrations.
  • pnpm test && pnpm check passes.
  • pnpm build passes.
  • pnpm api:check passes.
  • pnpm docs:build passes.
  • Public API contracts are updated for all framework packages.
  • pnpm benchmark:bundle:check passes all required package budgets.
  • Primitives gzip is 13.97 KiB against a 14.65 KiB required limit.
  • CHANGELOG.md is updated.
  • No generated .benchmark-results/, .release/, credentials, or private data are included.

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

Successfully merging this pull request may close these issues.

1 participant