redstone-dart / redstone

A metadata driven microframework for Dart.
http://redstone-dart.github.io/redstone
MIT License
342 stars 42 forks source link

deployServer copies client side dependencies to bin #6

Closed nistvan86 closed 10 years ago

nistvan86 commented 10 years ago

Hi!

I've just found bloodless recently. I really like the whole concept behind, thanks for developing it!

I have created a Grinder based build script following the example in the readme to test the build. I've noticed that Grinder copies even client side dependencies to build/bin/packages, for example the browser package which is meaningless on the server side. Client side dependencies are built as expected, bloddless doesn't gets copied to build/web/packages.

luizmineo commented 10 years ago

Hi,

Unfortunately, there is no way to know if a package is used only on the server or client side.

To minimize this problem, you can split your project in two: one for the server side, and another with the client stuff. But since bloodless depends on packages that works on the both sides (for example: di and route_hierarchical), you'll still see packages like browser copied to the server build.

Maybe in the future, the Dart SDK provides an easy and safe way to "compile" your server code to a single file, removing unused code. But until then, there is no definitive solution to this problem.

nistvan86 commented 10 years ago

I see. Thanks for explaining.