Skip to content

Bug/6529 class static block syntax error #6561

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

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from

Conversation

CoyAce
Copy link

@CoyAce CoyAce commented May 2, 2025

📑 Summary

Brief description about the content of your PR.

  1. add --supported flag to disable class static block syntax Resolves version 11 not work < chrome 94 #6529
  2. add --target flag to support customizable build to solve compatibility issues. Related to config: Compatible with low-version browsers. #6458
  3. add --source-map config to disable source map

📏 Design Decisions

Describe the way your implementation works or what design decisions you made if applicable.

  1. current build:mermaid will build all packages, changed to only build parser and mermaid, after mermaid finished, skip others
  2. esbuild treat inline target option and compilerOptions.target option in tsconfig.json differently, tsconfig.json won't work as expected, so added target field to build options to specify language syntax
  3. vite build deprecated, remove ./vite/build.ts to reduce confusion

📋 Tasks

Make sure you

  • 📖 have read the contribution guidelines
  • 💻 have added necessary unit/e2e tests.
  • 📓 have added documentation. Make sure MERMAID_RELEASE_VERSION is used for all new features.
  • 🦋 If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

Copy link

changeset-bot bot commented May 2, 2025

⚠️ No Changeset found

Latest commit: 553fcfa

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

@github-actions github-actions bot added the Type: Bug / Error Something isn't working or is incorrect label May 2, 2025
Copy link

netlify bot commented May 2, 2025

Deploy Preview for mermaid-js ready!

Name Link
🔨 Latest commit 553fcfa
🔍 Latest deploy log https://app.netlify.com/sites/mermaid-js/deploys/681eb2cb82e9960008be3813
😎 Deploy Preview https://deploy-preview-6561--mermaid-js.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

pkg-pr-new bot commented May 2, 2025

Open in StackBlitz

npm i https://pkg.pr.new/mermaid-js/mermaid@6561
npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/layout-elk@6561
npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/mermaid-zenuml@6561
npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/parser@6561

commit: 76c0dad

Copy link

codecov bot commented May 2, 2025

Codecov Report

Attention: Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.

Project coverage is 3.88%. Comparing base (31ba692) to head (76c0dad).

Files with missing lines Patch % Lines
.build/util.ts 0.00% 4 Missing ⚠️
.esbuild/build.ts 0.00% 3 Missing ⚠️
.esbuild/util.ts 0.00% 3 Missing ⚠️
.vite/build.ts 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           develop   #6561      +/-   ##
==========================================
- Coverage     3.88%   3.88%   -0.01%     
==========================================
  Files          412     414       +2     
  Lines        43219   43240      +21     
  Branches       665     666       +1     
==========================================
  Hits          1678    1678              
- Misses       41541   41562      +21     
Flag Coverage Δ
unit 3.88% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
.vite/build.ts 0.90% <0.00%> (ø)
.esbuild/build.ts 0.00% <0.00%> (ø)
.esbuild/util.ts 0.00% <0.00%> (ø)
.build/util.ts 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@CoyAce CoyAce force-pushed the bug/6529-class-static-block branch from 37868dc to bf259ef Compare May 2, 2025 23:25
Copy link

argos-ci bot commented May 2, 2025

The latest updates on your projects. Learn more about Argos notifications ↗︎

Awaiting the start of a new Argos build…

@CoyAce CoyAce closed this May 3, 2025
@CoyAce CoyAce reopened this May 3, 2025
@CoyAce CoyAce force-pushed the bug/6529-class-static-block branch 2 times, most recently from bbafc84 to 24d40cf Compare May 3, 2025 10:30
@CoyAce CoyAce changed the title Bug/6529 class static block Bug/6529 class static block syntax error May 3, 2025
@CoyAce CoyAce marked this pull request as draft May 3, 2025 13:34
@CoyAce CoyAce marked this pull request as ready for review May 3, 2025 13:47
@CoyAce CoyAce force-pushed the bug/6529-class-static-block branch 2 times, most recently from d851632 to 0bc8c4a Compare May 3, 2025 15:49
Copy link
Member

@sidharthv96 sidharthv96 left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution!
Have added some comments to discuss about.

@sidharthv96
Copy link
Member

sidharthv96 commented May 8, 2025

Chrome <=94 is ~1% users, and released 4 years back, I'm not sure if disabling a feature is worth it for these users, as we use other features like structuredClone, which is only supported from 98+.

I'd be much happier to approve the PR if we move both the changes in esbuild under the flag.

image image

CC @knsv @aloisklink

@CoyAce CoyAce force-pushed the bug/6529-class-static-block branch from 530a6b1 to 011cb5d Compare May 9, 2025 13:01
@CoyAce
Copy link
Author

CoyAce commented May 9, 2025

Chrome <=94 is ~1% users, and released 4 years back, I'm not sure if disabling a feature is worth it for these users, as we use other features like structuredClone, which is only supported from 98+.

I'd be much happier to approve the PR if we move both the changes in esbuild under the flag.

image image
CC @knsv @aloisklink

PR updated,

  1. removed .vite/build.ts because this file is used for bundle, no longer needed
  2. reverted vite related changes
  3. added --supported and --source-map flags

Thanks for your help.

@CoyAce CoyAce force-pushed the bug/6529-class-static-block branch 2 times, most recently from 46ced68 to c93ec97 Compare May 9, 2025 15:10
@CoyAce CoyAce requested a review from sidharthv96 May 9, 2025 15:34
@CoyAce CoyAce force-pushed the bug/6529-class-static-block branch from 97d32ec to 86319ce Compare May 9, 2025 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

version 11 not work < chrome 94
2 participants