Skip to content

refactor(layers): extract fluent style API into LayerStyleFluent delegate (stage-1 1.1) - #2887

Merged
lzxue merged 1 commit into
masterfrom
refactor/layer-style-fluent
Jul 29, 2026
Merged

refactor(layers): extract fluent style API into LayerStyleFluent delegate (stage-1 1.1)#2887
lzxue merged 1 commit into
masterfrom
refactor/layer-style-fluent

Conversation

@lzxue

@lzxue lzxue commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Extract ~200 lines of fluent style methods from BaseLayer into a dedicated LayerStyleFluent delegate class.

Changes

LayerStyleFluent.ts (new file, +273 lines)

  • Owns all fluent method logic: color / size / texture / rotate / filter / shape / label / animate / style
  • Owns auxiliary logic: updateStyleAttribute / encodeStyle / splitValuesAndCallbackInAttribute
  • Protected members (configService / pendingStyleAttributes / encodeStyles) accessed via ctor-injected getter lambdas for runtime mutability

BaseLayer.ts (+27, −150)

  • 10 fluent methods replaced with thin forwarding wrappers that delegate to this.styleFluent and return this for chaining
  • encodeStyle private method removed (dead code after extraction)
  • updateStyleAttribute / splitValuesAndCallbackInAttribute body replaced with delegation
  • Removed lodashUtil import (no longer needed in BaseLayer)

Verification

  • TypeScript compilation: 0 errors in changed files
  • All 15 core test suites: 197 passed, 0 failed — zero regression

Design

Follows the established delegate pattern from stages 1.3–1.8 (LayerPickingManager, LayerScaleLegend, LayerVisibilityZoom, etc.). Zero API / behavior change.

🤖 Generated with Claude Code

…gate (stage-1 1.1)

Move ~200 lines of fluent style methods (color/size/texture/rotate/filter/
shape/label/animate/style + updateStyleAttribute/encodeStyle/
splitValuesAndCallbackInAttribute) from BaseLayer into a dedicated
LayerStyleFluent delegate class.

- LayerStyleFluent owns all fluent method logic; BaseLayer keeps thin
  forwarding wrappers that delegate and return this for chaining
- Protected members (configService/pendingStyleAttributes/encodeStyles)
  accessed via ctor-injected getter lambdas for runtime mutability
- encodeStyle private method fully extracted (dead code removed from
  BaseLayer); updateStyleAttribute/splitValuesAndCallbackInAttribute
  body replaced with delegation
- Zero API/behavior change; all 197 core tests pass unchanged

Co-Authored-By: Claude <noreply@anthropic.com>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@changeset-bot

changeset-bot Bot commented Jul 27, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e2092de

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@lzxue
lzxue merged commit 589df7c into master Jul 29, 2026
5 checks passed
@lzxue
lzxue deleted the refactor/layer-style-fluent branch July 29, 2026 03:34
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.

1 participant