Skip to content

fix: scriptlets with comments #2749

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

Merged
merged 3 commits into from
Jul 31, 2025
Merged

fix: scriptlets with comments #2749

merged 3 commits into from
Jul 31, 2025

Conversation

LuLaValva
Copy link
Member

Because of the way comments are handled in the babel AST, when a scriptlet contains just comments and no statements they are lost at the compiler. This semi-hacky solution adds and empty statement when this is the case, which includes them as trailingComments

@LuLaValva LuLaValva requested a review from DylanPiercey July 30, 2025 20:33
@LuLaValva LuLaValva self-assigned this Jul 30, 2025
Copy link

changeset-bot bot commented Jul 30, 2025

🦋 Changeset detected

Latest commit: 08385bc

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

This PR includes changesets to release 1 package
Name Type
@marko/compiler 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

codecov bot commented Jul 30, 2025

Codecov Report

❌ Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.02%. Comparing base (696cdd1) to head (08385bc).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/compiler/src/babel-utils/parse.js 77.77% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2749      +/-   ##
==========================================
- Coverage   88.03%   88.02%   -0.01%     
==========================================
  Files         362      362              
  Lines       44453    44459       +6     
  Branches     3412     3412              
==========================================
+ Hits        39133    39137       +4     
- Misses       5295     5297       +2     
  Partials       25       25              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

@LuLaValva LuLaValva force-pushed the scriptlet-with-comments branch from dd0646b to 68bb40c Compare July 31, 2025 21:22
@LuLaValva LuLaValva merged commit 9e0684f into main Jul 31, 2025
10 of 11 checks passed
@LuLaValva LuLaValva deleted the scriptlet-with-comments branch July 31, 2025 22:34
@github-actions github-actions bot mentioned this pull request Jul 31, 2025
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