Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the signature of class static fields as functions #2840

Merged
merged 4 commits into from Mar 25, 2024

Conversation

carbonrobot
Copy link
Contributor

@carbonrobot carbonrobot commented Mar 22, 2024

Changes static fields that were defined as inline functions to avoid problems with some transpilers.

In components defined as classes, some static fields were defined as inline functions.

// source code
static getBaseProps = (props) => getBaseProps(props, fallbackProps);

// transpiled
static (0, $csb___helper_methods.getBaseProps) = props => (0, $csb___helper_methods.getBaseProps)(props, fallbackProps)

This PR changes those to plain functions in order to prevent a syntax error in transpilers that do not specify a default name for anonymous functions.

// source code
static getBaseProps(props){
  return getBaseProps(props, fallbackProps);
}

// transpiled
static getBaseProps = function (props) {
  return (0, $csb___helper_methods.getBaseProps)(props, fallbackProps);
};

Published victory@37.0.1-next.2 pre release package

Working Codesandbox

Fix for #2839

Copy link

changeset-bot bot commented Mar 22, 2024

🦋 Changeset detected

Latest commit: cb10a61

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 31 packages
Name Type
victory-area Patch
victory-axis Patch
victory-bar Patch
victory-box-plot Patch
victory-brush-container Patch
victory-candlestick Patch
victory-create-container Patch
victory-cursor-container Patch
victory-errorbar Patch
victory-histogram Patch
victory-legend Patch
victory-line Patch
victory-native Patch
victory-pie Patch
victory-polar-axis Patch
victory-scatter Patch
victory-selection-container Patch
victory-tooltip Patch
victory-voronoi Patch
victory-voronoi-container Patch
victory-zoom-container Patch
victory-brush-line Patch
victory-canvas Patch
victory-chart Patch
victory-core Patch
victory-group Patch
victory-shared-events Patch
victory-stack Patch
victory-vendor Patch
victory Patch
victory-docs Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link

vercel bot commented Mar 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
victory ⬜️ Ignored (Inspect) Visit Preview Mar 22, 2024 9:44pm

@carbonrobot carbonrobot changed the title fix/static fields Fix the signature of class static fields as functions Mar 22, 2024
@carbonrobot carbonrobot merged commit 06b9f31 into main Mar 25, 2024
9 checks passed
@carbonrobot carbonrobot deleted the fix/static-fields branch March 25, 2024 14:33
@victory-ci victory-ci mentioned this pull request Mar 25, 2024
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.

None yet

2 participants