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

Do not use global ember -- drop support for ember-source < 4.12 #973

Merged
merged 4 commits into from
Jun 7, 2024

Conversation

NullVoxPopuli
Copy link
Contributor

@NullVoxPopuli NullVoxPopuli commented Jun 6, 2024

For emberjs/rfcs#1015

If folks come across this PR and are using Ember.Templates, use register instead.

*
* Removed for RFC 1003
*/
export let TEMPLATES = {};
Copy link
Member

Choose a reason for hiding this comment

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

Is this a breaking change? If people could previously add to Ember.TEMPLATES?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's a private undocumented API, so if their code breaks, that's on them

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

another example: emberjs/ember.js#20632 (comment)

🙈

Copy link
Member

Choose a reason for hiding this comment

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

It was definitely public once which is probably why I remember it.

I think it would be reasonable to make this a breaking change for ember-resolver, just so anybody that updates it before ember-source (& the deprecation) knows to look a bit closer. Doesn't really cost anything.

Copy link
Contributor Author

@NullVoxPopuli NullVoxPopuli Jun 6, 2024

Choose a reason for hiding this comment

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

It was definitely public once

uuggghh gross :(
(glad that era is over! haha)

I think it would be reasonable to make this a breaking change for ember-resolver,

fair enough! 🎉

Copy link
Contributor

Choose a reason for hiding this comment

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

There's no point in keeping this. Just drop it.

Ember.TEMPLATES is the thing that gets auto-populated from your HTML like:

<script type="text/x-handlebars" data-template-name="my-component">hello world</script>

A new major of ember-resolver could document that it no longer supports that pattern.

If people are manually stuffing templates into Ember.TEMPLATES, we don't want them to refactor that code to stuff the templates into this template-cache instead. Tell them to use register.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done


let getOwner;

if (macroCondition(dependencySatisfies('ember-source', '>= 4.11'))) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this PR is now breaking anyway (which I agree with), how about not doing these macroCondition shenanigans and just supporting ember >= 4.11?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done! I like this plan

*
* Removed for RFC 1003
*/
export let TEMPLATES = {};
Copy link
Contributor

Choose a reason for hiding this comment

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

There's no point in keeping this. Just drop it.

Ember.TEMPLATES is the thing that gets auto-populated from your HTML like:

<script type="text/x-handlebars" data-template-name="my-component">hello world</script>

A new major of ember-resolver could document that it no longer supports that pattern.

If people are manually stuffing templates into Ember.TEMPLATES, we don't want them to refactor that code to stuff the templates into this template-cache instead. Tell them to use register.

@NullVoxPopuli NullVoxPopuli changed the title Do not use global ember -- internalize template resolution cache Do not use global ember -- drop support for ember-source < 4.12 Jun 7, 2024
@NullVoxPopuli
Copy link
Contributor Author

CI is green, but ember-lts-4.4 is a required check, but this PR drops support for 4.4

@ef4 ef4 merged commit 957d26b into main Jun 7, 2024
11 checks passed
@ef4 ef4 deleted the do-not-use-global-ember branch June 7, 2024 18:29
@mkszepp
Copy link

mkszepp commented Jun 8, 2024

@NullVoxPopuli
I think there was forget to update the peerDependency to 4.12.0 or?

"ember-source": "^4.8.3 || >= 5.0.0"

Is there any reason to ship still ember-cli-babel v7 as dependency? Why not v8? If i remember on discored you want to force peoples to update/ using override

"ember-cli-babel": "^7.26.11"

@NullVoxPopuli
Copy link
Contributor Author

I think there was forget to update the peerDependency to 4.12.0 or?

Yup, deserves its own PR tho

v7 as dependency?

Yeah, updating this just wasn't a focus from yesterday, but it probably should happen!

@ijlee2
Copy link

ijlee2 commented Jun 12, 2024

Hi, @NullVoxPopuli and @ef4.

I think you'll want to communicate the breaking change better in the release notes for v12 (provide a migration guide). Initially, I had thought the PR would affect only standalone apps.

When ember-resolver@12 is installed in an addon project with a test app(s) that uses ember-try, the 4.4 and 4.8 scenarios will fail and may surprise maintainers. You can see this happen in two separate projects:

Here's what to do to make CI pass again.

@NullVoxPopuli
Copy link
Contributor Author

@ember/owner isn't available pre 4.11.

I can copy notes for folks to copy-pasta if folks want to keep testing against older ember.
This should be a common occurance though -- especially as you go back further in time.
... so much so that I eventually gave up on adding stuff to ember-try, and made a min-supported separate test app for 3.x, which doesn't use ember-try at all https://github.com/universal-ember/reactiveweb/tree/main/tests -- the delta in package.json needs gets too great over time.

All this to say, I updated the release notes: https://github.com/ember-cli/ember-resolver/releases/tag/v12.0.0

@ef4
Copy link
Contributor

ef4 commented Jun 14, 2024

I would add that you can use ember-try to downgrade ember-resolver in the older scenarios. The same way ember-try is adjusting the ember-source version downward it can adjust ember-resolver downward. This actually improves the realism of the tests because you'd be testing under the conditions that apps on older ember-source versions are more likely to really be using.

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.

5 participants