htmf
terser
htmf | terser | |
---|---|---|
4 | 28 | |
21 | 8,481 | |
- | 0.6% | |
7.6 | 8.8 | |
7 months ago | 9 days ago | |
JavaScript | JavaScript | |
MIT License | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
htmf
-
HTML First – Six principles for building simple, maintainable, web software
I've successfully used this pattern (HTMX hypermedia style) to create an offline-first web app SPA[^1]. One of the pages is pretty dynamic and I wasn't sure if I would need a traditional front end library to work with it. But, nope, hypermedia to the win, it worked fine without a front end framework.
To build it I used my own library called HTMF[^2]. I started out using mpa-enhancer[^3] but found that that pattern is a little to janky sometimes. I think reloading a page every time on every interaction uses too many resources for a browser especially when you use a phone that doesn't have as much power as a laptop.
But overall I find the pattern very easy to use and keeps the complexity down.
I think some of the issues with traditional SPAs is that they have a lot of state and state is nonlinear in complexity. But using templating systems makes the complexity more linear in nature.
Also, I find libraries like React to be overly complex for what it does, see above. The way React works is just odd and counter intuitive. All for problems that are easy to solve. I do think there are places for a React-like library is needed but those are for websites that are inherently highly state-based. But most websites aren't state-based even ones that appear to be state-based at first.
The websites I work on are usually just forms and forms are pretty powerful and can get you a long ways before you need to go outside of that paradigm.
[^1]: https://github.com/jon49/Soccer
[^2]: https://github.com/jon49/htmf
[^3]: https://github.com/jon49/mpa-enhancer
- Things you forgot because of React
- Htmx, WebAssembly, Rust, ServiceWorker Proof of Concept
-
Ask HN: Getting tired of complexity in web development
I wrote a js lib similar to HTMX, which I call HTMF[1]. Unlike HTMX I try to stay as close to the metal of the current semantics as possible. So, all interactions are based off of forms. I also tried to keep the wording similar to HTML/JS semantics. It's pretty small lib but pretty amazing how far I can get with it. These days I mainly build offline-first apps with it. But I built it in such a way that it can easily be a progressive enhancement to an MPA app.
[1]: https://github.com/jon49/htmf
terser
-
How I use Devbox in my Elm projects
These projects use Caddy as my local development server, Dart Sass for converting my Sass files to CSS, elm, elm-format, elm-optimize-level-2, elm-review, elm-test (only in Calculator), ShellCheck to find bugs in my shell scripts, and Terser to mangle and compress JavaScript code.
-
Obfuscating your create react app and routes
During my intial search i came across some outdated libraries like javascript-obfuscator and uglify-js(as if javascript code can get any uglier, am I right?). Then, I stumbled upon Terser, a modern library that supports ES6.
-
10 Bad Habits That Can Slow Down Your JavaScript Applications 🐌
Example: You've got a main.js file that's as long as a Tolstoy novel. Fix: Use tools like UglifyJS or Terser to minify your code. They'll squeeze out all the unnecessary bits and give you a sleeker, faster-loading file.
-
Things you forgot because of React
They can do it, it is just turned off by default and require more advanced configuration.
https://github.com/terser/terser#cli-mangling-property-names...
-
Understanding Source Maps: Simplifying Debugging
Minifying is a common practice for optimizing production code. (for example, using Terser to minify and mangle JavaScript).
-
How To Secure Your JavaScript Applications
Minification: UglifyJS, Terser
-
Minify private methods in a TypeScript class
Terser is JavaScript compressor that can minified specific method names.
-
React Native CI/CD build speed improved by 22% with one line of code
Every release build of React Native uses terser to reduce the size of your JavaScript. And it operation can be omitted for Staging/Beta builds.
-
Setting up a custom toolchain
A minifier makes your code more compact so that it loads faster. Popular minifiers: Terser, swc.
-
Overview of the next-gen frontend dev tools
There are many minifiers such as terser and uglify. But, because minifying also require to parse the JS, it is actually possible to use esbuild and SWC to minify the code. Here's a benchmark of the main minifiers.
What are some alternatives?
Soccer - Tracker for players play time
esbuild - An extremely fast bundler for the web
yew-beyond-hello-world - yew rust tutorial
vite - Next generation frontend tooling. It's fast!
submillisecond - A lunatic web framework
UglifyJS2 - JavaScript parser / mangler / compressor / beautifier toolkit
WeightTracker - Back end for saving data for weight tracker.
closure-compiler - A JavaScript checker and optimizer.
MealPlanner - A Meal Planner to figure out what we are going to eat each week. Written with Razor Pages and HTMF. https://meals.jnyman.com/
Sass - Sass makes CSS fun!
mpa-enhancer - Minimalist JavaScript to make your MPA work that much better
PostCSS - Transforming styles with JS plugins