ntoll / uflash

A module and command to easily flash Python onto the BBC's micro:bit device.
http://micropython.org/
MIT License
101 stars 27 forks source link

Minify scripts #45

Closed ZanderBrown closed 6 years ago

ZanderBrown commented 6 years ago

Partly resolves #44 but doesn't allow forced minification

Based on and supersedes work over in Mu

carlosperate commented 6 years ago

The nice thing about uFlash is that it works on it's own without having to install/pip install anything else. If the minification is going to be done in a separate module, could that be an optional dependency? So if it's not present uFlash could still work as it did.

ntoll commented 6 years ago

@ZanderBrown many thanks for this! I think the feature is important but I'm not sure we're there on the details yet. As you probably realise from my comments on the code, I'd like:

As always, I'm all ears to alternatives to the above. :-)

ntoll commented 6 years ago

@ZanderBrown just read your comment in the Mu repository about splitting out the logic for minification should other projects want to re-use it. That's a really good point. Hmmm... not sure what to do WRT zero-dependencies uflash vs. re-use of nudatus. Could nudatus be merged into uflash..? Quite understand if you don't want to do this... although I'm quite happy to move uflash into a Mu-editor repository (so I cede "ownership") and update copyright to include you etc etc etc... Basically, I'm all ears for suggestions to resolve this. Perhaps add nudatus to Mu's contrib namespace (like uflash)..? Thoughts and ideas most welcome! I'm just thinking raw thoughts out loud... :-)

ZanderBrown commented 6 years ago

@ntoll some pretty raw thoughts in response:

That's a really good point. Hmmm... not sure what to do WRT zero-dependencies uflash vs. re-use of nudatus. Could nudatus be merged into uflash..?

Hmm, the problem there is that uflash is micro:bit specific and i was hoping to be a little more generic, but equally uflash is quite small

Quite understand if you don't want to do this... although I'm quite happy to move uflash into a Mu-editor repository (so I cede "ownership") and update copyright to include you etc etc etc...

Not the end of the world but having published to pypi ext it would nice to retain some kind of 'ownership' and I wouldn't want to start making a mess of the Mu commit log (or uflash for that matter)

Reminds me I should add a copyright notice to nudatus as it currently stands

Basically, I'm all ears for suggestions to resolve this. Perhaps add nudatus to Mu's contrib namespace (like uflash)..? Thoughts and ideas most welcome! I'm just thinking raw thoughts out loud... :-)

For Mu obviously pip or the contrib namespace are perfectly fine as has been done with other dependencies, would defeat being open-source otherwise

uFlash is probably more complicated here as it's always tried to be a single all in one script and i don't want to 'break' that, which is why nudatus is an 'optional' import (following @carlosperate 's comment)

tl;dr I would like to keep nudatus as a project in a separate repo I control (although moving to mu-editor rather than ZanderBrown would be fine) but I'm not massively bothered how Mu/uFlash incorporate it barring the standard credit the author

ntoll commented 6 years ago

@ZanderBrown completely understand! Given your comments I think the solution is:

I'll merge this tomorrow since I'm off on Dad taxi duties 10 minutes ago... ;-) (yeah I'm late).

ntoll commented 6 years ago

@ZanderBrown the work for exposing this functionality has made its way into Mu. Click on the admin cog on the bottom right and you'll see a new tab:

microbit_admin

ZanderBrown commented 6 years ago

:tada: Nice to see it come together