ember-render-modifiers icon indicating copy to clipboard operation
ember-render-modifiers copied to clipboard

Move to addon v2

Open ctjhoa opened this issue 3 years ago • 12 comments

~~This addon is already in ember-auto-import v2 so it should not be a breaking change.~~ :warning: This is breaking change Yes this addon is already ember-auto-import v2 but ember app must be [email protected] minimum to fix the @glimmer/validator issue (cf https://github.com/emberjs/ember-render-modifiers/pull/66#issuecomment-1277354436)

This is based on addon v2 with yarn monorepo setup. It follows

  • https://github.com/embroider-build/addon-blueprint
  • https://github.com/embroider-build/embroider/blob/main/PORTING-ADDONS-TO-V2.md

ctjhoa avatar Oct 11 '22 14:10 ctjhoa

I'm stuck with this PR. There is an issue with @glimmer/validator which I'll try to sum up.

Ember embed it's own @glimmer/validator version as devDependencies. So ember-source as a package doesn't have an explicit dependency on @glimmer/validator.

On the other side, since https://github.com/emberjs/ember-render-modifiers/pull/54, ember-render-modifier is dependent on @glimmer/validator.

In classic (non-embroider) build, @glimmer/validator is somehow resolved as the Ember internal dependency.

Embroider, on the other hand, relies on explicit npm dependency and expects @glimmer/validator to be explicity provided by ember-source. This result in @glimmer/validator loaded twice (in Ember itself and from the addon)

2022-10-11-144941_1916x696_scrot

Here is a list of things I've tried and do not work at the moment:

  • Declare @glimmer/validator as optional peerDependencies
  • Use yarn resolutions to force only 1 version of @glimmer/validator
  • Tweak @embroider/shared-internals ember-standard-modules.ts to add emberVirtualPackages.add('@glimmer/validator')

ctjhoa avatar Oct 13 '22 09:10 ctjhoa

https://github.com/ef4/ember-auto-import/pull/541 might solve the issue

ctjhoa avatar Oct 13 '22 16:10 ctjhoa

https://github.com/ef4/ember-auto-import/pull/541 might solve the issue

I confirm this is working. I'm waiting for a new release of ember-auto-import

ctjhoa avatar Oct 14 '22 15:10 ctjhoa

@ctjhoa minor, I think we don't need packages/ember-render-modifiers/config/environment.js file at all

SergeAstapov avatar Oct 14 '22 16:10 SergeAstapov

@SergeAstapov time for re-review?

NullVoxPopuli avatar Jan 11 '23 19:01 NullVoxPopuli