GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: Handle regex values when generating types by camdecoster · Pull Request #8010 · plotly/plotly.js

Conversation

@camdecoster

@camdecoster camdecoster commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Description

Update schema type generator to handle regex values in enum attributes.

Closes #8003.

Changes

  • Update generator script to use types in place of regex patterns
  • Update axis number types to be more permissive (and move them)
  • Update generated types

Testing

  • Review the generated types and look for regex patterns
    • This can be done with grep in the project root (from the issue): grep -RF "'/^" src/types/generated/schema.d.ts

Notes

  • These patterns are valid in the schema, but not in TS
  • With no way to use regex to validate a type in TS, it was necessary to build a type that reasonably approximates the pattern (full parity isn't possible because the pattern has no upper bound for the numbers)
  • grid.xaxes, grid.yaxes, and grid.subplots were narrowed from any[] to typed arrays. This is correct, but could break some typing for users that used the more general string[] type.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jendrikw reacted with heart emoji
All reactions
  • ❤️ 1 reaction
camdecoster added 4 commits September 2, 2026 14:57
@camdecoster
fix: Handle regex values when generating types
f4fe890
@camdecoster
Update types
b91a205
@camdecoster
Update doc
1c3c5ca
@camdecoster
Add draftlog
b3257ca
@camdecoster
camdecoster marked this pull request as ready for review September 2, 2026 21:27
@robertclaus robertclaus assigned KoolADE85 Sep 3, 2026
@robertclaus
robertclaus requested a review from KoolADE85 September 3, 2026 19:19
KoolADE85
KoolADE85 previously approved these changes Sep 3, 2026
View reviewed changes

@KoolADE85 KoolADE85 left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Nice improvement! 💃

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@camdecoster
Merge remote-tracking branch 'origin/main' into cam/8003/handle-regex…
8a3d1ea
…-in-types
@camdecoster
camdecoster dismissed KoolADE85’s stale review via 8a3d1ea September 4, 2026 15:42
@camdecoster
camdecoster merged commit a58425a into main Sep 4, 2026
247 of 250 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@camdecoster
camdecoster deleted the cam/8003/handle-regex-in-types branch September 4, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@KoolADE85 KoolADE85 KoolADE85 left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@KoolADE85 KoolADE85

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[BUG]: Type definition uses regex as string literal type

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@camdecoster @KoolADE85
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.