Releases: ConnorJamesLow/texsaur
Release v1.0.2 - Maintenance Patch
Fixes 1 high severity vulnerability.
Full Changelog: v1.0.1...v1.0.2
Release v1.0.1 - General Maintenance
This release removes comments from the distributed code so your download is slightly smaller. In addition, the typescript
package is no longer listed as a dependency - just a dev dependency as is appropriate.
Also, some other behind-the-scenes devDependencies
updates.
What's Changed
- June 2023 Maintenance by @ConnorJamesLow in #49
- Bump version to 1.0.1 by @ConnorJamesLow in #51
- Release v1.0.1 by @ConnorJamesLow in #50
Full Changelog: v1.0.0...v1.0.1
v1.0.0
This marks the version 1 release of texsaur.
Released Features
Here is an overview of what is available in version 1
Create Elements with JSX
Skip document.createElement
and instantiate new HTML elements using JSX:
import jsx from 'texsaur'
const div = <div>Hello there.</div>
JSX Fragments
Use <></>
to create document fragments (JSX.Fragment: Node[]
):
<>
<div>Foo bar baz</div>
<div>Fizz buzz</div>
</>
Value-based Elements (Components)
Per the Typescript specification, create Functional Components:
function Header({ title }: { title: string }) {
return <header>
<h1>{title}</h1>
</header>
}
document.body.appendChild(
<div>
<Header title="Hello there" />
{/* Same as */}
{Header({ title: 'Hello there.' })}
</div>
)
Custom Elements
Per the TypeScript JSX specification, provide types for custom elements by extending JSX.IntrinsicElements
:
namespace JSX {
interface IntrinsicElements {
['my-element']: HTMLElement // or another type representing your custom element
}
}
TypeScript JSX Modes
Supports "react"
and "react-jsx"
for the --jsx
tsconfig option.
What's Changed
- added webpack example by @ConnorJamesLow in #45
- Upgrade typescript version by @ConnorJamesLow in #46
- Update package for v1 release by @ConnorJamesLow in #47
- Release v1.0.0 by @ConnorJamesLow in #48
Full Changelog: v0.8.0...v1.0.0
v0.8.0 - Support iterable children
"Breaking" Changes
The previous behavior probably wasn't desirable, but still.
Prior to this release, passing an HTMLCollection
(e.g. element.children
) or a NodeList
(e.g. from document.querySelector('...')
) would append the entire object to the element, effectively converting it into a string. Now, any iterable that isn't a string
will be treated like an array.
v0.7.1 - Undefined bug fix
Bug Fixes
document.body.append(
<div class="container">
<div class="background-image-div"></div>
</div>
);
Would produce
<div class="container">
<div class="background-image-div">undefined</div>
</div>
This has been fixed now.
v0.7.0 - react-jsx Support
This release adds support for react-jsx
JSX code generation in Typescript.
Features
- Added
"texsaur/jsx-runtime"
module. "jsx": "react-jsx"
is now supported (must pair with"jsxImportSource": "texsaur"
and"moduleResolution": "node16"
). See this project's README for details.
Closed Issues
- #22 "How to use this with jsxImportSource?"
v0.6.4 - Minor patch
This release just changes an internal import path.
v0.6.3 - Cleanup package dist
To keep our package size as low as possible, this release removes some test files that snuck into the previous release
v0.6.2 - Optimizations
No new features here, just some minor improvements and bloat trimming.
Changes
- The
class
attribute is now treated like every other attribute (and works the same from the outside).style
is the only remaining special case. JSX.Component
doesn't need to acceptNode
forchildren
, since the value passed to it will always beNode[]
.- Various test/environment improvements.
v0.6.1 - SVGs
This release fixes issues with SVGs as a step closer to making them a stable feature.
Bug Fixes
- SVG attributes no longer cause errors.
- Fixed: In some cases, importing a bit of JSX wrapped in a
JSX.Fragment
would result in[object Object]
being printed as text instead of including the fragment's content.