ember-style-modifier icon indicating copy to clipboard operation
ember-style-modifier copied to clipboard

Remove unneeded peer dependency on ember-source

Open NullVoxPopuli opened this issue 9 months ago • 6 comments

embroider, auto-import, and ember-cli before them handled virtual deps without a package.json entry.

package.json entries win over virtual deps, so we don't want to declare ember-source or @glimmer/tracking as peers.

Related:

  • https://github.com/ember-polyfills/ember-functions-as-helper-polyfill/pull/151
  • https://github.com/jelhan/ember-style-modifier/pull/312
  • https://github.com/jmurphyau/ember-truth-helpers/pull/211
  • https://github.com/ember-modifier/ember-modifier/pull/949
  • https://github.com/tracked-tools/tracked-toolbox/pull/211
  • https://github.com/emberjs/ember-test-helpers/pull/1543
  • https://github.com/NullVoxPopuli/ember-resources/pull/1189
  • https://github.com/NullVoxPopuli/ember-modify-based-class-resource/pull/20
  • https://github.com/universal-ember/kolay/pull/187
  • https://github.com/universal-ember/reactiveweb/pull/139
  • https://github.com/universal-ember/ember-primitives/pull/471
  • https://github.com/universal-ember/docs-support/pull/77

NullVoxPopuli avatar May 10 '25 01:05 NullVoxPopuli

Ember CLI addon blueprints add a peer dependency on ember-source: https://github.com/ember-cli/ember-addon-output/blob/c34e1239793a3c5faafbdffccf898d8bdf38ff73/package.json#L81-L83 Is there a RFC pending for implementation that this should be changed?

jelhan avatar May 10 '25 14:05 jelhan

No RFC needed, see: https://discord.com/channels/480462759797063690/568935504288940056/1370714948447113226

Changes to these sorts of things in the blueprints are to try to reduce problems for consumers, and are less so in need of opinions from the RFR process <3. I understand it is surprising tho. It was surprising to me when i found out we shouldn't be doing this as well!

  • ember-source: removed because the embroider / auto-import know what we intend - it's not bad to have if someone manages their dep graph correctly, which is easier with pnpm, but not everyone gets it right, and folks have a hard time tracking down errors
  • @glimmer/tracking removed because it's a real package, but one we don't want to use. This comes up in embroider/vite where the presence of real packages always takes precedence over virtual packages. This is actually problematic because it can break reactivity in subtle ways, even if a dep graph is correct - allowing duplicates of dependencies, which for the glimmer internals, we don't want.

Hope this helps!

NullVoxPopuli avatar May 10 '25 14:05 NullVoxPopuli

addon blueprints add a peer dependency on ember-source

I removed it from the v2 addon blueprint yesterday. And removed @glimmer/tracking from the v2 app blueprint a couple days prior

NullVoxPopuli avatar May 10 '25 14:05 NullVoxPopuli

Opened a PR here for the v1

https://github.com/ember-cli/ember-cli/pull/10697

NullVoxPopuli avatar May 10 '25 14:05 NullVoxPopuli

Thanks a lot for sharing all those details.

I tend to wait merging this one until the change got merged into the standard blueprints. I have only very limited time for maintaining this addon and others. Therefore I try staying as close as possible to the defaults to ease maintenance.

jelhan avatar May 10 '25 16:05 jelhan

The maintained addon blueprints already do this:

  • old: https://github.com/embroider-build/addon-blueprint/blob/main/files/addonLocation/package.json
  • proposed new default: https://github.com/ember-cli/ember-addon-blueprint/blob/main/files/package.json

NullVoxPopuli avatar May 10 '25 17:05 NullVoxPopuli