Automatically generating code is fun and all, but maybe I need to split the generated code into several files. 109 symbols for various unrelated things in a single namespace gets a bit messy. :blobblush:

On the one hand, I much prefer server-side generated HTML with a little bit of Javascript to enhance parts of it. On the other hand, once said enhancements become even slightly more complex, this approach results in a horribly unmaintainable mess of DOM manipulation, and an alternative approach is needed. That's when I prefer to write the entire thing in , but at that point nothing works anymore with NoScript.

Why is web development so annoying?

0.19: "We've removed all Native modules and plugged all XSS vectors, it's now impossible to talk with Javascript other than by using asynchronous ports!"
Me: "Oh yeah? I'll just run sed over the generated Javascript and patch in my own methods!"

I just figured out an alternative hack to upload files from , without relying ports or 'Native' code.

I now let Elm send a regular HTTP POST request, with the id of the file input in the request body. I then override XMLHttpRequest.prototype.send() with my own to intercept this body, grab the file from the DOM, and insert it into the request.

I'm not proud of myself, but it works.

Ew, upgrading to 0.19 is kinda painful; Mainly because I was using some hacks with 'Native' and 'effect' modules, both of which are now horribly (and, unsprisingly intentionally) broken.

And there's still no supported solution for file uploads. 😢

Ooh, 0.19 is finally out! 10 months later than I had expected, but no matter, I wasn't in any hurry. Looks like there's a bunch of nice improvements. I'll upgrade my code in the next few days and see how that works out in practice.

niu.moe

Welcome to your niu world ! We are a cute and loving international community O(≧▽≦)O !