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

[BUGFIX] <LinkTo> should link within the engine when used inside one #19223

Merged
merged 1 commit into from
Oct 29, 2020

Conversation

chancancode
Copy link
Member

@chancancode chancancode commented Oct 23, 2020

See ember-engines/ember-engines#692 (comment). This should allow ember-engines to remove the <LinkTo> monkey patch (at least that's the intention).

Not sure what versions to target (if any) for the backport. This could arguably be a breaking bugfix for people using engines but not using the ember-engines addon? I don't know if that combination exists in the real world though.

@chancancode chancancode force-pushed the engine-link-to branch 2 times, most recently from ddc82b2 to 9fce35b Compare October 23, 2020 02:06
@@ -875,7 +875,7 @@ moduleFor(

["@test query params don't have stickiness by default between model"](assert) {
assert.expect(1);
let tmpl = '{{#link-to "blog.category" 1337}}Category 1337{{/link-to}}';
let tmpl = '{{#link-to "category" 1337}}Category 1337{{/link-to}}';
Copy link
Member Author

Choose a reason for hiding this comment

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

So this is one way you can tell this is a breaking change. Do people really use engines without the engines addon though?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it makes ember-engines more magic than expected, I like the way how ember-engines are explicit on route path

cc: @dgeb @rwjblue

Copy link
Member

Choose a reason for hiding this comment

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

@chancancode I don't think we actually support engines without the ember-engines addon. All of our documentation and guidance on usage of engines has been in context of using the addon (roughly akin to how we now are allowed to assume folks use ember-source through ember-cli).

Copy link
Contributor

@villander villander Oct 29, 2020

Choose a reason for hiding this comment

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

@rwjblue and how about don't use engine.route-name anymore? I think it's a drawback for us

@@ -487,6 +490,13 @@ const LinkComponent = EmberComponent.extend({
init() {
this._super(...arguments);

assert(
Copy link
Contributor

Choose a reason for hiding this comment

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

great stuff!

@rwjblue
Copy link
Member

rwjblue commented Oct 29, 2020

The issues with CI were already fixed, restarting to see if that works. It might require a rebase though.

@chancancode
Copy link
Member Author

Rebased

@rwjblue rwjblue merged commit 8482098 into master Oct 29, 2020
@rwjblue rwjblue deleted the engine-link-to branch October 29, 2020 21:02
@chriskrycho
Copy link
Contributor

Heads up: I haven't had a chance to dig in yet and it's extremely unlikely I will have a chance to do so until well after the start of the year, but I have strong reason to believe this broke our app very hard on 3.24. Specifically, when running 3.24.0-beta.2, effectively every single test in the suite either completely fails to run or dies on instantiation of link-to's, with errors like:

Assertion failed: You attempted to generate a link for the "company-creation.create" route, but did not pass the models required for generating its dynamic segments. There is no route named career-services.company-creation.create

When I say it hits nearly all our tests: out of ~30,000 tests, only ~6,900 run, and of those somewhere around 6,000–6,100 fail with this error. 😬

@rwjblue
Copy link
Member

rwjblue commented Dec 22, 2020

@chriskrycho - ya, it requires changes in ember-engines to accomodate (otherwise we double prefix)

@rwjblue
Copy link
Member

rwjblue commented Dec 22, 2020

@chriskrycho - Can you create an issue on ember-engines repo and cross link here (so we can track fixing)?

@villander
Copy link
Contributor

yes, we need to make changes to LinkComponent. Also it requires changes to Ember Engines Guides.

@chriskrycho
Copy link
Contributor

chriskrycho commented Dec 22, 2020

I filed a bug there; note also that we should make a point to call out the need to upgrade engines when upgrading to 3.24 in the blog post.

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.

4 participants