Skip to content

Fix non-interactive (FastBoot) hooks, and get them tested.#14233

Merged
rwjblue merged 2 commits intomasterfrom
allow-boot-options
Sep 8, 2016
Merged

Fix non-interactive (FastBoot) hooks, and get them tested.#14233
rwjblue merged 2 commits intomasterfrom
allow-boot-options

Conversation

@rwjblue
Copy link
Member

@rwjblue rwjblue commented Sep 8, 2016

This refactors the lifecycle hook tests and fixes CurlyComponentManager to ensure that the hooks are fired correctly.

The following hooks are fired in all modes:

  • init
  • didReceiveAttrs
  • willRender
  • didUpdateAttrs
  • willUpdate
  • willDestroy

The following hooks are fired in interactive mode only:

  • didInsertElement
  • didRender
  • didUpdate
  • willDestroyElement
  • willClearRender

Robert Jackson added 2 commits September 8, 2016 16:00
Can now pass `ownerOptions` (to be passed to the `Owner.create`),
`resolver` (to be used at the backing resolver for the fallback
registry), and `bootOptions` (to be used to specify custom `BootOptions`
like `isInteractive`).
This refactors the lifecycle hook tests and fixes
`CurlyComponentManager` to ensure that the hooks are fired correctly.

The following hooks are fired in all modes:

* `init`
* `didReceiveAttrs`
* `willRender`
* `didUpdateAttrs`
* `willUpdate`
* `willDestroy`

The following hooks are fired in interactive mode only:

* `didInsertElement`
* `didRender`
* `didUpdate`
* `willDestroyElement`
* `willClearRender`
@rwjblue rwjblue merged commit 6f5c3b8 into master Sep 8, 2016
@rwjblue rwjblue deleted the allow-boot-options branch September 8, 2016 20:51
chancancode added a commit that referenced this pull request Sep 27, 2016
This is a follow-up to #14233.

At the September 2016 core team face-to-face meeting, we discussed and
clarified the intended features for life-cycle hooks in non-iterative
environments (i.e. FastBoot).

We agreed that components on FastBoot should only react to data changes
via the `didReceiveAttrs` and `didUpdateAttrs` hooks. (There is also
deprecated `didInitAttrs` hook.)

The main change is that we have been incorrectly calling `willRender`
and `willUpdate` in non-interactive mode so far (at least since we last
checked and added the tests). The problem is that `{will,did}Render` and
`{will,did}Update` are intended to work as a pair so running one but not
the other could introduce unexpected bugs for applications.
chancancode added a commit that referenced this pull request Sep 27, 2016
This is a follow-up to #14233.

At the September 2016 core team face-to-face meeting, we discussed and
clarified the intended features for life-cycle hooks in non-iterative
environments (i.e. FastBoot).

We agreed that components on FastBoot should only react to data changes
via the `didReceiveAttrs` and `didUpdateAttrs` hooks. (There is also
deprecated `didInitAttrs` hook.)

The main change is that we have been incorrectly calling `willRender`
and `willUpdate` in non-interactive mode so far (at least since we last
checked and added the tests). The problem is that `{will,did}Render` and
`{will,did}Update` are intended to work as a pair so running one but not
the other could introduce unexpected bugs for applications.
rwjblue pushed a commit that referenced this pull request Sep 27, 2016
This is a follow-up to #14233.

At the September 2016 core team face-to-face meeting, we discussed and
clarified the intended features for life-cycle hooks in non-iterative
environments (i.e. FastBoot).

We agreed that components on FastBoot should only react to data changes
via the `didReceiveAttrs` and `didUpdateAttrs` hooks. (There is also
deprecated `didInitAttrs` hook.)

The main change is that we have been incorrectly calling `willRender`
and `willUpdate` in non-interactive mode so far (at least since we last
checked and added the tests). The problem is that `{will,did}Render` and
`{will,did}Update` are intended to work as a pair so running one but not
the other could introduce unexpected bugs for applications.

(cherry picked from commit b4d22a8)
webark pushed a commit to webark/ember.js that referenced this pull request Oct 6, 2016
This is a follow-up to emberjs#14233.

At the September 2016 core team face-to-face meeting, we discussed and
clarified the intended features for life-cycle hooks in non-iterative
environments (i.e. FastBoot).

We agreed that components on FastBoot should only react to data changes
via the `didReceiveAttrs` and `didUpdateAttrs` hooks. (There is also
deprecated `didInitAttrs` hook.)

The main change is that we have been incorrectly calling `willRender`
and `willUpdate` in non-interactive mode so far (at least since we last
checked and added the tests). The problem is that `{will,did}Render` and
`{will,did}Update` are intended to work as a pair so running one but not
the other could introduce unexpected bugs for applications.
mixonic pushed a commit to mixonic/ember.js that referenced this pull request Oct 22, 2016
This is a follow-up to emberjs#14233.

At the September 2016 core team face-to-face meeting, we discussed and
clarified the intended features for life-cycle hooks in non-iterative
environments (i.e. FastBoot).

We agreed that components on FastBoot should only react to data changes
via the `didReceiveAttrs` and `didUpdateAttrs` hooks. (There is also
deprecated `didInitAttrs` hook.)

The main change is that we have been incorrectly calling `willRender`
and `willUpdate` in non-interactive mode so far (at least since we last
checked and added the tests). The problem is that `{will,did}Render` and
`{will,did}Update` are intended to work as a pair so running one but not
the other could introduce unexpected bugs for applications.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants