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

Simplified template resolution #1363

Merged
merged 62 commits into from
Mar 7, 2023
Merged

Simplified template resolution #1363

merged 62 commits into from
Mar 7, 2023

Conversation

ef4
Copy link
Contributor

@ef4 ef4 commented Feb 16, 2023

This is another extraction from the work in #1357.

It should be able to complete the "stretch goal" described in #1339 by eliminating all real module resolution in our template transform.

I noticed that emberjs/ember.js#19878 got back ported to Ember 3.28, so I don't think we need to keep our workaround for it anymore, and dropping the workaround made this work easier.

Potentially breaking changes to how we up-compile non-strict templates:

  • we're getting stricter about letting ambiguous forms like {{thing}} mean {{this.thing}}. Ember itself doesn't support any versions that can do this anymore. Embroider will now error on this when staticComponents or staticHelpers are enabled. If people hit this problem in third-party code, I've added a disambiguate package rule that can be used to manually disambiguate the cases.
  • related to the above, if you use forms that are ambiguous between helper and component like {{thing arg=1}}, you can no longer mix and match staticComponents and staticHelpers settings. They either both need to be enabled or both disabled. You can also always switch to unambiguous syntax like <Thing /> or {{ (thing) }}. This way we can always tell for sure whether we're handling an invocation or not, without making it dependent on the outcome of global resolution.
  • the components.*.safeToIgnore package rule used to just suppress the error when a component wasn't found. Now it prevents us from even attempting resolution.
  • we no longer include a workaround for [Bug] class-based helpers throw weird error in strict mode (getDebugName) emberjs/ember.js#19877, because the fix for that is back ported to 3.28. All our supported Ember versions have a non-breaking ember upgrade they can do to get the fix.

@ef4 ef4 marked this pull request as ready for review March 7, 2023 06:08
@ef4 ef4 merged commit 97d8b0d into main Mar 7, 2023
@ef4 ef4 deleted the simplified-template-resolution branch March 7, 2023 06:08
ef4 added a commit that referenced this pull request Mar 7, 2023
This unskips some tests that were disabled in #1363 by finishing the new implementation of the component.invokes packageRule.
This was referenced May 2, 2023
@ef4 ef4 added the breaking label May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant