LinkedSoftwareDependencies / Components.js

🧩 A semantic dependency injection framework
https://componentsjs.readthedocs.io/
Other
41 stars 6 forks source link

Ignore duplicate types when overriding components #106

Closed joachimvh closed 2 years ago

joachimvh commented 2 years ago

As discussed in https://github.com/LinkedSoftwareDependencies/Components.js/discussions/105#discussioncomment-3455593

I used the componentResources as an additional parameter since that is what ConfigPreprocessorComponent did, but I'm not actually sure why/if they're needed since all the resources with the same identifier seem to be the same everywhere. Using the type itself instead of componentResources[type.value] seemed to also work.

Also noticed there was a file with URI constants so used that for the override URIs.

coveralls commented 2 years ago

Pull Request Test Coverage Report for Build 2911512099


Totals Coverage Status
Change from base Build 2796194601: 0.0%
Covered Lines: 1362
Relevant Lines: 1362

💛 - Coveralls
coveralls commented 2 years ago

Pull Request Test Coverage Report for Build 2911512099


Totals Coverage Status
Change from base Build 2796194601: 0.0%
Covered Lines: 1362
Relevant Lines: 1362

💛 - Coveralls
rubensworks commented 2 years ago

Looks perfect! Released as 5.3.1.

I used the componentResources as an additional parameter since that is what ConfigPreprocessorComponent did, but I'm not actually sure why/if they're needed since all the resources with the same identifier seem to be the same everywhere. Using the type itself instead of componentResources[type.value] seemed to also work.

If I remember correctly, this had something to do with resources being created by different object loaders, and that possibly causing issues sometimes.