Top tips from Kevin this week.
Spend the last few hours deep diving into the @Alpine_JS source code to figure out the V3 codebase. And I must say it’s extremely readable, easy to follow, and approachable to all levels. Find the lifecycle’s start method and just go step by step.
— Kevin Batdorf (@kevinbatdorf) June 26, 2021
If you ever needed to fire a callback or cleanup function when removing any element from the DOM, @Alpine_JS makes this easy via a plugin. Just include the plugin, then use
x-destroy="callback()"on any element you plan to remove.
— Kevin Batdorf (@kevinbatdorf) June 27, 2021
This newsletter supported by my GitHub Sponsors.
Here are this week’s Alpine.js adopters:
Lightweight form validation with Alpine.js and Iodine.js by @elliotclydenz has been updated to support v3
For more posts like these, you can join the Alpine.js Development Subscription, it’s a great way to support the newsletter and get early access to Alpine.js content.
Features: - Allow passing runtime parameters to Alpine.data() objects - Expose the initTree method - Add warning for x-for key not being an integer or string
Fixes: - Only run watcher after specified dependency changes - Allow referencing $ref elements outside of x-init - Evaluate Alpine syntax inside x-html - Allow x-transition in x-bind to use functions
Alpine.js devtools 1.1.0 is out with initial v3 support (limited to viewing/editing components/data), by @hugo__df: - Chrome: chrome.google.com/webstore/detail/alpinejs-devtools/fopaemeedckajflibkpifppcankfmbhk - Firefox: addons.mozilla.org/firefox/addon/alpinejs-devtools/ - Release: [github.com/alpine-collect…](https://github.com/alpine-collective/alpinejs-devtools/releases/v1.1.0)
One file that controls styling, layout, logic and server communication.
Locality of behavior to the max 🙌
— Mike @ HTML All The Things🎙️ (@htmleverything) June 29, 2021
For the coders among us, @Alpine_JS, especially v3, is what I’ve been longing for in my webdev career without knowing it for at least the last 6.3 years. Think VueJS but even simpler without anything I don’t need. Thank you @calebporzio for making such a great tool. 🤘
— David Factorial (@davidfactorial) June 28, 2021