1kB-ish JavaScript framework for building hypertext applications
#00C8FF
.
Version 0.11.0 brings comprehensive updates: new documentation, non-destructive rendering, container-based root, hydration enhancements, thunks, app events, a revamped component lifecycle architecture, POJO (plain old JavaScript object) state, 100% test coverage restoration, and several bug fixes.
load
returns the same root node, indicating non-hydration use, setting oldNode
and element
to null.oldNode
as a valid virtual node and element
as a DOM node, leaving re-hydration to the patch function.update
event triggers only for truthy new states, allowing false
returns to cancel re-rendering.load
: Initializes and loads app resources.render
: Customizes the view function.action
: Logs or saves action data.resolve
: Modifies action behavior.update
: Inspects and validates state changes.oncreate
and onupdate
calls post-patch, maintaining correct order for nested elements.onupdate
now receives old data/attributes for prop change logic.onremove
is called when elements are replaced.oninsert
in favor of oncreate
.rollup.config.js
in favor of direct command line Uglify use.Thank you to everyone who contributed to this release: @Swizz, @lukejacksonn, @andyrj, @jamen, @zaceno, @fsodano, @tscholl2, @MatejMazur, @jcubic, @dodekeract, and @madebyherzblut. See you next time! 👋
This release brings numerous changes and enhancements to Hyperapp. A big shoutout to everyone who contributed to making this release possible. See you next time! 👋
init
event introduced for pre-first render actions.loaded
event now triggers once after the first render.<head>
. Use DOMContentLoaded
listener or defer
attribute in the script tag.<body>
.oninsert
introduced, firing post-oncreate
when elements are in the DOM.bundlesize
tracking for bundle size changes.app()
calls, courtesy of @zaceno.onupdate
handler was called even when undefined (#215).value
attribute is state-bound (#224). See a working example here.Router.go
to handle URLs with query strings effectively (#217).onremove
, you must now manually remove the element from the DOM. This update enables the creation of slide-out transitions/animations. Special thanks to @zaceno for this contribution.viewBox
in most browsers.data
is set before invoking onremove
, thanks @maraisr.onClick
→ onclick
, onCreate
→ oncreate
.(state, actions, data, emit)
(#190).h
function, optimizing its performance (#187).h
by @ngryman (#186).app({
events: {
loaded: (state, actions, emit) => {/* ... */},
action: (state, actions, data, emit) => {/* ... */},
update: (state, actions, data, emit) => {/* ... */},
render: (state, actions, data, emit) => {/* ... */},
route: (state, actions, data, emit) => {/* ... */}
}
})
document.body
for applications without a specified root (#140).emit(eventName, eventData)
function for creating custom events (#177, #178).Special thanks to @zaceno for the introduction of keys. Appreciation also goes to @pedroborges, @lukejacksonn, @selfup, @ngryman, @dodekeract, and @leeoniya for their contributions to this release.
jsnext:main
and module
for modern bundler compatibility.pkg.main → dist/hyperapp.js
for Node.js.render(view)
function and options.release
and prepublish
npm scripts for maintenance.Thank you to all who have supported Hyperapp's journey @rbiggs, @tzellman, @danigb, @selfup, @terkelg, and others. Your contributions are greatly appreciated! 👋
h
, enabling child components like <MyComponent props=...>children</MyComponent>
. See this example.hyperapp.js
on CDNs.Hyperapp now supports both Hyperx (tagged template literals) and JSX. Choose the appropriate distribution for your needs.
<script src="https://unpkg.com/[email protected]/dist/hyperapp.hx.js"></script> <!-- Hyperx -->
<script src="https://unpkg.com/[email protected]/dist/hyperapp.js"></script>