Skip to content

fix widget config immutability#80

Merged
persd merged 3 commits intoastrofrom
fix/widget-config-immutability
Mar 24, 2026
Merged

fix widget config immutability#80
persd merged 3 commits intoastrofrom
fix/widget-config-immutability

Conversation

@persd
Copy link
Copy Markdown
Contributor

@persd persd commented Oct 13, 2025

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses widget config immutability in the Grid Widget component by avoiding in-place mutation of the incoming widgetConfig object, while preserving existing runtime behavior (grid location assignment, CSS class derivation, and hide-widget behavior).

Changes:

  • Clone widgetConfig before augmenting it with gridLocation and potentially updating customClass.
  • Update the rendering logic to consistently use the cloned config (widgetConfigCopy).
  • Bump package version from 4.9.0 to 4.9.1.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/components/Grid/Widget.astro Stops mutating widgetConfig in-place by cloning it, then uses the clone for gridLocation/class logic and rendering.
package.json Version bump to 4.9.1 to release the immutability fix.

@persd persd merged commit 9b180bf into astro Mar 24, 2026
4 checks passed
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.

2 participants