RaveJS / rave

Zero-configuration application bootstrap and development
278 stars 8 forks source link

Allow devs to opt-in to overrides from third-party rave extensions. #44

Closed unscriptable closed 10 years ago

unscriptable commented 10 years ago

There are so many broken packages out there, especially in bower, but npm has a few, too (AngularJS, for instance). We invented the not-yet-documented "overrides" property for bower.json or package.json to allow app devs to fix metadata issues. However, we ignore the overrides feature in third-party packages.

I'm proposing that we allow devs to opt-in to overrides from third-party packages. We can do this via an HTML attribute, i.e:

<html data-rave-overrides="rave-frozen">

The default would be data-rave-overrides="rave-overrides" if omitted. This allows us to publish a repo of overrides that the community can keep updated. See #43.

KidkArolis commented 10 years ago

Do you think there should be an override file per bower component? If so, how would rave (or rave extension) know that there is an override for a given module - fetching every time would result in more 404s.

If it's one large overrides file - wouldn't that get too big?

unscriptable commented 10 years ago

I'm hoping the [single] overrides file would get smaller over time, not larger. :) Of course, at first it will grow. Perhaps it may become too large for comfort. I hope not.

Is there some way we can encourage folks to fix the broken package metadata? @briancavalier had an idea: call this repo "bower-packages-of-shame" or something like that. Any other ideas?

briancavalier commented 10 years ago

Yeah, I really hope it would shrink to zero in the long term.

Coupla concerns I just thought of:

  1. Timing of fixes and updates: It's possible that an overridden library gets fixed, but the overrides-of-shame are not updated. That could break that package for everyone who upgrades ... hopefully people would start yelling and we'd be able to fix (ie remove its overrides) it quickly.
  2. Versioning: Say version 1 of lib X needs to be overridden, but version 2 doesn't. How would we handle that?
unscriptable commented 10 years ago

Versioning is definitely a problem with a centralized overrides file as in #43. :( I don't see it as a problem for a well-behaved rave-extension that declares its peer dependencies correctly.

briancavalier commented 10 years ago

Drat, I really should have posted my last comment in #43. Oops!

unscriptable commented 10 years ago

Fixed via 0.2.0.