Skip to content

Conversation

@vadimpiven
Copy link
Member

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Jan 29, 2026

🦋 Changeset detected

Latest commit: d729e96

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 17 packages
Name Type
@milaboratories/milaboratories.pool-explorer.model Patch
@platforma-sdk/model Patch
@milaboratories/milaboratories.pool-explorer.ui Patch
@milaboratories/milaboratories.pool-explorer Patch
@milaboratories/pl-model-middle-layer Patch
@milaboratories/pf-driver Patch
@milaboratories/pl-middle-layer Patch
@milaboratories/uikit Patch
@platforma-sdk/test Patch
@platforma-sdk/ui-vue Patch
@milaboratories/milaboratories.monetization-test.model Patch
@milaboratories/milaboratories.monetization-test.ui Patch
@milaboratories/milaboratories.ui-examples.model Patch
@milaboratories/milaboratories.ui-examples.ui Patch
@milaboratories/milaboratories.ui-examples Patch
@platforma-sdk/block-tools Patch
@milaboratories/milaboratories.monetization-test Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@notion-workspace
Copy link

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @vadimpiven, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refines the data model definition within the @platforma-sdk/model package, transitioning to a more structured and version-aware DataModelBuilder approach. This change aims to improve maintainability and facilitate future data migrations. Additionally, it streamlines the development environment by consolidating code formatting and linting under ESLint, replacing previous Prettier configurations.

Highlights

  • Refactored Data Model Creation: The static DataModel.create method has been removed, enforcing the use of new DataModelBuilder().from().init() for all data model instantiations. This change promotes explicit versioning and prepares for robust data migration strategies.
  • Enhanced Data Model Versioning: New utilities like defineDataVersions are introduced, providing a structured and type-safe approach to defining and managing different versions of data models within blocks.
  • Tooling and Formatting Standardization: Prettier configuration files (.prettierignore, .prettierrc) have been removed. A new .zed/settings.json file configures ESLint as a Language Server Protocol (LSP) for JavaScript and TypeScript, enabling format-on-save and standardizing code formatting and linting.
  • Dependency Updates: The package.json and pnpm-lock.yaml files have been updated to include @zed-industries/vscode-langservers-extracted, which supports the new ESLint LSP setup.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refines the DataModel API by introducing a DataModelBuilder for more explicit data versioning, removing the simpler DataModel.create method. The changes are consistently applied across the codebase, including updates to example blocks and documentation. Additionally, the project's formatting tooling seems to have been switched from Prettier to Zed with ESLint, with corresponding formatting updates in several files. My review includes a suggestion to improve the developer experience for simple data models and a code simplification for better readability.

I am having trouble creating individual review comments. Click here to see my feedback.

etc/blocks/sum-numbers-v3/model/src/index.ts (72-74)

medium

The condition to check if sources has elements can be simplified using optional chaining and checking for a truthy length. This makes the code more concise and easier to read.

  .enriches((args) => (args.sources?.length ? [args.sources[0]] : []))

sdk/model/src/block_migrations.ts (399-422)

medium

While the new DataModelBuilder provides a more explicit and powerful way to define data models with versioning, removing DataModel.create makes the common case of a simple, single-version data model more verbose. Previously, it was a single line:
DataModel.create<BlockData>(() => ({...}))

Now it requires multiple lines of boilerplate:

const Version = defineDataVersions({ V1: DATA_MODEL_DEFAULT_VERSION });
type VersionedData = { [Version.V1]: BlockData };
const dataModel = new DataModelBuilder<VersionedData>()
  .from(Version.V1)
  .init(() => ({...}));

To improve developer experience for this common scenario, consider providing a simplified helper. One option is to add a static method to DataModelBuilder for this purpose, which would encapsulate the builder logic for a single-version model. For example:

export class DataModelBuilder<VersionedData extends DataVersionMap> {
  /**
   * Creates a simple DataModel with a single default version.
   */
  static simple<T>(initialData: () => T): DataModel<T> {
    const Version = defineDataVersions({ V1: DATA_MODEL_DEFAULT_VERSION });
    type VersionedData = { [Version.V1]: T };
    return new DataModelBuilder<VersionedData>()
      .from(Version.V1)
      .init(initialData);
  }

  // ... existing from() method
}

This would allow developers to create simple data models with a concise API: DataModelBuilder.simple<BlockData>(() => ({...})).

@vadimpiven vadimpiven enabled auto-merge January 29, 2026 16:00
@codecov
Copy link

codecov bot commented Jan 29, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 53.10%. Comparing base (d8096a8) to head (d729e96).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
sdk/model/src/block_migrations.ts 50.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1405   +/-   ##
=======================================
  Coverage   53.10%   53.10%           
=======================================
  Files         239      239           
  Lines       13369    13368    -1     
  Branches     2736     2736           
=======================================
  Hits         7099     7099           
+ Misses       5368     5366    -2     
- Partials      902      903    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vadimpiven vadimpiven added this pull request to the merge queue Jan 29, 2026
Merged via the queue into main with commit f459e5a Jan 29, 2026
17 checks passed
@vadimpiven vadimpiven deleted the MILAB-5516_5 branch January 29, 2026 16:47
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.

3 participants