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

Implement modern arguments support for dynamic tags #1259

Merged
merged 1 commit into from
Feb 14, 2019

Conversation

DylanPiercey
Copy link
Contributor

@DylanPiercey DylanPiercey commented Feb 14, 2019

Description

This PR makes it so that all arguments passed to the dynamic tag are prepended to the params available as tag params, that is:

<${input.renderBody}("a", "b") c d/>

When provided a render with params could receive:

<above-tag|firstArg, secondArg, attrs|>
</above-tag>

This means that it is possible via the dynamic tag to reimplement things like <for|item, index, all| in userland.

Note: This is only possible and non breaking because previously <${dynamic}(arguments)> did not parse properly. This parsing issue has been resolved, adding support for this with custom tags is not possible as it will be breaking but is planned for Marko 5.

Checklist:

  • I have read the CONTRIBUTING document and have signed (or will sign) the CLA.
  • I have updated/added documentation affected by my changes.
  • I have added tests to cover my changes.

@codecov
Copy link

codecov bot commented Feb 14, 2019

Codecov Report

Merging #1259 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1259      +/-   ##
==========================================
+ Coverage   90.47%   90.47%   +<.01%     
==========================================
  Files         336      336              
  Lines       12348    12351       +3     
==========================================
+ Hits        11172    11175       +3     
  Misses       1176     1176
Impacted Files Coverage Δ
src/runtime/helpers.js 94.16% <100%> (+0.09%) ⬆️
src/compiler/ast/CustomTag.js 84.18% <100%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2ebe7b7...727acb1. Read the comment docs.

@mlrawlings mlrawlings merged commit bfe194d into master Feb 14, 2019
@coveralls
Copy link

Coverage Status

Coverage increased (+0.002%) to 90.479% when pulling 727acb1 on dynamic-tag-modern-arguments into 2ebe7b7 on master.

@DylanPiercey DylanPiercey deleted the dynamic-tag-modern-arguments branch July 8, 2019 17:22
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.

3 participants