beeware / batavia

A JavaScript implementation of the Python virtual machine.
http://pybee.org/batavia
Other
1.39k stars 424 forks source link

Update Django to Latest and Make CodeMirror npm Installed #770

Closed danyeaw closed 5 years ago

danyeaw commented 5 years ago

Updates Django to version 2.1.5, including:

Since the version of CodeMirror being packaged was very old, moved it to be npm installed:

Update Babel configurations and package.json to fix issues caused by the upgrade to Babel 7

Enabled source map creation in webpack to improve debugging

PR Checklist:

danyeaw commented 5 years ago

@freakboy3742 Thanks for your review and feedback!

After spending quite a bit of effort tracking it down, I think I resolved the issue with the builds failing hard. Webpack 4 has an issue with building for universal targets: https://github.com/webpack/webpack/issues/6525. I made use of the workaround to create a globalObject in the webpack config.

For dependencies and building I updated it with:

Running Batavia tests requires the development dependencies if PRECOMPILE is set. I thought this is much more useful for debugging while testing, but there might be different use cases. Is this what you had in mind as well?

I was not able to selectively load plugins for webpack using a single config file. If we want to reduce the number of normal dependencies then I would need to create separate dev and prod config files, and I'm not sure if we wanted that complexity.