Releases: JeyDotC/JustCs
Releases · JeyDotC/JustCs
v1.2.0
v1.1.0
What's Changed
- jcs-7: Fixed potential security breach in the HTMLRenderer class. by @JeyDotC in #12
- #9 Some HtmlRenderer improvements. by @JeyDotC in #13
- jcs-8: All properties, except for those under the DataSet property are now just lower cased. by @JeyDotC in #14
- #10 Created Attr annotation to allow naming convention override. by @JeyDotC in #15
- Release/jcs 16 v1.1 by @JeyDotC in #17
Full Changelog: v1.0.3...v1.1.0
Some declarative goodies!
What's Changed
Added attr extensibility and conditional rendering.
The Attr class now allows to add arbitrary attributes via its (_) property which works as sort of "spread operator":
Example:
_<Script>(new Attrs
{
Src = "some-script.js",
_ = new {
Nonce = "dijdfoisjdfois",
SomeCoolAttribute = "arbitrary!",
}
}
);
Will produce:
<script src="some-script.js" nonce="dijdfoisjdfois" some-cool-attribute="arbitrary!"></script>
The arbitrary attributes will follow the rules stated at Wiki: Element Attributes.
Conditional Rendering
You can now decide if a component will be rendered by providing a tuple which first value is a boolean and the second being the element.
Example:
_<Ul>(
(true, _<Li>("This element will render"),
(false, _<Li>("This element will NOT render")
);
Will produce:
<ul>
<li>This element will render</li>
</ul>
Notice that the second <li>
wasn't rendered.
You can also avoid creating the element's instance by providing a Func<Element>
as the second parameter:
_<Ul>(
(true, () => _<Li>("This element will be instantiated and rendered")),
(false, () => _<Li>("This element will NOT even be instantiated")
);
Will produce:
<ul>
<li>This element will be instantiated and rendered</li>
</ul>
This is specially useful if you're conditionally rendering an expensive component.
Full Changelog: v1.0.2...v1.0.3
Attrs is now a record!
- Switched to record at Attrs and AriaAttrs.
- Added RenderAsHtml output consistency.
- Improved test readability.
- Fixed README typo
Added support for aria-* attributes.
Merge pull request #1 from JeyDotC/add-wi-aria-support Added support for aria-* attributes.