Skip to content

v5.0.0

Choose a tag to compare

@graphieros graphieros released this 03 Dec 13:11
· 2 commits to main since this release

grid-plan v5

Breaking changes

The 3D layout now needs an explicit renderer from grid-plan/3d.

In 4.x, the main entry loaded the 3D view lazily. Bundlers still resolve lazy
imports at build time, so Vite and webpack builds failed when three was not
installed, even if showGrid3d was never enabled.

The grid-plan entry no longer references the 3D renderer or three. The
renderer now comes from a separate grid-plan/3d entry, and you pass it to
GridPlan with the new renderer3d prop.

Migrating

2D only: no changes needed. You can now uninstall three if you installed
it only to make the build pass.

3D: keep three installed, import the renderer, and pass it to each
GridPlan that shows the 3D layout:

 <script setup>
 import { GridPlan } from "grid-plan";
+import { Grid3d } from "grid-plan/3d";
 </script>

 <template>
-  <GridPlan :config="{ showGrid3d: true }" />
+  <GridPlan :renderer3d="Grid3d" :config="{ showGrid3d: true }" />
 </template>

If showGrid3d is enabled without renderer3d, the 2D layout still renders.
The 3D layout is skipped and a console warning explains what is missing.

Added

  • grid-plan/3d entry, which exports Grid3d. It still loads three lazily,
    in its own chunk, the first time the 3D layout is displayed.
  • renderer3d prop on GridPlan.
  • GridPlanRenderer3d type. TypeScript only accepts the renderer from
    grid-plan/3d for renderer3d.