ember-auto-import icon indicating copy to clipboard operation
ember-auto-import copied to clipboard

omit dependencies bundled with ember-source from participating in the webpack fun

Open NullVoxPopuli opened this issue 3 years ago • 2 comments

Resolves: https://github.com/ef4/ember-auto-import/issues/564 Eliminates, what I believe to be a require-cycle:

  • rsvp is require'd
  • rsvp previously depended on the early boot set
  • but the early boot set contains dependencies which depend on rsvp (@ember/object / mixins, etc)

further investigations after the embroider office hours:

  • is rsvp duplicated?
    • yarn why rsvp
      ❯ yarn why rsvp
      yarn why v1.22.19
      [1/4] 🤔  Why do we have the module "rsvp"...?
      [2/4] 🚚  Initialising dependency graph...
      [3/4] 🔍  Finding dependency...
      [4/4] 🚡  Calculating file sizes...
      => Found "[email protected]"
      info Has been hoisted to "rsvp"
      info Reasons this module exists
         - Hoisted from "ember-bootstrap#rsvp"
         - Hoisted from "ember-cli-typescript#rsvp"
      
      yes
  • why is rsvp used in ember-bootstrap?
    • no types, so the types from rsvp are not used
    • used in node for tests, so dep must exist so node knows where to find it
    • in browser (the addon code), the rsvp-shipped-with-ember would be sufficient
  • does autoImport.exclude with rsvp fix the problem?
    • from the app: no
    • from ember-bootstrap: yes
      // node_modules/ember-bootstrap/index.js
      options: {
        '@embroider/macros': {
          setOwnConfig: {},
        },
        autoImport: {
          exclude: ['rsvp'],
        }
      }
      

Path forward ensure that these dependencies are always excluded from ember-auto-import (at least until ember-source becomes a real package)

NullVoxPopuli avatar Feb 13 '23 20:02 NullVoxPopuli

All green except for an IE11 test

NullVoxPopuli avatar Feb 15 '23 19:02 NullVoxPopuli

Thanks a lot for working on this. Please let me know if there is anything I could do to get it released.

jelhan avatar Feb 18 '23 17:02 jelhan

As the issue has been resolved otherwise, this seems to be not needed anymore? @NullVoxPopuli can we close it?

simonihmig avatar Sep 16 '24 10:09 simonihmig

yes! thanks for reminding me!

NullVoxPopuli avatar Sep 16 '24 12:09 NullVoxPopuli