Closed brainkim closed 1 year ago
Hi Brian,
Good for you, sincerely; good for you. I've been coding javascript off and on since 1999 and the early days of DHTML. As far as I know this is the by far the easiest package to use for rendering and refreshing the DOM (React is a chore). Congratulations.
I've been using @bikeshaving/crank for a live site for 2 years, and at moment further extending the application.
I'm fear I'm still at npm @bikeshaving/crank --version
8.5.5 - I really should update.
You got this.
Ngā mihi nui, Darryl Cousins
@darrylcousins Thank you so much for these kinds words, Darryl! I’m going through a difficult time and this is just the motivation I need to believe in myself. If we should ever meet in person, perhaps if in my journeys I end up in Aotearoa somehow, please let me buy you a drink or whatever.
TODOS:
template
which parses template tags.
Breaking changes
RendererImpl
methodescape()
has been renamed totext()
.RendererImpl
methodparse()
has been renamed toraw()
, and the valueprop
is always passed into this method, regardless of whether the value is a string.Quality of life improvements
crank-key
, have an additional$
-prefixed variant. Going forward, this will be the preferred syntax, butcrank-key
andc-key
will continue to be supported as well.Generator components which are in a
for...of
orfor await...of
loop will now attempt to exit normally, so that cleanup code can be placed after the loop.Async generator components can now use for...of loops. Async generator components which yield from a for...of loop behave like sync generator components, pausing at each yield.
Context
type can now be passed a function type as its first parameter to strongly type thethis
props iterators.New Features
hydrate()
method which will attempt to re-use DOM nodes already found on the page. A correspondinghydrate()
method has been defined for custom renderers.Crank now provides a tagged template function called
jsx
which replicates JSX syntax and allows templates to be written with vanilla JavaScript.dispatchEvent()
on a component context will now trigger anyonevent
style props.Bug Fixes
src
and other props which are sensitive to being re-assigned will not be re-assigned.$static
elements which are re-rendered with different tags will now correctly re-render.