Releases: RandomHashTags/swift-htmlkit
0.6.0
Breaking changes
- dropped requirement of declaring innerHTML values in an array
// previous version (no longer compilable in 0.6.0)
#div(attributes: [.class(["dark"])], [
#p(["Macros are beautiful"])
])
// new version
#div(attributes: [.class(["dark"])],
#p("Macros are beautiful")
)New
- can now escape HTML via
#escapeHTML()macro or 4Stringextension functions (HTML macros automatically escape characters) - writing string interpolation in HTML macros now throws a compiler warning saying it can introduce raw HTML
- dynamic benchmarks
Other
- fixed a case where creating a
StaticStringwould not be permitted, even though it should've been - updated
swift-syntaxdependency url (wasapple/swift-syntax, nowswiftlang/swift-syntax) - more libraries benchmarked
- updates to README, including
- toned-down verbiage
- benchmarks are now pngs
- how to escape HTML
Full Changelog: 0.5.0...0.6.0
0.5.0
- fixed
attributionsrcattribute (nowattributionSrc) - fixed
htmlelement not allowing attributes - can now create custom elements and attributes (view README on how-to)
- added compile safety when declaring values for an attribute that takes an array (now disallows the separator character depending on the element)
- added benchmarks
- updates to README
- more unit tests
Full Changelog: 0.4.0...0.5.0
0.4.0
QOL improvements including:
- allowing the macros to return as any
ExpressibleByStringLiteral(likeStaticString)- NOTE: enforce all inner html declarations to conform to a specific
ExpressibleByStringLiteralby assigning the type annotation
- NOTE: enforce all inner html declarations to conform to a specific
- fixed: allowing more than 1 of the same global attribute in the compiled result (now throws a compiler error)
- dropped inner label requirements for the
dataandeventglobal attributes
Full Changelog: 0.3.0...0.4.0
0.3.0
Global attribute syntax changed (moved to attributes label); extra attribute enums moved; added support for events.
Mainly to avoid bloating macro declarations with a billion options, which wastes space.
Full Changelog: 0.2.1...0.3.0
0.2.1
This release corrects input's type value type, which is source breaking, but it should've never been the previous value type.
Full Changelog: 0.2.0...0.2.1
0.2.0
Bug fixes and QOL improvements
Fixes
- certain attributes that take an array requiring a comma separated html value instead of space separated
- some html elements missing some attributes, or their value type being incorrect
- attributes with an integer or HTMLElementAttribute array value type not being compilable
- the
typeattribute not compiling correctly depending on the html element - the
acceptCharsetlabel not compiling toaccept-charset - the
roleattribute accepting any string (now requires aHTMLElementAttribute.rolecase)
QOL
- no more string interpolation for HTMLElementAttribute enum values (now they get compiled directly to their rawValue/htmlValue)
- third-party function calls, literals, and enums are now compiled to interpolated values when declared as an attribute value
- updates to README
Changes
dataattribute now requires a tuple value type- unit tests now use
swift-testinginstead ofXCTest
Updates
swift-syntaxdependency to600.0.0
Full Changelog: 0.1.0...0.2.0
0.1.0
I'm content with the state of the library to make a release.
Need to fix a few small things and add a lot more unit tests before a stable/production-ready (1.0.0) release.
Full Changelog: https://github.com/RandomHashTags/swift-htmlkit/commits/0.1.0