Skip to content

chore: Remove dead SVG Polygon/Polyline web points conversion and label examples as not supported on web#9690

Merged
MatiPl01 merged 3 commits into
mainfrom
@matipl01/svg-web-poly-labels
Jun 17, 2026
Merged

chore: Remove dead SVG Polygon/Polyline web points conversion and label examples as not supported on web#9690
MatiPl01 merged 3 commits into
mainfrom
@matipl01/svg-web-poly-labels

Conversation

@MatiPl01

@MatiPl01 MatiPl01 commented Jun 17, 2026

Copy link
Copy Markdown
Member

Polygon and Polyline point animations don't run on web. react-native-svg renders them as native <polygon>/<polyline>, where CSS can't animate points (the points to d path() conversion only takes effect on <path>), so it never had any visible effect.

This PR:

  • Removes the dead web code: the pointsToPathD processor and the Polygon/Polyline web configs, registering both via the shared common config (their appearance props still animate on web, like Line/Pattern/Text).
  • Labels the Same Number of Points example sections iOS/Android only with a short note, matching the already-labeled Different Number of Points sections.

Docs counterpart: #9682

Polygon/Polyline point animations don't run on web: react-native-svg renders
them as native <polygon>/<polyline>, where CSS can't animate `points` (the
points->d workaround only takes effect on <path>). The "Same Number of Points"
sections were unlabeled, implying web support; mark them iOS/Android only with
a short note, matching the already-labeled "Different Number of Points" sections.
@MatiPl01 MatiPl01 self-assigned this Jun 17, 2026
react-native-svg renders Polygon/Polyline as native <polygon>/<polyline> on
web, where CSS can't animate `points`, so aliasing `points` to a `d` path()
keyframe never had any visible effect. Drop the polygon/polyline web configs
and the `pointsToPathD` processor, and register both components via the shared
common config (their appearance props still animate, like Line/Pattern/Text).
Update the affected tests to assert Path's `d` path() wrapping instead.
@MatiPl01 MatiPl01 changed the title chore: Label SVG Polygon/Polyline point examples as iOS/Android only chore: Remove dead SVG Polygon/Polyline web points conversion + label examples Jun 17, 2026
@MatiPl01 MatiPl01 requested review from Copilot and wisniewskij June 17, 2026 12:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 removes web-specific SVG Polygon/Polyline points processing that had no visible effect on web (since react-native-svg renders them as native <polygon>/<polyline> and CSS can’t animate points), and updates examples to clearly indicate platform support.

Changes:

  • Removed the pointsToPathD processor and the Polygon/Polyline web property configs, and stopped exporting them from the SVG web module.
  • Updated SVG CSS support initialization to register Polygon/Polyline via the shared common config (appearance-only animation support on web).
  • Updated web CSS manager/parser tests and labeled the “Same Number of Points” Polygon/Polyline examples as iOS/Android-only with an explanatory note.

Reviewed changes

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

Show a summary per file
File Description
packages/react-native-reanimated/src/css/web/managers/tests/CSSPseudoSelectorsManager.test.ts Updates SVG pseudo-selector test to validate Path d wrapping via the SVG props builder.
packages/react-native-reanimated/src/css/web/managers/tests/CSSAnimationsManager.web.test.ts Updates SVG animation manager test to use Path d wrapping instead of Polygon points conversion.
packages/react-native-reanimated/src/css/web/tests/animationParser.test.ts Removes Polygon pointsd keyframe test and associated builder registration.
packages/react-native-reanimated/src/css/svg/web/processors/polyPoints.ts Deletes dead Polygon/Polyline points conversion helper.
packages/react-native-reanimated/src/css/svg/web/processors/index.ts Stops exporting removed polyPoints processor.
packages/react-native-reanimated/src/css/svg/web/processors/tests/polyPoints.test.ts Deletes tests for removed pointsToPathD.
packages/react-native-reanimated/src/css/svg/web/index.ts Stops exporting removed Polygon/Polyline configs.
packages/react-native-reanimated/src/css/svg/web/configs/polyline.ts Deletes Polyline web config that aliased points to d.
packages/react-native-reanimated/src/css/svg/web/configs/polygon.ts Deletes Polygon web config that aliased points to d.
packages/react-native-reanimated/src/css/svg/init.web.ts Registers Polygon/Polyline under the shared common config (appearance-only on web).
apps/common-app/src/apps/css/examples/animations/screens/animatedProperties/svg/Polyline.tsx Adds web limitation note and iOS/Android labels for “Same Number of Points” section.
apps/common-app/src/apps/css/examples/animations/screens/animatedProperties/svg/Polygon.tsx Adds web limitation note and iOS/Android labels for “Same Number of Points” section.
Comments suppressed due to low confidence (1)

packages/react-native-reanimated/src/css/web/tests/animationParser.test.ts:28

  • If Path is renamed to a test-only component name (to avoid leaking into the global SVG props builder registry), the componentName passed into processKeyframeDefinitions should match the registration.
  test('pads a trailing Z so an open->closed path morph interpolates', () => {
    const result = processKeyframeDefinitions(
      { from: { d: 'M0,0 L10,10' }, to: { d: 'M0,0 L20,5 Z' } },
      'Path'
    );

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MatiPl01 MatiPl01 changed the title chore: Remove dead SVG Polygon/Polyline web points conversion + label examples chore: Remove dead SVG Polygon/Polyline web points conversion and label examples as not supported on web Jun 17, 2026
@MatiPl01 MatiPl01 added this pull request to the merge queue Jun 17, 2026
Merged via the queue into main with commit 6ecae81 Jun 17, 2026
12 checks passed
@MatiPl01 MatiPl01 deleted the @matipl01/svg-web-poly-labels branch June 17, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants