-
Notifications
You must be signed in to change notification settings - Fork 96
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
fix(component): @layout
accept template factory
#451
Conversation
emberjs/ember.js#18096 This PR changed how templates get transpiled under the hood. The export from templates are now factory functions which expect to be passed the `owner`.
CI is failing due to using Node 6:
|
Should we pin the Ember Data dependency for now and do a major release later that drops Node 6? |
emberjs/data#6048 The linked PR dropped support for Node v6 and was released a `3.11.0`. To fix our CI we pin `ember-data@~3.10.0`. We will later drop support for Node v6 ourself, but this will likely require a major release.
c17a45a
to
727d8f7
Compare
727d8f7
to
a094cc6
Compare
packages/component/addon/index.js
Outdated
(() => typeof template === 'object' && typeof template.indexOf === 'undefined')() | ||
(() => | ||
typeof template === 'function' || | ||
(typeof template === 'object' && typeof template.indexOf === 'undefined'))() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw is there any reason this is an IIFE? If not, I'd remove that in this PR as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No not particularly. I'd only use an IIFE in order to simplify the boolean logic, e.g.:
assert(
'whatever',
(() => {
if (condition) { return true; }
if (otherThing) { return true; }
return false;
})()
It would probably make this specific case easier to think about, but isn't a giant deal.
I am sure that the
I reported it here: microsoft/TypeScript#30790 (comment) |
In hopes of making `ember-cli-sass` inside of `ember-cli-addon-docs` work. 😭
This fixes `Uncaught TypeError: Cannot read property default of undefined`.
Oh come on FFS, how hard can it be to get a freaking one-line change merged? 😂
|
Alright, I discovered another issue with emberjs/ember.js#18096 in combination with In development builds or builds that only target browsers that support arrow functions, the returned Importantly, arrow functions have no
This causes the above code to report a false positive in production builds an lets the
Since @layout
class {}
// instead of
@layout(template)
class {} I suggest we stop using |
Ya, that seems fine to me... |
@buschtoens @rwjblue Is there anything that I can help with to move this forward? I'm currently blocked on upgrading Ember Canary because of the issue this solves. |
AFAIK the blocker is just implementing the change @buschtoens suggested |
I fixed the |
152262f
to
faec94f
Compare
@pzuraq - Thoughts on the path forward here? |
I think the solution looks good, I'm not actually sure what the test failures on Canary are, it looks like they're coming from pretty deep inside the VM O_o Also unsure what's going on with production tests. I can try to take a look sometime next week, going to be busy for the remainder of this week. I also think we could make canary tests optional at this point, since we don't expect much to be changing with regards to the object model in the near future. Ideally we wouldn't, but we could to get unblocked. |
The canary failure is caused by emberjs/ember-test-helpers#677 Edit: I might be mistaken, but I think this was the error I set out to fix with above PR. |
Ya, could be but I thought I fixed those issues in ember so it didn't require changes in addons (e.g. didn't need to upgrade |
Failures are agast "canary" and "production", could it be that when the tests ran, the build didn't pick up the changes that @rwjblue is referring as fixed? Error: The error does seem to be related, maybe some can restart the tests to see if it passes now? Looking forward to having this fixed. |
The production build failure was not related to the lookup failure (it was Apparently my fix in ember-source only fixed |
A plausible path forward here would be to run the codemod to migrate to setupRenderingTest to work around the bug in moduleForComponent. |
OK, now ready for a rebase... |
Rebased and merged in #454 |
emberjs/ember.js#18096
This PR changed how templates get transpiled under the hood.
The export from templates are now factory functions which expect to be passed the
owner
.