bartblast
Hologram v0.11 is out! Two headline features this release. First, Elixir regexes now run in the browser. They were server-only until now, and handing patterns to JavaScript’s RegExp doesn’t hold up, so v0.11 ships a PCRE2 parser, translator and interpreter of Hologram’s own, and what comes back is what the BEAM would have given you. Second, client errors now read like server errors, same messages and same stacktraces, so __STACKTRACE__ finally holds real Elixir frames. The release also brings dynamic component and element tags, attribute and prop spread, umbrella project support, and a fix for a DOM identity bug that could knock focus out of an input mid-typing.
Thanks to everyone who reported issues and opened feature requests along the way.
Thanks to our sponsors for making sustained development possible: Curiosum (Main Sponsor), Erlang Ecosystem Foundation (Milestone Sponsor), and our GitHub sponsors - Innovation Partner: @sheharyarn, Framework Visionaries: @absowoot, Oban, @robertu, Moss Piglet, and all other GitHub sponsors.
Full details in the blog post:
Trending in News & Updates
Other Trending Topics
Latest Hologram Threads
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #phoenix_html
- #iex
- #ai
- #graphql
- #genstage
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex










Showing Posts 1 to 2- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
lpil
Wow, that’s impressive! Are you compiling them into JavaScript regexes? How does the performance compare to regexes written in regular JavaScript?
bartblast
Thanks Louis!
Where it’s safe, yes. Hologram parses the pattern into an AST, then checks whether every construct in it maps onto JS RegExp with the same semantics. When it does, the AST gets translated and compiled with
new RegExp, so matching runs on the browser’s own engine. When it doesn’t, it falls back to a backtracking matcher of Hologram’s own. That’s \K, atomic groups, possessive quantifiers, conditionals, subroutines, backrefs to a group that might not have participated, and a few caseless Unicode corners where JS folds characters that PCRE2 doesn’t. Better to be slower there than to quietly match differently.Compiled patterns sit in a registry in the client runtime, keyed by ref. They can’t travel, so what actually crosses the boundary is the source plus the options, recompiled on the other side and registered under the same ref. Keeps an opaque
{:re_pattern, ...}term working after the trip.The other nice thing about riding the browser’s engine is that there are no Unicode tables to ship.
\p{Greek}resolves against the engine’s own data even on the interpreted path. Go the WASM way and you’re compiling a whole regex engine and hauling its tables along with it.Most app patterns end up native, so it’s a JS regex plus a one-off parse. The interpreted tail is slower for sure, and I haven’t measured it properly yet, but it’s not the kind of thing people usually write.