Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Ember 1.13 and 2.0 support #227

Merged
merged 2 commits into from
Jun 15, 2015
Merged

Ember 1.13 and 2.0 support #227

merged 2 commits into from
Jun 15, 2015

Conversation

jamesarosen
Copy link
Owner

Starting work on support for Ember 1.13. Glimmer breaks the old helper and adds a new Ember.Helper with more of the power we need.

As of this commit, the beta build is still breaking because there's something wrong with the helper registration.

@jamesarosen
Copy link
Owner Author

@mixonic thanks for your work on Ember.Helper! I haven't quite got it working in ember-i18n, but I feel like we're closing in :)

}

if (Helper != null) {
instance.registry.register('helper:t', Helper);
Copy link
Owner Author

Choose a reason for hiding this comment

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

Despite this, I get a "helper t not found" error message whenever I try to use it.

Copy link

Choose a reason for hiding this comment

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

Correct. Robert is going to land emberjs/rfcs#58 into 1.13 which will give you {{t without any explicit registration step.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Ah. I was basing this off of https://github.com/emberjs/ember.js/pull/11278/files#diff-5d4704d516d9bedb9605e499dc0a88d8R122

I guess once dashless-autolookup lands I'll want a single app/helpers/t.js that exports either legacyHelper or Helper, depending on the presence of Ember.Helper. That'll be easy :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Confirm.

@mixonic
Copy link

mixonic commented Jun 8, 2015

Awesome. The dashless stuff should land soon as well. /cc @rwjblue

On June 8, 2015 7:13:09 PM James Alexander Rosen [email protected]
wrote:

@mixonic thanks for your work on Ember.Helper! I haven't quite got it
working in ember-i18n, but I feel like we're closing in :)


Reply to this email directly or view it on GitHub:
#227 (comment)

@jamesarosen
Copy link
Owner Author

Though this is meant to work with 1.13 (currently beta), there isn't a 1.13 beta that includes emberjs/ember.js#11278 (Ember.Helper) and emberjs/ember.js#11393 (dashless helper registration), so the best way to work on this is against canary.

The current problem I'm having is that Helper#recompute fires, but for some reason, it doesn't subsequently call #compute.

Some relevant links:

Previously, we were setting the locale by navigating to
`/in/:locale`. Unfortunately, that's not a very good test of the
`{{t}}` helper because it causes the whole template to be
rerendered. Instead, we use an `{{action}}` to trigger the locale
change and ensure that the *same* template gets updated.
@jamesarosen
Copy link
Owner Author

After much debugging help from @mixonic, it seems to be a problem with using recompute and an ordered param. In his words:

adding an argument means linkedParams are taken, and our later linkParams call fails

@mixonic
Copy link

mixonic commented Jun 14, 2015

@jamesarosen emberjs/ember.js#11445 contains the fix. A merge today seems likely, and a 1.13.1 on Tuesday.

@jamesarosen
Copy link
Owner Author

The last test will be fixed by emberjs/ember.js#11445

@rwjblue
Copy link
Contributor

rwjblue commented Jun 15, 2015

emberjs/ember.js#11445 has been merged, and is in both beta and release channels.

Could you test, and confirm the release channel fixes the remaining failures here?

 1. Starting work on support for Ember 1.13. Glimmer breaks the old
    helper and adds a new `Ember.Helper` with more of the power we
    need.
 2. v1.13 introduces a new `Ember.Service` that should
    be the parent of the `service:i18n`.
 3. Ember 2.0 removes `Ember.EnumerableUtils`, instead assuming
    all supported browsers supply the ES5 enumerable methods.
@jamesarosen jamesarosen changed the title wip: ember 1.13 support Ember 1.13 and 2.0 support Jun 15, 2015
@josepjaume
Copy link

Just a heads up: I think this branch breaks the bound {{t}} helper; when I change i18n.locale, the translations don't update.

@jamesarosen
Copy link
Owner Author

@josepjaume have you tested with a version of Ember since emberjs/ember.js#11445 was merged? You can see the difference between build 415.4 and build 425.4

@rwjblue tests look great! Thanks :)

@josepjaume
Copy link

Oh, I see! Does this mean there's a 1.13.1 bugfix release coming soon, or is this behavior broken until 2.0.0?

@josepjaume
Copy link

BTW: Thanks for the good work 👍

@jamesarosen
Copy link
Owner Author

Does this mean there's a 1.13.1 bugfix release coming soon?

I'm told it'll be Tuesday.

@jamesarosen jamesarosen merged commit 7bf2973 into master Jun 15, 2015
jamesarosen added a commit that referenced this pull request Jun 15, 2015
@jamesarosen jamesarosen deleted the new-helper branch June 15, 2015 12:09
@josepjaume
Copy link

Confirmed it's working by using the release channel. In my bower.json file:

{
  "dependencies": {
    "ember": "components/ember#release"
  },
  "resolutions": {
    "ember": "release"
  }
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants