From fc4b4573724c5b862d1eebb8e734e8130164a64e Mon Sep 17 00:00:00 2001 From: Simon Ihmig Date: Sat, 2 May 2020 14:09:48 +0200 Subject: [PATCH] Fix missing macroGetOwnConfig description This addresses my review [here](https://github.com/emberjs/rfcs/pull/507#pullrequestreview-384764997). --- text/0000-embroider-v2-package-format.md | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/text/0000-embroider-v2-package-format.md b/text/0000-embroider-v2-package-format.md index b7270bc67a..f27781f2a6 100644 --- a/text/0000-embroider-v2-package-format.md +++ b/text/0000-embroider-v2-package-format.md @@ -632,6 +632,25 @@ If you don't pass any arguments, you can get the whole thing (although this make ``` +### Handlebars Macro: macroGetConfig + +The equivalent of the `getConfig` JS macro as a Handlebars helper. Given a dependency `ember-score` exposes this config: + +```json +{ + "items": [{ "score": 42 }] +} +``` + +Then: + +```hbs + +{{! ⬆️compiles to ⬇️ }} + +``` + + ### Handlebars Macro: macroCondition Used as a helper within a block `{{#if}}` or inline `{{if}}`. Just like the JS `macroCondition`, it ensures that branch elimination will happen. @@ -668,7 +687,7 @@ There is one place where `{{#if}}` doesn't work: within "element space". If you `macroMaybeAttrs` exists to conditionally compile away attributes and arguments out of element space: ```hbs -
+
``` It can be placed on both HTML elements and angle bracket component invocations. @@ -678,7 +697,7 @@ It can be placed on both HTML elements and angle bracket component invocations. Like the JS `failBuild` macro. ```hbs -{{#if (macroCondition (dependencySatisfies "some-peer-dep" "^3.0.0")) }} +{{#if (macroCondition (macroDependencySatisfies "some-peer-dep" "^3.0.0")) }} {{else}} {{macroFailBuild "You tried to use but it requires some-peer-dep ^3.0.0"}}