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

Remove Application wrapper div #280

Merged
merged 8 commits into from
Jan 3, 2018

Conversation

cibernox
Copy link
Contributor

@cibernox cibernox commented Dec 11, 2017


There is a possibility that removing the wrapper can break styles for some apps,
but since adding the wrapper back is just of editing the `application.hbs` template,
that is probably a despicable drawback.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's despicable! (Daffy duck voice)

debatable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was using it as a synonym of negligible.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor drawback perhaps?

@topaxi
Copy link

topaxi commented Dec 12, 2017

Yess! The current behavior gave me headaches in various styling scenarios.

that is probably a despicable drawback.

There is also a non-zero chance that some testing addon is relying on the `#ember-testing > .ember-view`
html hierarchy for some reason, and those addons would have to be updated.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW qunit-dom supports both cases already via fallback if no ember-view child is found

@sandstrom
Copy link
Contributor

The RFC says "This addon will be opt-in".

Does that mean that there will be an ember-cli addon that will toggle this? I think that would be bad, better to just make it an ember setting/flag. Then make it standard (and remove setting/flag) in the next major release [breaking change].

@cibernox
Copy link
Contributor Author

@sandstrom The addon will only enable a "secret" flag in Ember. It will, as some point, be enabled by default and another addon will exist to disable it. I don't strongly oppose to just make it a flag passed to new EmberApp, but this is also the approach proposed by @chancancode for #278 , so whatever approach we choose, it should be consistent.

@sandstrom
Copy link
Contributor

sandstrom commented Dec 13, 2017

Got it! Although I disagree on this (addon vs setting) I'm still overall in favor of this RFC! 🏅

But sometimes I think ember is making addons out of stuff that should be settings. Some examples from ember-cli:

  • ember-cli-app-version
  • ember-export-application-global
  • ember-welcome-page

@Gaurav0
Copy link
Contributor

Gaurav0 commented Dec 13, 2017

@sandstrom

This is really due to some of the philosophy behind ember, the idea of having zero configuration and strong conventions around opinions.

This way the default way of doing things is presented that can change with time in a manner that eases migration.

When there is a setting and a default value, people are conditioned to consider the setting as something they can configure for their application. They tend to look at all the settings and feel free to customize. They look at defaults as "suggestions". We want them to instead consider the defaults as "conventions", where if you change them, you are making the decision to "stray from the herd".

Another reason is "semver lawyering": if a default of a setting in the core changes, it is a violation of semver. But if an addon is added or removed in a blueprint for a new application, it isn't, "because that is not part of the core".

Yet another reason is that any code for the non-default setting can be (although in this case it won't be) removed from the core and put in the addon if appropriate api hooks in the core are provided.

chancancode added a commit to emberjs/ember.js that referenced this pull request Dec 14, 2017
chancancode added a commit to emberjs/ember.js that referenced this pull request Dec 14, 2017
chancancode added a commit to emberjs/ember.js that referenced this pull request Dec 14, 2017
@chancancode
Copy link
Member

chancancode commented Dec 14, 2017

I have implemented and landed this feature in master (behind a flag), so you can easily test the impact of this on canary now: https://ember-twiddle.com/04ea71656db0c3286d329f81c7eab1a4?numColumns=2&openFiles=twiddle.json%2Cstyles.app.css

(updated link)

@webark
Copy link

webark commented Dec 14, 2017

not that i’m opposed to these changes, but why are we not doing to standard “final comment period” on this before adding it to master? Maybe i’m miss understanding the purpose of the FCP tag though.

@chancancode
Copy link
Member

@webark I should have been more clear. It has landed in master behind a flag. The feature system is designed for this experimental implementation in mind – the code will be stripped in beta and release builds, and even on canary requires opting in (which is the whole purpose of the canary channel).

For this particular change, it's something we (the core team and the community) has wanted for a long time, and the main questions are really around how to roll it out gracefully so it doesn't cause problems in the ecosystem. Having a working implementation allows us to answer those questions much more easily.

This change is also very small and self-contained. Since all the code is already flagged, if we didn't end up wanting this change it would be easy to back it out. (The test changes are a nice refactor regardless.)

@chancancode
Copy link
Member

And to be extra clear, we are still going to explore the options here and eventually going to do a FCP. The feature cannot be enabled before we do that and merging the RFC.

@webark
Copy link

webark commented Dec 14, 2017

Ahhh.. ok cool. Makes sense. Thanks for that clarification @chancancode !

@chancancode
Copy link
Member

👍 The prototypes are hopefully going to make it a lot easy to access the merits and impact of this change. (For example, @kategengler found a potential problem with the template-only components RFC yesterday by testing the interaction between that feature and the Ember Inspector.)

@chancancode
Copy link
Member

This RFC was nominated and approved for Final Comment Period (FCP) yesterday, since most comments have already been replied to. The FCP with last for a week. If there are any substantial new arguments that are brought up during this time, the FCP will be restarted (or aborted). If you haven't reviewed the proposal yet, now would be a great time to do so.

If I may, here is a summary of the main objections:

  1. Should this be an add-on, vs just a setting?

    I think @Gaurav0 summarized it well. The main reason is to allow the flexibility to change the implementation of the flag. For example, in a world where users are building ember in the our build pipeline, we will be able turn this into a build-time feature flag and remove the code and any runtime overhead associated with the unused mode.

Meanwhile, since the feature have landed in canary behind a flag, I encourage you to give it a spin and get a feel for it, either using this Ember Twiddle or by using a canary build with the ember-glimmer-remove-application-template-wrapper feature flag set to true.

@jenweber
Copy link
Contributor

I think this change will be great. I fought with that div in styling before.

What's the best/most likely way that someone would be alerted about this change once it's automatic, sometime in the future? If I upgraded my app and it suddenly looked different, it would take me a while to look at the top level of the DOM for a missing container. Most other version upgrades would throw a warning but this is styling, so it's sneaky.

@chancancode
Copy link
Member

@jenweber the plan is this will be opt-in (by installing the addon) for the timeframe of 3.0. Towards the end of 3.0 we can issue a deprecation warning if you still don’t have it installed yet.


This RFC proposes to add a global flag to remove those wrapper elements,
effectively making the `application.hbs` template have "Outer HTML" semantics, which aligns
well with [the changes recently proposed](#278) for template-only components,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The link to #278 is broken here (lmk if it was left intentionally I'm gonna remove this comment)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, fixed!

@chancancode chancancode self-assigned this Dec 22, 2017
@MelSumner
Copy link
Contributor

This will help Ember apps become more accessible by default.

When certain html5 elements are the direct descendant of the body element, an additional ARIA role is not required.

While ember-a11y-landmarks provides a solution for current applications, I am encouraged to see a RFC that supports better native accessibility.

@chancancode
Copy link
Member

Thanks everyone for your participation! Since no major issues were found during the FCP, we will now close and merge this proposal.

@chancancode chancancode merged commit 595d8e0 into emberjs:master Jan 3, 2018
@wycats wycats mentioned this pull request Jan 7, 2018
chancancode added a commit to emberjs/ember.js that referenced this pull request Jan 24, 2018
These features are enabled by turning them into a runtime flag. These
flags are intended to be set by @emberjs/ember-optional-features. In
the future, these runtime flags might be removed in favor of build-time
flags once the infrastructure is in place.
chancancode added a commit to emberjs/ember.js that referenced this pull request Jan 24, 2018
These features are enabled by turning them into a runtime flag. These
flags are intended to be set by @ember/optional-features. In
the future, these runtime flags might be removed in favor of build-time
flags once the infrastructure is in place.
rwjblue added a commit to emberjs/ember.js that referenced this pull request Jan 24, 2018
lorcan pushed a commit to lorcan/ember.js that referenced this pull request Feb 6, 2018
laura-bergoens pushed a commit to 1024pix/pix that referenced this pull request Jan 23, 2020
Wrapping the app is now useless since this RFC from Ember, for more explanation :
emberjs/rfcs#280
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.