Skip to content

Releases: JeyDotC/JustCs

v1.2.0

02 Nov 19:48
3fe2088
Compare
Choose a tag to compare

What's Changed

  • Moved to .Net 6.
  • Added attributes decorators feature.
  • Added ASP.Net goodies.
    • Initializers to help setup the library on ASP.
    • AntiForgeryToken component.
  • Activated Nullable language feature project-wide.

v1.1.0

25 Mar 22:43
f0e084a
Compare
Choose a tag to compare

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!

10 Feb 15:18
e5f56a4
Compare
Choose a tag to compare

What's Changed

Added attr extensibility and conditional rendering.

by @JeyDotC in #3

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.

  • Added unit tests for the strongly typed components checks by @JeyDotC in #5

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

Attrs is now a record!

10 Feb 15:16
Compare
Choose a tag to compare

#3

  • Switched to record at Attrs and AriaAttrs.
  • Added RenderAsHtml output consistency.
  • Improved test readability.
  • Fixed README typo

Added support for aria-* attributes.

25 Jan 17:05
aef71d2
Compare
Choose a tag to compare
Merge pull request #1 from JeyDotC/add-wi-aria-support

Added support for aria-* attributes.