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

Projects on embroider don't see the "Non-colocated components" deprecation #2066

Closed
kategengler opened this issue Aug 15, 2024 · 4 comments
Closed

Comments

@kategengler
Copy link

A project on latest ember-source (v5.10.2) with many non-colocated component templates wasn't seeing any deprecations for those templates. After investigating, I realized layoutFor (the method with the deprecation in ember-source) was never called: The project is using embroider -- embroider is resolving the component's templates at build time.

Embroider should add this deprecation.

Relevant RFC advancement PR emberjs/rfcs#1040

@mansona
Copy link
Member

mansona commented Aug 15, 2024

For stable embroider the relevant place is https://github.com/embroider-build/embroider/blob/stable/packages/core/src/module-resolver.ts#L482-L526

Essentially I think we would either need to check your ember-source version and throw the deprecation if your ember-version matches the deprecation, or we could just decide that when you're using embroider this is just deprecated anyway regardless of your ember-source version 🤔

I'm going to add this to the agenda for next week to discuss 👍

@ef4
Copy link
Contributor

ef4 commented Aug 20, 2024

We discussed this at tooling team weekly meeting and the tentative plan is to emit a deprecation inside the virtual pair component at runtime (

const pairedComponentShim = compile(`
import { setComponentTemplate } from "@ember/component";
import template from "{{{js-string-escape relativeHBSModule}}}";
{{#if relativeJSModule}}
import component from "{{{js-string-escape relativeJSModule}}}";
export default setComponentTemplate(template, component);
{{else}}
import templateOnlyComponent from "@ember/component/template-only";
export default setComponentTemplate(template, templateOnlyComponent(undefined, "{{{js-string-escape debugName}}}"));
{{/if}}
`) as (params: { relativeHBSModule: string; relativeJSModule: string | null; debugName: string }) => string;
) and also on Ember >= 6 do an actual build failure in the module-resolver where Chris linked above.

@kategengler
Copy link
Author

Does this need to be backported? Users can easily upgrade ember-source without upgrading embroider.

@ef4
Copy link
Contributor

ef4 commented Sep 27, 2024

Fixed in #2088.

@ef4 ef4 closed this as completed Sep 27, 2024
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

No branches or pull requests

3 participants