Or, a lot of things yet again.
1. Prototypes are avoided. Method definitions are avoided at all costs in the
renderer. C-like structs are exclusively used internally. This helps
significantly in both speed and size.
2. The deferred implementation had a couple functions refactored into static
equivalents.
3. Only 1 test fails now.
4. Several names were changed to be much smaller. Some of the exports were
aliased. This was a pure size improvement for free.
5. Regexes are inlined. It's better to let the engine do the caching.
6. The version string was inlined. It's still at the top.
7. `this` is avoided as much as possible in the rendering.
This mostly isolates the implementations for both of these. Now, everything
here calls the method itself, not any of the external methods.
Few driveby fixes as well:
1. Git now ignores archive/ again (it's a build artifact, and can be removed
when updating `master`)
2. Since I had to rewrite most of the Deferred implementation, the new version
passes one of the skipped tests, so it is now enabled.
This changes enough things to merit a new patch release. It changed a few
implementation details in the process, but it's at least much cleaner.
Be ready for every other currently outstanding PR for this file to have merge
conflicts.
By "fixed", I mean "screwed up, not at all following the correct version
number, and refusing to ask on Gitter what the correct version really is, and
just assuming the wrong version despite hints all over the source screaming
'THIS IS THE CORRECT VERSION, YOU STUPID IDIOT!!!'".
I feel that should be a relatively accurate explanation of the mistake I made
while working on this patch (the specific commit that introduced it was
squashed in rebasing, and another commit was easier than a revert, since the
one that introduced it also entailed a few other things).
This is in preparation for a PR, to reduce potential for merge conflicts
with either my PR or others', since mine will modify a large amount of
the main file.
m.route('path'), when called programmatically (not attached to an anchor
tag), did not update the url in the navigation bar. I tracked it to this
error, where it is searching for an elements attributes, sepecifically
the this.attrs.href, which did not exist when called programatically.
The error returning was "Cannot read property 'href' of undefined",
which linked back to line 618 in the mithril core file.
I added a simple check to see if this.attrs exists before calling in
.href. Fixed it like a charm. I tried to follow the current coding
style, but let me know if there is something amiss in my change.
I ran both grunt test and grunt testall and everything seemed to run
perfect.