Skip to content

Releases: wrabit/django-cotton

v1.1.0

29 Sep 16:25
ca4ddde
Compare
Choose a tag to compare

New compilation technique, possible minor breaking changes, performance summary

🫳 Dropped BS4 (BeautifulSoup4) for HTML parsing in the compilation step.

This was due to:

  • Increasing number of patches to control BS4's parsing and validating of the HTML
  • Inability to support some planned features of cotton, without some extensive patching of BS4 base classes, specifically for now supporting quoteless attributes

⚠️ Minor changes:

  • Attribute casing is now preserved. <div SomeAttribute="1"> would have previously been lowercased.
  • Whitespace behaviour is now more in-line with your template, this should not affect the view, but may affect things like tests if you have any changing HTML
  • Whitespacing around attributes in some of the tags have changed which again may affect tests

🏎️ Performance summary

A fix for a recent issue allowed us to improve performance and we're now on par with (and sometimes outperforming) Django for the render load tests. (scope of tests have room for improving)

Running benchmarks with 5 runs, 5000 iterations each
---
Native Django {% for %} loop: 38.59 ms
Cotton equivalent: 28.34 ms
---
Native {% include %}: 28.64 ms
Cotton equivalent: 28.98 ms
---
Native {% block %} and {% extends %}: 90.44 ms
Cotton equivalent: 103.65 ms

Full Changelog: v1.0.12...v1.1.0

v1.0.12

27 Sep 22:04
Compare
Choose a tag to compare

Support for python 3.8

  • Changed @cache to the equivalent @lru_cache(max_size=None) by @wrabit in #167

Full Changelog: v1.0.11...v1.0.12

v1.0.11

27 Sep 18:52
Compare
Choose a tag to compare

What's Changed

  • An issue reported a gradually increasing delay between page loads, noticed when specifically using 'django-browser-reload' plugin. Some investigation showed get_dirs() to create delays over time, added @cache.

Full Changelog: v1.0.10...v1.0.11

v1.0.10

24 Sep 16:38
Compare
Choose a tag to compare

Bug fix

  • Fixed ordering of tag attributes inside named slots by @wrabit in #164

Full Changelog: v1.0.9...v1.0.10

v1.0.9

23 Sep 14:01
Compare
Choose a tag to compare

Bug fix

  • Fixed order of priority of incoming attributes over <c-vars /> by @wrabit in #161

Full Changelog: v1.0.8...v1.0.9

v1.0.8

20 Sep 09:35
a89ef66
Compare
Choose a tag to compare

The previous version isolates too much of the original context. This needs more time to work on a suitable solution to isolate context, for now we're reverting the behaviour.

v1.0.7

20 Sep 00:33
Compare
Choose a tag to compare

What's Changed

  • Reinstated isolated context by @wrabit in #157
  • Added template partials setup guide to docs by @wrabit in #154

Full Changelog: v1.0.6...v1.0.7

v1.0.6 - bugfix

19 Sep 08:29
Compare
Choose a tag to compare

What's Changed

  • Ensure boolean attrs in {{ attrs }} appear as attributes without a value by @wrabit in #151

Full Changelog: v1.0.5...v1.0.6

v1.0.5

18 Sep 08:45
Compare
Choose a tag to compare

What's Changed

  • fixed case where cvars dynamic defaults were not being applied by @wrabit in #150

Full Changelog: v1.0.4...v1.0.5

v1.0.4

16 Sep 09:00
Compare
Choose a tag to compare

What's Changed

  • Fixed string attributes being parsed as a template variables by @wrabit in #149

Full Changelog: v1.0.3...v1.0.4