haxe-modular icon indicating copy to clipboard operation
haxe-modular copied to clipboard

Can I split a library out?

Open elsassph opened this issue 7 years ago • 0 comments

I've been asked about splitting some dependencies that change rarely, like OpenFL for instance. This is a good idea in principle - such JS could be cached agressively so users don't reload them.

Unfortunately I've hit a few problems regarding code shared between such a library and the rest of the application:

  • libraries need to be loaded before modules depending on them; otherwise scope wiring is problematic,
  • but libraries need support code ($hxClasses, $estr, $bind,...) which in some cases must not be duplicated,
  • which means considering the library code could be needed for the index module we'd need a bootstrap module with the support code.

This all requires a bit of thinking, and probably some non-trivial refactoring...

elsassph avatar Sep 17 '17 19:09 elsassph