sergei-maertens / django-systemjs

MIT License
42 stars 5 forks source link

Static bundling with Rollup optimization. #28

Closed ilyashupta closed 7 years ago

ilyashupta commented 7 years ago

In jspm 0.17 there is a jspm build command that takes similiar to jspm bundle command and produces bundle without unused code exports. More info here: http://jspm.io/0.17-beta-guide/static-builds-with-rollup-optimization.html What are current plans on supporting this?

sergei-maertens commented 7 years ago

Currently unsupported, but it looks like a nice feature to have!

How would you like to see the API for this? Something like {% systemjs_import 'myapp.js' rollup=True %}? Or a global option to pass to the management command, like python manage.py systemjs_bundle --rollup?

ilyashupta commented 7 years ago

As I see it there are two particular uses for build command, one is to create optimized bundle for production and the other one is to create static build for using in another projects (passing more options to the cli tool for excluding particular dependency trees). I guess this project should support only the first one and it should be pretty straightforward to implement since the command is similiar to bundle, as for the API python manage.py systemjs_bundle --rollup seems more sane to me, considering this most usable when creating production bundle.

sergei-maertens commented 7 years ago

Sounds relatively straight forward, that can be added. I need to set aside some time for this though, so if any groundwork could be done with a PR that would be tremendously appreciated!

On Nov 17, 2016 3:07 PM, "Ilya Shupta" notifications@github.com wrote:

As I see it there are two particular uses for build command, one is to create optimized bundle for production and the other one is to create static build for using in another projects (passing more options to the cli tool for excluding particular dependency trees). I guess this project should support only the first one and it should be pretty straightforward to implement since the command is similiar to bundle, as for the API python manage.py systemjs_bundle --rollup seems more sane to me, considering this most usable when creating production bundle.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/sergei-maertens/django-systemjs/issues/28#issuecomment-261254936, or mute the thread https://github.com/notifications/unsubscribe-auth/AFQ01mMalX6rXzHQkF6G9wBgV50j5Sc4ks5q_F-fgaJpZM4K1UVL .

ilyashupta commented 7 years ago

I'd really like to, give me some time for this though.

sergei-maertens commented 7 years ago

Of course :)

On Nov 17, 2016 3:27 PM, "Ilya Shupta" notifications@github.com wrote:

I'd really like to, give me some time for this though.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/sergei-maertens/django-systemjs/issues/28#issuecomment-261259845, or mute the thread https://github.com/notifications/unsubscribe-auth/AFQ01uIIXw-lEB4Dq33PCxuxKT9TjPtfks5q_GQ9gaJpZM4K1UVL .

ilyashupta commented 7 years ago

That's it. API stays the same, turned out we just fixed sfx build for 0.17 version of jspm.

sergei-maertens commented 7 years ago

I see, and at a later point we could ad support for arguments like --externals etc?. Cool, I'll try and release a new version to PyPI asap!

ilyashupta commented 7 years ago

You want systemjs_bundle to mimic the corresponding jspm bundle or jspm build commands with all their flags?

sergei-maertens commented 7 years ago

In the long term, yes, it should be able to pass all jspm options to the management command. For now it's fine.

Thanks for the contribution!

On Nov 18, 2016 8:16 PM, "Ilya Shupta" notifications@github.com wrote:

You want systemjs_bundle to mimic the corresponding jspm bundle or jspm build commands with all their flags?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/sergei-maertens/django-systemjs/issues/28#issuecomment-261616846, or mute the thread https://github.com/notifications/unsubscribe-auth/AFQ01iI7hsTT8eW37QSjKoiTuOhZhxcyks5q_fl2gaJpZM4K1UVL .

ilyashupta commented 7 years ago

I think you'll have to split systemjs_bundle to two different management commands at some point then. Also I'd like to add --skip-source-maps option support to the management command, would you like a PR?

sergei-maertens commented 7 years ago

Yeah sure, and you're right, but I'll wait until 0.17 is out of beta to split it.

On Nov 18, 2016 8:21 PM, "Ilya Shupta" notifications@github.com wrote:

I think you'll have to split systemjs_bundle to two different management commands at some point then. Also I'd like to add --skip-source-maps option support to the management command, would you like a PR?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/sergei-maertens/django-systemjs/issues/28#issuecomment-261618212, or mute the thread https://github.com/notifications/unsubscribe-auth/AFQ01nXPh3tnRYtcGtqdoebJWiYMLgouks5q_fqxgaJpZM4K1UVL .

ilyashupta commented 7 years ago

Here is some recent info about 0.17 beta status https://github.com/jspm/jspm-cli/issues/2152#issuecomment-259398840 Seems like they wont change the API in 0.17 anymore

sergei-maertens commented 7 years ago

@funn 1.4.2 has just been release to PyPI