hslayers / hslayers-ng

User interface and map building extensions for OpenLayers
https://ng.hslayers.org/
MIT License
37 stars 20 forks source link

Decouple components #2111

Closed raitisbe closed 3 years ago

raitisbe commented 3 years ago

Feature Request

Hslayers components are not tree-shakable and all of them are included in every application which uses hslayers. For example trip-planner, sharing and location, add-data searching functionality might not always be needed, but still are included in all applications. Add data is especially heavy because it imports large OL modules (KML support).

jmacura commented 3 years ago

https://angular.io/guide/architecture-services#providing-services https://angular.io/guide/lightweight-injection-tokens

raitisbe commented 3 years ago

https://angular.io/guide/architecture-services#providing-services https://angular.io/guide/lightweight-injection-tokens

Very interesting, even if we are not using @ContentChild that much. Wonder if those tokens would work for dynamic components such as dialogs or panels (later)

jmacura commented 3 years ago

https://angular.io/guide/architecture-services#providing-services https://angular.io/guide/lightweight-injection-tokens

Very interesting, even if we are not using @ContentChild that much. Wonder if those tokens would work for dynamic components such as dialogs or panels (later)

Aye, it won't affect us that much now, as I can't recall we use @ContentChild anywhere. Meanwhile I found this Medium article which seems to be much more relevant to us: https://tomastrajan.medium.com/the-best-way-to-architect-your-angular-libraries-87959301d3d3