cli icon indicating copy to clipboard operation
cli copied to clipboard

Dynamic imports

Open SteinRobert opened this issue 4 years ago • 2 comments

I just stumbled across this example (https://github.com/pallets/click/tree/main/examples/complex/complex) provided by the awesome click project.

I have to admit I'm very intrigued by the implementation, it looks pretty neat to dynamically import the commands.

SteinRobert avatar Nov 12 '21 09:11 SteinRobert

@SteinRobert What would be the main benefit of that approach? The command structure might be automatically mirrored by the module structure and you don't ave to manually add a new command? Talking about imports, I think we shoud definitely get rid of that src in all the imports.

schwobaseggl avatar Nov 26 '21 14:11 schwobaseggl

Talking about imports, I think we shoud definitely get rid of that src in all the imports.

This - 100%.

@SteinRobert What would be the main benefit of that approach? I was thinking maybe the CLI would become a bit more faster. However, I just did a test a few weeks ago and the performance gains have been around 50-100ms. So dynamic imports are probably a bit of a premature optimization, if ever needed.

SteinRobert avatar Dec 07 '21 18:12 SteinRobert