Skip to content

Commit

Permalink
Some re-wording
Browse files Browse the repository at this point in the history
  • Loading branch information
cibernox committed Dec 11, 2017
1 parent 0ffe31f commit a2d0224
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions text/0000-remove-application-wrapper.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- Start Date: 2017-12-11
- RFC PR:
- RFC PR: https://github.com/emberjs/rfcs/pull/280
- Ember Issue: (leave this empty)

# Summary
Expand All @@ -10,22 +10,26 @@ Ember apps and tests.
# Motivation

In Ember applications today, applications are anchored to some existing html
element in the page. Usually, this element is the `<body>` of the page, but it
can be configured to be a different element when the application is created,
using the `rootElement` property:
element in the page. Usually, this element is the `<body>` of the document, but it
can be configured to be a different one when the application is defined,
passing a CSS selector to the `rootElement` property:

```js
export default Ember.Application.extend({
rootElement: '#app'
});
```
However, whatever the element is, the application adds an implicit `<div>` wrapper
that it's not requited anymore for technical reasons.

Furthermore, in the past this element was configurable using the `ApplicationView`,
but when views were removed we lost that ability. Right now many apps have to use
selectors like `body > .ember-view` to target this element as there is no way of
adding classes or attributes to it.
However, whatever the root is, the application adds another `<div>` wrapper
that it's not requited anymore. It's just a vestigial reminder of some implementation
detail of how views worked in Ember 1.x. Some sort of wisdom tooth of the original
rendering system that it serves no purpose today.

Furthermore, much like wisdom tooth, it can gives us problems. In the past this element
was configurable using the `ApplicationView`, but when views were removed we lost that
ability. Right now we are stuck with a wrapper element we can't remove and we also can't
modify, which is why some apps target the selector `body > .ember-view` to style this
element.

Similarly, in testing there is another `.ember-view` wrapper inside the
`#ember-testing` container for no good reason.
Expand Down Expand Up @@ -74,11 +78,11 @@ any class or id they want.
# How We Teach This

This addon will be an opt in, but at some point it will become part of
the default blueprint. This, rather than introduced a new concept, *removes*
a new one. Users won't have to google what is the way to remove or customize
the default blueprint. This change, rather than introducing a new concept, it *removes*
an old one. Users won't have to google what is the way to remove or customize
the implicit application wrapper of the app (to sadly discover that is not
even possible), but instead they will just add a wrapper only if they want,
and the same way they would add a wrapper in any other point of their application,
and in the same way they would add a wrapper in any other point of their application,
with regular handlebars.

# Drawbacks
Expand Down

0 comments on commit a2d0224

Please sign in to comment.