Skip to content
This repository has been archived by the owner on Mar 5, 2018. It is now read-only.

Args not updating bug #67

Merged
merged 1 commit into from
Jul 11, 2017
Merged

Args not updating bug #67

merged 1 commit into from
Jul 11, 2017

Conversation

pittst3r
Copy link
Contributor

@pittst3r pittst3r commented Jul 10, 2017

Fixes #66.

The component manager is supposed to update this.args on a component when they update. This was not happening at the appropriate time, causing computed properties dependent upon this.args to not update in time to reflect in the layout.

Args were being updated in the didUpdate component manager hook but needed to be updated in the update hook. Updating the args in didUpdate is too late in the rendering process (didUpdate indicates that the component has updated already). The update hook is for updating the component ahead of updating the layout so the layout knows what to render.

Also upgrades the @glimmer/application devDependency and removes an unnecessary guard.

@pittst3r pittst3r force-pushed the args-bug branch 4 times, most recently from e2302d9 to 1450944 Compare July 10, 2017 16:04
@pittst3r pittst3r changed the title Failing test for args bug Args not updating bug Jul 10, 2017
@@ -31,7 +31,7 @@
"@glimmer/util": "^0.26.2"
},
"devDependencies": {
"@glimmer/application": "^0.5.0",
"@glimmer/application": "^0.7.2",
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this upgrade necessary to fix the issue or can it be moved to a separate PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it is necessary for these tests to pass. I could probably do this upgrade in a separate PR still, but it would need to be merged first.

app.scheduleRerender();
});

assert.equal(app.rootElement.textContent.trim(), 'Tom Dale is dope');
Copy link
Contributor

Choose a reason for hiding this comment

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

A+++++ tests, would test again

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, Thom.

@@ -76,6 +77,106 @@ test('Args smoke test', (assert) => {
parent.firstName = "Thomas";
});

test('Rendering args derivatives', (assert) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a nitpick but I would prefer test names that are more descriptive, so they are more accessible to future contributors. For example, perhaps instead of "Rendering args derivatives", we could say something like "Tracked properties that depend on args re-render correctly". The terse names make it difficult to understand at a glance the difference between the two tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

if (!bucket) { return; }

// TODO: This should be moved to `didUpdate`, but there's currently a
// Glimmer bug that causes it not to be called if the layout doesn't update.
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to verify, has the Glimmer VM bug that necessitated this been fixed? (Seems like yes.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes

@pittst3r
Copy link
Contributor Author

@tomdale Updated per review 😃

@tomdale
Copy link
Contributor

tomdale commented Jul 11, 2017

LGTM! 👍 Thank you for the hard work!

@tomdale tomdale merged commit 2e789e9 into glimmerjs:master Jul 11, 2017
@pittst3r pittst3r deleted the args-bug branch July 11, 2017 16:06
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.

None yet

2 participants