google / blockly

The web-based visual programming editor.
https://developers.google.com/blockly/
Apache License 2.0
12.52k stars 3.72k forks source link

refactor: Move functions into FieldDropdown. #8634

Closed gonfunko closed 2 weeks ago

gonfunko commented 3 weeks ago

The basics

The details

Resolves

Fixes #6349

Proposed Changes

This PR moves several functions that were in field_dropdown.ts, not exported, and used only by FieldDropdown, to simply be members of the FieldDropdown class in order to allow subclasses to override them.

gonfunko commented 3 weeks ago

I admit that I am mildly concerned about arbitrarily increasing the size of our API, but this seems to be in aid of a good cause.

Is anything here breaking? If not, why not do this in v11? (If it is, then PR title needs updating.)

Nothing here is breaking - there are no changes to behavior, it's just moving functions that were inaccessible into the class. I suppose in theory if somebody had a subclass that happened to have added methods with these names there would be an issue, but that feels like a stretch. Rebased to develop as well.