From 07a20c4bdec27f784318f1e322e942890c7a72b5 Mon Sep 17 00:00:00 2001 From: Gavin Joyce Date: Thu, 24 Oct 2019 14:52:32 +0100 Subject: [PATCH] Deprecate `{{partial}}` --- content/ember/v3/partial.md | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 content/ember/v3/partial.md diff --git a/content/ember/v3/partial.md b/content/ember/v3/partial.md new file mode 100644 index 00000000..9bf88081 --- /dev/null +++ b/content/ember/v3/partial.md @@ -0,0 +1,40 @@ +--- +id: ember.partial +title: Deprecate `{{partial}}` +until: '4.0.0' +since: '3.15' +--- + +We are deprecating usage of `{{partial}}` in accordance with [RFC #449](https://github.com/emberjs/rfcs/blob/master/text/0449-deprecate-partials.md). + +Partials should be migrated to components. For example, consider the following `quick-tip` partial: + +```hbs +{{! app/templates/application.hbs }} +{{#let (hash title="Don't use partials" body="Components are always better") as |tip|}} + {{partial "partials/quick-tip"}} +{{/let}} +``` + +```hbs +{{! app/templates/partials/quick-tip.hbs }} +

Tip: {{tip.title}}

+

{{tip.body}}

+ +``` + +It can be converted to a component as follows: + +```hbs +{{! app/templates/application.hbs }} +{{#let (hash title="Don't use partials" body="Components are always better") as |tip|}} + +{{/let}} +``` + +```hbs +{{! app/templates/components/quick-tip.hbs }} +

Tip: {{@tip.title}}

+

{{@tip.body}}

+ +```