Skip to content

Releases: wrabit/django-cotton

v1.0.3

15 Sep 18:48
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.0.2...v1.0.3

v1.0.2 - Fix empty cvars

15 Sep 17:52
Compare
Choose a tag to compare

What's Changed

  • Fixed cases where cvars without values were not being overwritten by component attributes
  • Added test
  • fixed compiler setting empty cvars to None by @wrabit in #144

Full Changelog: v1.0.1...v1.0.2

v1.0.1 - fixes

15 Sep 12:34
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.0.0...v1.0.1

v1.0.0 - Rewrite + Improved Performance

15 Sep 10:45
d077fa8
Compare
Choose a tag to compare

What's Changed

Summary:

  • Simplified loader logic, moving cvars logic to templatetags
  • Dropped internal requirement for component keys throughout
  • Improved component template caching
  • Cleaned shared responsibility of slot tag and created new internal tag - 'attr' to handle attribute expressions
  • Simplified context handling, now keep all cotton related state in own context object
  • Up to 32% faster*

Performance vs old*

These benchmarks were run over 5 iterations with 500 iterations per test case (representing the rare cases you may have ~500 components on the page), comparing Django native vs. Cotton for loops, block and extends, and includes.

For loop

Django average: 2.18 ms
- Cotton before: 4.65 ms
- Cotton after: 3.17 ms

✅ 31.83% improvement with the overhaul


Block and Extends (Django equivalent)

Django average: 9.38 ms
- Cotton before: 11.38 ms
- Cotton after: 10.56 ms

✅ 7.21% improvement with the overhaul


Include

Django average: 3.12 ms
- Cotton before: 3.16 ms
- Cotton after: 3.04 ms

✅ Cotton performs on-par with Django when used as partial inclusion.


⚠️ Possible breaking changes:

  • Boolean attributes were previously triggered even when an attribute had an intentional empty srtring:
<c-comp myattr />
<c-comp myattr="" />
<c-comp :myattr="i_evaluate_as_empty_string" />

{{ myattr }} <!-- All cases above parse as True

This has now been fixed and only valueless attributes will render as True. Although this was unintentional, some of you may have relied on this defunct behaviour, so be sure to test.

  • Support quoted json-like values in {{ attrs }} by @mattbha in #137
  • updated render benchmarks by @wrabit in #138
  • Support proper boolean attributes by @wrabit in #139
  • Tags rewrite + optimisations (up to 28% faster) by @wrabit in

Full Changelog: v0.9.40...v1.0.0

v0.9.40

11 Sep 20:21
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.9.39...v0.9.40

v0.9.39

11 Sep 14:19
Compare
Choose a tag to compare

What's Changed

  • Upgraded docs django and python, plus set a version on django dependency by @wrabit in #128
  • Requestcontext issue by @wrabit in #129

Full Changelog: v0.9.38...v0.9.39

v0.9.38

10 Sep 20:03
Compare
Choose a tag to compare

Prevent unintended encoding of decoded html entities in components

  • Prevent compilation step from encoding html chars by @wrabit in #127
  • Dynamic attributes docs by @wrabit in #123

Full Changelog: v0.9.37...v0.9.38

v0.9.37

07 Sep 23:57
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.9.36...v0.9.37

v0.9.36

07 Sep 10:24
Compare
Choose a tag to compare

What's Changed

Related:

Full Changelog: v0.9.35...v0.9.36

v0.9.35

02 Sep 21:24
Compare
Choose a tag to compare

What's Changed

  • fixed unintended literal evaluation of non dynamic properties by @wrabit in #113

Full Changelog: v0.9.34...v0.9.35