cljsjs / boot-cljsjs

Helper tasks to aid the packaging of JS dependencies for Clojurescript projects
66 stars 22 forks source link

Provide a way to have multiple externs #33

Closed martinklepsch closed 6 years ago

martinklepsch commented 8 years ago

Many externs are generated via one of the excellent generators, sometimes these externs are not complete and people add whats missing. Then a new version is released and someone generates a new externs file replacing the previously edited one. Because diffs are hard often previous modifications get lost.

Since this kind of situation seems likely to repeat maybe it'd make sense to allow for multiple ext.js files in a single package. this way we could have one file for "manual" and one file for "generated" (or whatever else seems fitting to the respective author).

At build time the externs could be concatenated. This would probably require some additional preflight checking to catch duplicate declarations but in theory it sounds possible? (see #32)

A bit further away but in theory we could declare externs in some easy to handle data format (e.g. edn) as well, no? This way merging would be trivial. Converting an edn file into the required .js file seems doable as well. This adds quite a bit of indirection so I'm not entirely sure if it's worth it.

via https://github.com/cljsjs/packages/issues/292

timothypratley commented 8 years ago

It seems like deps-cljs does handle multiple externs, it produces a vector with a list of all the extern files. Should this issue be closed? Or am I misunderstanding?

jmmk commented 8 years ago

It might be a good idea to add some extra output (header and footer) to the generated extern. This way, any manual additions could be written outside of that generated block and hopefully more easily identified.

Deraen commented 6 years ago

Updated deps-cljs task supports multiple extern files.