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

Deprecate views in 1.13, Addonize and remove from core in 2.0 #11377

Closed
15 of 19 tasks
mixonic opened this issue Jun 8, 2015 · 6 comments
Closed
15 of 19 tasks

Deprecate views in 1.13, Addonize and remove from core in 2.0 #11377

mixonic opened this issue Jun 8, 2015 · 6 comments
Assignees

Comments

@mixonic
Copy link
Sponsor Member

mixonic commented Jun 8, 2015

This is a quest issue tracking the process of removing views from Ember 2.0.

  • In Ember 1.13 the following APIs will be deprecated:
    • {{view 'some-view'}}
    • {{view.someProp}}
    • Using Ember.Select (which is a view) and {{view "select"}}
    • Using Ember.View (except for internals)
  • In Ember 1.13, using Ember.Checkbox will warn (once) that it will become a component in 2.0
  • In Ember 2.0, the following APIs will be removed from Ember:
    • {{view 'some-view'}}
    • {{view.someProp}}
    • Using Ember.Select (which is a view) and {{view "select"}}
  • In Ember 2.0, Ember.Checkbox will become a component instead of a view
  • An addon will be released called ember-legacy-views with 2.0 (at the latest)
    • provides Ember.View
    • toggles a private flag that enables {{view.someProp}}
    • provides (or toggles a private flag for) {{view "some-view"}}
    • provides {{view "select"}}

Documentation updates will need to happen:

  • Deprecation guide for views
  • Deprecation guide for select. Since select will be removed in 2.0, alternative existing addons should be suggested
  • Review guides to remove view documentation, select documentation
@mixonic mixonic self-assigned this Jun 8, 2015
@krisselden
Copy link
Contributor

viewName?

bantic added a commit to bantic/ember.js that referenced this issue Jun 9, 2015
…ing on init

  * Use underscored env variable _ENABLE_LEGACY_VIEW_SUPPORT to remove deprecation.
  * Change tests that used the Ember.View global directly to import View from "ember-views/views/view" instead

Refs emberjs#11377
bantic added a commit to bantic/ember.js that referenced this issue Jun 9, 2015
  * change env value RAISE_ON_DEPRECATION to false
  * change tests for Ember.deprecate that relied on RAISE_ON_DEPRECATION being true

refs emberjs#11377
bantic added a commit to bantic/ember.js that referenced this issue Jun 10, 2015
@jackmatt2
Copy link

Why is Ember.Select not being converted into a component also like Ember.Checkbox? Why will it be packaged as a separate addon? It seems to me that an HTML select element is something pretty much all projects will use.

@Eptis
Copy link

Eptis commented Jun 11, 2015

not all of them, so I would prefer an addon for these things. But I also wonder, why not make Ember.Select a component as well (in the addon)?

@mixonic
Copy link
Sponsor Member Author

mixonic commented Jun 11, 2015

I would like to keep this ticket fairly tactical, but would happily discuss this in detail on discuss.emberjs.com if we can take the discussion there. I know some of the items here may be controversial.

The select view has terrible performance. Robert was showing me one of his versions the other day that was easily an order of magnitude faster. It has been pathological and we were not able to improve it within semver constraints. These constraints also limit us from just making it a component.

The select view also relies heavily on two way binding. This will not be an idiomatic development style in Ember 2.x, and the select view would quickly become an exception to the entire programming model of data-down actions-up we are excited about. Even if it we could just make it a component, it would be unlike what we expect components to be.

For these two reasons, it needs to go in 2.0. We do not have a viable component version that uses modern idiomatic style, so we will instead be pushing the select implementation back to addon-land where it can be iterated upon. There are already a few decent options, and I'm sure we will have a few more arise using the new 1.13 APIs and angle components when they land. In time, perhaps one of these could become official.

The select view will be part of the ember-legacy-views add-on, which will be supported until Ember 2.4. This should provide plenty of time for a well performing and modern option to mature.

bantic added a commit to bantic/ember.js that referenced this issue Jun 11, 2015
bantic added a commit to bantic/ember.js that referenced this issue Jun 12, 2015
…lect"}}

Use a template-compiler plugin to detect `{{view "string"}}` at compile-time
and issue a deprecation with location information. Has a special case
deprecation when the string === "select".

Removes a test from the view helper tests that was checking for the
deprecation at runtime (and removes the associated code in
the ember-htmlbars package's `keywords/view`).

Note: This does not catch a deprecation when the path is not a string,
e.g., `{{view view.someProperty}}`, however emberjs#11401 would catch and issue
a deprecation message for that case (at runtime).

Also a few changes to deprecations:

  * document `id` param to `Ember.deprecate`
  * include deprecation id in log/error message
  * Use dot-namespaced deprecation ids (more similar to how `instrument` works and paves the way to in the future changing deprecation log levels by paths ie `"view.*"`)
  * globally silence view-related deprecations in tests to avoid overflowing travis ci's log
  * update ember-dev dep in bower (pr: emberjs/ember-dev#153) to `a064f0cd2f4c225ffd023b63d4cb31a79db04aaf`
  * change the view-and-controller-path template compiler plugin to always deprecate `{{controller}}`
  * change the view-and-controller-path template compiler plugin to skip deprecating `{{view}}` when `Ember.ENV._ENABLE_LEGACY_VIW_SUPPORT` is true

refs emberjs#11377
rwjblue pushed a commit that referenced this issue Jun 13, 2015
…ing on init

  * Use underscored env variable _ENABLE_LEGACY_VIEW_SUPPORT to remove deprecation.
  * Change tests that used the Ember.View global directly to import View from "ember-views/views/view" instead

Refs #11377

(cherry picked from commit 1cfb36d)
rwjblue pushed a commit that referenced this issue Jun 13, 2015
  * change env value RAISE_ON_DEPRECATION to false
  * change tests for Ember.deprecate that relied on RAISE_ON_DEPRECATION being true

refs #11377

(cherry picked from commit c5be1b0)
rwjblue pushed a commit that referenced this issue Jun 13, 2015
rwjblue pushed a commit that referenced this issue Jun 13, 2015
…lect"}}

Use a template-compiler plugin to detect `{{view "string"}}` at compile-time
and issue a deprecation with location information. Has a special case
deprecation when the string === "select".

Removes a test from the view helper tests that was checking for the
deprecation at runtime (and removes the associated code in
the ember-htmlbars package's `keywords/view`).

Note: This does not catch a deprecation when the path is not a string,
e.g., `{{view view.someProperty}}`, however #11401 would catch and issue
a deprecation message for that case (at runtime).

Also a few changes to deprecations:

  * document `id` param to `Ember.deprecate`
  * include deprecation id in log/error message
  * Use dot-namespaced deprecation ids (more similar to how `instrument` works and paves the way to in the future changing deprecation log levels by paths ie `"view.*"`)
  * globally silence view-related deprecations in tests to avoid overflowing travis ci's log
  * update ember-dev dep in bower (pr: emberjs/ember-dev#153) to `a064f0cd2f4c225ffd023b63d4cb31a79db04aaf`
  * change the view-and-controller-path template compiler plugin to always deprecate `{{controller}}`
  * change the view-and-controller-path template compiler plugin to skip deprecating `{{view}}` when `Ember.ENV._ENABLE_LEGACY_VIW_SUPPORT` is true

refs #11377

(cherry picked from commit c2bcc86)
@amk221
Copy link
Contributor

amk221 commented Jun 16, 2015

There is no upgrade path for this scenario now that view is going away:

{{#each myComponents key='elementId' as |componentInstance|}}
  {{view componentInstance}}
{{/each}}

What is useful about the above pattern is:

  • Granular control over when a component is rendered

    (Specific example: a component which loads async content and then renders a separate, but related component in a different part of the DOM)
  • The components can be initialised with an arbitrary attrs hash. It's not possible to do {{component componentInstance attrs=attrs}} Because that would result in attrs: { attrs: {} }

    (Specific example: modal dialogs which don't all accept the same attrs signature)`

Edit: Reference to other people with the same issue

@rwjblue
Copy link
Member

rwjblue commented Aug 16, 2015

2.0.0 has shipped. Closing...

@rwjblue rwjblue closed this as completed Aug 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants