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

Add failing test for partials which contain contextual components #15777

Merged
merged 3 commits into from
Oct 29, 2017
Merged

Add failing test for partials which contain contextual components #15777

merged 3 commits into from
Oct 29, 2017

Conversation

GavinJoyce
Copy link
Member

@GavinJoyce GavinJoyce commented Oct 27, 2017

related to #15621

TODO:

@GavinJoyce
Copy link
Member Author

it looks like updating to glimmer-vm 0.25.4 results in three test failures:

screen shot 2017-10-27 at 11 42 38

@GavinJoyce
Copy link
Member Author

Here's the glimmer-vm diff: glimmerjs/glimmer-vm@v0.25.3...v0.25.4

@GavinJoyce
Copy link
Member Author

GavinJoyce commented Oct 27, 2017

@rwjblue here's what I believe to be the current state of play:

  • A regression was introduced in Ember 2.15 time frame (test here) and is fixed in glimmer-vm 0.25.4
  • glimmer-vm 0.25.4 introduces a regression which results in this test failing, it passes with glimmer-vm 0.25.3.
  • Your additional tests in Failing tests for {{partial issues in 2.15. #15674 aren't fixed with glimmer-vm 0.25.4. I'm yet unclear if these are regressions introduced with 2.15, or if they have been there for longer

@GavinJoyce
Copy link
Member Author

Digging into the failing test a little:

in glimmer-vm 0.25.3, the get opcode results in an InternalReferenceHelper of classHelper (which is correct):

screen shot 2017-10-28 at 21 55 42

in glimmer-vm 0.25.4, the maybeLocal opcode results in a RootPropertyReference with a value of true (which is incorrect):

screen shot 2017-10-28 at 21 57 53

@GavinJoyce
Copy link
Member Author

GavinJoyce commented Oct 28, 2017

Aha, wrapComponentClassAttribute currently only supports Ops.Get, not Ops.MaybeLocal:

if (type === Ops.Get) {
let getExp = values[index];
let path = getExp[2];
let propName = path[path.length - 1];
hash[1][index] = [Ops.Helper, ['-class'], [getExp, propName]];

Interesting comment, I wonder if this will help simplify things:

// TODO we should probably do this transform at build time

@GavinJoyce
Copy link
Member Author

@rwjblue 🍏 and ready for review

@rwjblue rwjblue merged commit 3bee4b8 into emberjs:master Oct 29, 2017
@rwjblue
Copy link
Member

rwjblue commented Oct 29, 2017

Thank you very much for working on this!!

@GavinJoyce GavinJoyce deleted the gj/test-contextual-components-in-partial branch October 29, 2017 06:55
@tomdale
Copy link
Member

tomdale commented Oct 31, 2017

Impressive work, @GavinJoyce. I agree with the comment: ideally this fixing up should happen at the AST level, not the opcode level. I'm afraid that future plans for generating more optimized bytecode will probably continue to cause breakage here if it's relying on specific opcodes instead of higher-level semantics.

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

Successfully merging this pull request may close these issues.

None yet

3 participants