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

Replaced enum GridLineColor with a const object #12

Merged
merged 1 commit into from
Oct 22, 2024
Merged

Conversation

ccanos
Copy link

@ccanos ccanos commented Oct 21, 2024

enum GridLineColor {
    Bold = "#cccccc",
    Regular = "#e5e5e5",
 }

Is building to:

(function (GridLineColor) {
GridLineColor["Bold"] = "#cccccc";    GridLineColor["Regular"] = "#e5e5e5";})(GridLineColor || (GridLineColor = {}))

Which minified, is:

 (p => (p.Bold = "#cccccc",
        p.Regular = "#e5e5e5"))(void 0 || (s = {}));

And that ends up in a weird JS error in the browser console:
image

We have replaced that enum with just a plain Javascript object:

  const GridLineColor2 = {
    Bold: "#cccccc",
    Regular: "#e5e5e5",
  } as const;

@ccanos ccanos merged commit d78458b into develop Oct 22, 2024
3 of 9 checks passed
@ccanos ccanos deleted the 0.17.1-alkemio-7 branch October 22, 2024 06:35
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