jspm / registry

The jspm registry and package.json override service
https://jspm.io
229 stars 256 forks source link

Package Override-Variants #1005

Open bbak opened 7 years ago

bbak commented 7 years ago

Assume, e.g. somebody wants a bootstrap 4-alpha including the SCSS Sourcefiles.

It seems like providing an additional override that includes the SCSS Files (in contrast to the current overrides) is not possible.

Or am I missing something?

smajl commented 7 years ago

I assume this is a same issue: https://github.com/jspm/registry/issues/179

aluanhaddad commented 7 years ago

@smajl I'm not convinced that #179 covers this issue because while they are both about style sheets the question is actually much broader. What if I want to consume the source of any package instead of its output during development. This can be a pain but it would be nice to have an option to do it. Source mapping helps at runtime but there are other use cases. What if I want to dynamically transpile my dependencies from source? Depending on how jspm installs the package, which depends on the override, this can range from being fairly simple to requiring non-trivial additional configuration.

bbak commented 7 years ago

@aluanhaddad Indeed, that's the real issue here: For some reason (and there are many), someone wants to consume the sources of a package; but is unable to do so through the jspm registry, depending on how the ONE override in the registry is written.

Of course, most of the time it's possible to work around that problem - e.g. by fetching the native repo - but it would be a improvement if some different kinds of override-files were possible: hence Variants.

aluanhaddad commented 7 years ago

@bbak For what it is worth, one can often achieve most of this without too many custom overrides. I think it might be better to look at this, not from the override perspective, but rather as a case of simply wanting to target different configurations within the same package during different development phases. So, hypothetically, there could still be just a single override, but multiple entry points. However, that would almost certainly involve much broader changes.

However, while I think building dependencies from source is perfectly reasonable, and I have found it valuable, it is a complex scenario and something which will only work for certain combinations of packages, transpilers, and so on. There is no guarantee it will work.