
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
ember-named-blocks-polyfill
Advanced tools
A polyfill for the Yieldable Named Blocks feature in Ember.
This addon provides a polyfill for the Yieldable Named Blocks feature. On Ember.js versions with native support for the feature (3.25+), this addon is inert.
ember install ember-named-blocks-polyfill
To pass named blocks to a component:
<FancyList @items={{@model}}>
<:header>This list is <em>fancy</em>!</:header>
<:row as |item|>
{{#if item.isHotTip}}
<h2>Hot Tip™</h2>
<p>{{item}}</p>
{{/if}}
</:row>
</FancyList>
To yield to named blocks:
<header class="fancy-list-header">
{{yield to="header"}}
</header>
<ul>
{{#each @items as |item|}}
<li>{{yield item to="row"}}</li>
{{/each}}
</ul>
{{#if (has-block "footer")}}
{{yield to="footer"}}
{{else}}
<footer>Powered by <FancyList></footer>
{{/if}}
See the RFC for more information on the named blocks feature.
This addon aims to be a high fidelity polyfill both in syntax and semantics. However, there are some minor limitations:
It is not currently possible to pass an <:else>
or <:inverse>
named
block. See #1.
When passing only named blocks (without passing a <:default>
block) to an
addon component whose template was not preprocessed by this polyfill,
{{has-block}}
in that component's template will return true
.
This is unlikely to be an issue in practice – if you are running an Ember version that requires this polyfill and the addon itself is not also using the polyfill, it problably means that the addon component you are invoking does not accept named blocks anyway, so there is no use in passing them.
See #4.
See the Contributing guide for details.
This project is licensed under the MIT License.
FAQs
A polyfill for the Yieldable Named Blocks feature in Ember.
The npm package ember-named-blocks-polyfill receives a total of 0 weekly downloads. As such, ember-named-blocks-polyfill popularity was classified as not popular.
We found that ember-named-blocks-polyfill demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.