Skip to content

Conversation

@gonfunko
Copy link
Contributor

The basics

The details

Resolves

Fixes RaspberryPiFoundation/blockly-samples#2587

Proposed Changes

This PR updates field registration to not throw if a field is registered twice. This behavior is optional on the main registry, but is not exposed on the field registry. I considered making it optional here as well and propagating that value through, but I can't think of a reasonable case where, when you register a field, you want it to throw. I assume this was done to warn in case of accidental conflicts, but throwing seems aggressive for that vs a console.log(), and in the case of fields in particular where e.g. a field might be subclassed with the subclasses distributed as packages with no knowledge of each other, the registration code may not even be aware that it would need to allow re-registration.

@gonfunko gonfunko requested a review from a team as a code owner August 11, 2025 22:24
@gonfunko gonfunko requested a review from cpcallen August 11, 2025 22:24
@github-actions github-actions bot added the PR: fix Fixes a bug label Aug 11, 2025
Copy link
Collaborator

@cpcallen cpcallen left a comment

Choose a reason for hiding this comment

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

Sorry I accidentally sat on this review for such a long time!

@gonfunko gonfunko merged commit 3b498d1 into develop Aug 22, 2025
17 checks passed
@gonfunko gonfunko deleted the field-registration branch August 22, 2025 21:55
gonfunko added a commit that referenced this pull request Aug 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: fix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using Field-Grid-Dropdown and Field-Colour Plugins together with Blockly v12

3 participants