marko-js / marko

A declarative, HTML-based language that makes building web apps fun
https://markojs.com/
MIT License
13.43k stars 646 forks source link

fix: use MarkoTagBody for control flow #2358

Closed DylanPiercey closed 3 weeks ago

DylanPiercey commented 3 weeks ago

Description

Partially revert https://github.com/marko-js/marko/commit/8e07673ca07cc83d9910c68ff8359264015c28d1.

Specifically the control flow tags now have their body content as a MarkoTagBody instead of the attributeTags list. This was done for two reasons:

  1. The for tag needs to have a scope for it's tag parameters which could not properly be reflected on the refactored ast.
  2. Getting rid of the body for the control flow indirectly broke the @marko/tags-api-preview.

Checklist:

changeset-bot[bot] commented 3 weeks ago

🦋 Changeset detected

Latest commit: 2699a2c1c2e5c1a77fb07c00f6361d1e0be38676

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

This PR includes changesets to release 7 packages | Name | Type | | ------------------------------------ | ----- | | @marko/translator-default | Patch | | @marko/translator-tags | Patch | | @marko/babel-utils | Patch | | @marko/compiler | Patch | | marko | Patch | | @marko/runtime-tags | Patch | | @marko/translator-interop-class-tags | 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

codecov[bot] commented 3 weeks ago

Codecov Report

Attention: Patch coverage is 86.99187% with 16 lines in your changes missing coverage. Please review.

Project coverage is 87.91%. Comparing base (0ec5b96) to head (2699a2c). Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/babel-utils/src/tags.js 0.00% 4 Missing :warning:
...ckages/translator-tags/src/util/translate-attrs.ts 73.33% 4 Missing :warning:
packages/compiler/src/babel-plugin/parser.js 93.10% 2 Missing :warning:
packages/translator-tags/src/core/for.ts 84.61% 2 Missing :warning:
.../translator-tags/src/util/nested-attribute-tags.ts 83.33% 2 Missing :warning:
packages/translator-default/src/tag/index.js 85.71% 1 Missing :warning:
...ges/translator-tags/src/visitors/tag/custom-tag.ts 75.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2358 +/- ## ========================================== + Coverage 87.86% 87.91% +0.04% ========================================== Files 343 344 +1 Lines 37664 37672 +8 Branches 2363 2373 +10 ========================================== + Hits 33094 33118 +24 + Misses 4548 4532 -16 Partials 22 22 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.