LogRocket Blog
blog.logrocket.com · Company blog · on HN since 2017
Engineering blog from LogRocket, a frontend monitoring company, with tutorials on JavaScript, Rust, Node.js, and TypeScript.
What HN saysHN commenters link it as an introduction to topics like TypeScript enums, async Rust, and Rust GUI libraries; one notes the company's tracking product.
242HN people shared it
72linked it in comments
371stories submitted
3.1Kstory points
7 months agolast shared
2017people per year2026
Most-shared posts
- 1Why you should avoid ORMs (with examples in Node.js)6 people · 11 points · first shared 2018 · discussion on HN
- 2Using Chrome's new code coverage feature5 people · 11 points · first shared 2017 · discussion on HN
- 3The history and legacy of jQuery4 people · 131 points · first shared 2019 · 107 comments on HN
- 4Unsafe Rust: How and when (not) to use it4 people · 10 points · first shared 2021 · discussion on HN
- 5Interesting 2017 JavaScript language feature proposals that weren't adopted4 people · 7 points · first shared 2018 · discussion on HN
- 6What’s Deno, and how is it different from Node.js?4 people · 5 points · first shared 2019 · discussion on HN
- 7The Fetch API is finally coming to Node.js4 people · 2 points · first shared 2022 · discussion on HN
- 8Taming the Front-End Monolith3 people · 23 points · first shared 2019 · 2 comments on HN
- 9The state of Rust GUI libraries3 people · 13 points · first shared 2024 · 5 comments on HN
- 10Front end in 2017: The important parts3 people · 6 points · first shared 2017 · discussion on HN
- 11Why TypeScript Enums Suck3 people · 3 points · first shared 2020 · discussion on HN
- 12Things you can’t do in Rust (and what to do instead)2 people · 308 points · first shared 2021 · 279 comments on HN
- 13A guide to threads in Node.js2 people · 165 points · first shared 2019 · 55 comments on HN
- 14How to deploy a React app for free2 people · 157 points · first shared 2020 · 66 comments on HN
- 15Preact : a smaller, faster React alternative2 people · 76 points · first shared 2017 · 48 comments on HN
What HN people wrote when they linked it
tonyarkles · 2024-03-14
I’ve played a bit with CLI Rust but haven’t yet tried diving into GUI Rust. The language feels like it aught to be great for making really robust and performant GUIs but when I look at lists like this: https://blog.logrocket.com/state-rust-gui-libraries/ I generally feel disappointed… it’s GTK4, FLTK, or embed a web browser? Am I missing something? Is there a great Rust GUI library that is both lightweight and looks good?
kkirsche · 2023-07-29
https://blog.logrocket.com/why-typescript-enums-suck/ may be a good introduction. I love enums in other languages but they can come with some unexpected behaviors in typescript
sdfhbdf · 2021-04-13
Just like you did in the browsers back in the day when you imported code from URLs with <script src="">, the "deno way" is supposed to follow browsers in these regards as well.
And you can always use `npm`, `node_modules` and `import maps`[0][1][2] to kind of mimic "nodejs way".
[0]: https://wicg.github.io/import-maps/
[1]: https://blog.logrocket.com/es-modules-in-browsers-with-import-maps/
[2]: https://deno.land/manual/linking_to_external_code/import_maps
pjmlp · 2020-10-31
Yes,
https://blog.logrocket.com/a-practical-guide-to-async-in-rust/
> Some libraries require you to use a specific runtime because they rely on runtime internals to provide a solid API for you to use or wrap their own API around an existing runtime. One example is the actix_web web framework, which wraps its own API around tokio.
So if you want to use two libraries that follow this approach, now you have faced with the hurdle to combine two async/await runtimes into the application.
Even C++ knows better in this regard.
pgl · 2018-08-16
I added logrocket.com to the list after reading about how Roku uses it to track information about user networks, etc:
* https://www.reddit.com/r/YouShouldKnow/comments/97an7p/ysk_roku_hardwa…
They also describe their service:
> LogRocket lets you replay what users do on your site
ie, they track everything you do when you visit a site using their service.
I've updated the entry to just block this instead:
logs.logrocket.com
If you update your filter lists, you should be able to get to https://blog.logrocket.com/.
arbesfeld · 2017-04-21
If you're interested in front-end development, there are a few companies which focus on that:
- Apollo/Meteor: https://dev-blog.apollodata.com/
- Auth0: https://auth0.com/blog/tech/
- Chroma: https://blog.hichroma.com/
- LogRocket (my company): https://blog.logrocket.com/
DougBTX · 2024-02-25
The broader idea of “pass a value between functions without naming it in the caller” crops up in a few other places outside FP.
In Rust there is the “builder pattern”[0] where the builder isn’t mentioned directly:
ByValueBuilder::new() .with_favorite_number(42) .with_favorite_programming_language("Rust") .build() In OO land they are called “fluent interfaces”[1], commonly used when building SQL queries while only mentioning the final query at the end:
query = translations .Where(t => t.Key.Contains("a")) .OrderBy(t => t.Value.Length) .Select(t => t.Value.ToUpper()); Especially in the query builder example, since it is essentially building up an AST, the type of the top-level object can change in each call, but since it isn’t named it also doesn’t need to be typed, so there’s no issue with variable shadowing etc.
[0] https://blog.logrocket.com/build-rust-api-builder-pattern/ [1] https://en.m.wikipedia.org/wiki/Fluent_interface
bryanrasmussen · 2022-05-04
I'm not talking about fizzbuzz or algorithm problems, I'm talking about programming assignments, the first one I ever had was something like the following:
Please use the HN API to build a tree view of HN comments that allow you to see what the top posts are on a day where you can drill down to see comments on the posts and the top commenters, use client side vanilla JavaScript code to get data, allow persistence of data to local storage so that if the computer goes offline you will be able to still read content. Separation of concerns, nice code structure, and a nice presentation will impress us.
Suggested time: 4 hours.
Others, here is a partially completed project set up, some mock data, a link to a technical specification of a data format you are probably unfamiliar with that you need to also use a graphQL endpoint to query and build a table view of Apartment listings with pictures of the apartment, the location, the zip code, the phone number of country, rental price. Users should be able to login and see the latest apartment listings, it should be possible to sort by latest updated listing and by rental price. Sorting should persist between pages. Tech stack to use React, Sass, Webpack, a nodejs static server.
time: 4 hours.
This one was interesting because it is the only one I have ever had where I managed it in EXACTLY 4 hours (except for ones that were more like use what language you like to do this algorithm)
I even made a cool SVG log in component based on…
andrew_ · 2022-01-05
lukeed has several extremely popular npm packages/libs which share a lot in common:
- their twitter following is used to boost newly released packages
- they were released as alternatives to existing packages/libs with the flashy promise of being smaller, less complicated, faster
- negative feedback is rebuffed as "an attack"
- they're all very green
- they lack features and stability of the more mature packages they aim to supplant
- once released and popular, they cease getting frequent updates
Now, yes this is a generalization. It doesn't apply to all of their packages, and not at the same point in time. But there is a pattern there. Some quick diving into the author's Github account, and their more popular repos shows the pattern. It's also clear that this was a choice made by a Svelte contributor to use their own package for "official" support in Svelte Kit.
When it comes to polka itself, I just don't get why a maturing framework like Svelte would choose something whose only real advantage lies in micro-benchmarking porn [1]. Speculation aside, I'm surprised the Svelte team didn't look at that choice through a lens of higher scrutiny. Koa would have been an infinitely better choice in my personal opinion, and there are several community-driven setups [2][3] for it.
[1] https://github.com/lukeed/polka#benchmarks
[2] https://github.com/kaladivo/svelte-kit-koa-boilerplate
[3] https://blog.logrocket.com/sapper-svelte-tutorial-2021/
leoloso · 2020-09-27
You mean a filter to transform the query from A (say, with syntactic sugar syntax) to B (with final syntax)?
I'm actually doing something similar in GraphQL by PoP, on a couple of levels: queries are decoupled into requested and executable, where they can differ in syntax, directives attached to them, and others. I wrote a bit about this strategy here:
https://blog.logrocket.com/adding-directives-schema-code-first-graphql…
In addition, GraphQL by PoP does not understand the GraphQL syntax. It understands another syntax, that I've called PQL:
https://graphql-by-pop.com/docs/extended/pql.html.
PQL is a superset of the GraphQL query, so GraphQL by PoP transforms from GraphQL to PQL syntax and then executes it. For instance, this GraphQL query:
```
query {
posts {
excerpt
titleES: title @translate(from:"en",to:"en")
}
}
```
is converted to this:
```
posts.excerpt|title@titleES<translate(from:en,to:es)>
```
Check it out here:
https://newapi.getpop.org/api/graphql/?query=posts.excerpt|title@title…
This works great. Only issue is when there's some error when retrieving the data, and I need to return an error message with the path to the problem in the query. In that case, the path corresponds to the transformed PQL query, not the original GraphQL query. (It would be possible to have a mapping for them, token by token, but I haven't coded it)
---
Btw, connected to PQL, GraphQL by PoP can support the embeddable…
qohen · 2020-06-02
For docker images in general: the best way is to do multi-stage builds [0][1]. You will need to (re)write your Docker files to use this.
A quick-and-dirty way that doesn't require rewriting is just to use the experimental --squash flag[1] (i.e. add: --experimental --squash) when running docker (you can also turn on --experimental permanently by putting
{ "experimental": true } into docker's /etc/docker/daemon.json file. And, on a Mac, you can open the Docker app and there's a checkbox to turn on experimental features and then you can just use --squash in the terminal).
Anecdotally, I had a 4.67GB docker file that --squash reduced to a little over 1GB. However, a rewrite of the docker file to do a multi-stage build took that 4.67GB file down to just under 0.5GB.
P.S. Pro-tip: if you want to speed up your docker builds, if you're using 18.06 or higher, you can use use buildkit [2]. Again, anecdotally, on a 6-core Macbook from 2019 I think I got a 30% speedup or so -- your mileage may vary (a colleague with an 8-core machine I think got a 50% speedup -- it's been a while, so these percentages may be a bit off, but you get the idea).
It was also an experimental feature early on, so you needed to have experimental features turned on (as described above with --squash). With later versions you don't need to do that -- check your version's documentation.
Anyway, you can either set an environment variable to use it i.e. export DOCKER_BUILDKIT=1 or you can set this permanently…
xpe · 2026-01-14
You might start with https://github.com/zed-industries/awesome-gpui and https://blog.logrocket.com/state-rust-gui-libraries/
999900000999 · 2025-12-25
The Puppeteer team moved to from Google, to Microsoft and started Playwright.
https://blog.logrocket.com/playwright-vs-puppeteer/
davidsainez · 2025-12-01
I find the existence of opennext convincing proof of lock-in: https://blog.logrocket.com/opennext-next-js-portability/
Personally, I don’t bother with nextjs at all.
truth_seeker · 2025-08-27
Magic-RegExp aims to create a compiled away, type-safe, readable RegEx alternative that makes the process a lot easier. https://blog.logrocket.com/understanding-magic-regexp-regexp...
example from blog:
import { createRegExp, exactly, wordChar, oneOrMore, anyOf, } from "magic-regexp";
const regExp = createRegExp(
exactly("http") .and(exactly("s").optionally()) .and("://") .optionally() .and(exactly("www.").optionally()) .and(oneOrMore(wordChar)) .and(exactly(".")) .and(anyOf("com", "org", "io")), ["g", "m", "i"] );
console.log(regExp);
/(https?:\/\/)?(www\.)?\w+\.(com|org|io)/gmi
reactordev · 2024-05-27
You can use go’s builtin build features and embed the results into a http.FS.
go generate npm build go build And declaring the resulting frontend build as an embed.FS using
//go:embed dist/ var frontend *embed.FS And use that in a http.FS
https://blog.logrocket.com/using-go-generate-reduce-boilerplate-code/
satvikpendem · 2024-05-17
Also the same one who is making a new web server framework for Rust called Pavex, which is apparently pretty novel in how it works compared to others like Actix Web and Axum [0][1].
[0] https://www.lpalmieri.com/posts/a-taste-of-pavex-rust-web-framework/
[1] https://blog.logrocket.com/using-pavex-rust-web-development/
easyThrowaway · 2024-03-01
This looks exactly like svelte named slots syntax: https://blog.logrocket.com/comprehensive-guide-svelte-components-slots…
AntonCTO · 2024-02-09
If I understand it correctly, it exchanges execution speed (by not using JIT) for faster starts. Instead, they could pick up the old FB project https://prepack.io/ to optimize both start AND execution speed. It would be very interesting to see it together with node's snapshots: https://blog.logrocket.com/snapshot-flags-node-js-v18-8/, which reduces the start significantly.
01HNNWZ0MV43FF · 2024-02-09
Incidentally the latter is sometimes called railway error handling https://blog.logrocket.com/what-is-railway-oriented-programming/
solardev · 2024-02-07
FYI SVG charts have been around for a while and there are many libraries that use them: https://blog.logrocket.com/comparing-most-popular-javascript-charting-…
Depending on your use cases and complexity though, sometimes it's better to render to canvas instead (usually for performance reasons). JS and WASM are way more optimized than SVG is, so sometimes it's better to do the heavy calcs and then render raw pixels, instead of relying on SVG geometries.
arbol · 2023-09-24
Esbuild works fine and is also much faster than TSC.
Also TS enums are flawed: https://blog.logrocket.com/why-typescript-enums-suck/
andsoitis · 2023-08-19
> It clearly states: it targets web assembly. So, this should answer your question I think
Not sure what you're implying.
Here's an example of doing graphics using Rust and WASM - http://cliffle.com/blog/bare-metal-wasm/#making-some-pixels
And another: https://blog.logrocket.com/implement-webassembly-webgl-viewer-using-ru…
Given that MoonBit is developing their own IDE and it is hosted on the web, I would think one could provide an elegant pipeline to do graphics programming, no?
If this were open source, I would contribute in this realm becase I'm a graphics and UI person and also enjoy working with new programming languages.
9935c101ab17a66 · 2023-08-14
> Schema validation provides assurance that data is strictly similar to a set of patterns, structures, and data types you have provided. It helps identify quality issues earlier in your codebase and prevents errors that arise from incomplete or incorrect data types.
From: https://blog.logrocket.com/schema-validation-typescript-zod/
Most common use case I’ve seen is using schema validation for user input (like forms) so you don’t send junk off to the api, you can validate data at runtime (whereas typescript checks your types statically when compiled).
CharlesW · 2023-08-09
Yes, it's not good. This helped me: https://blog.logrocket.com/writing-interactive-component-stories-histo…
> With the release of Vue 3, a Storybook alternative named Histoire has gained some traction. In this blog post, we’ll explore how to create interactive documentation of UI components for Vue 3 projects. As with Storybook, Histoire is designed for making your life much easier to create living style-guides and component showcases.
mughinn · 2023-08-07
i assume they're talking about an Arena Allocator
https://blog.logrocket.com/guide-using-arenas-rust/
ttfkam · 2023-06-24
Using Svelte and D3 together for data visualization leads to more declarative code and componentized code that developers have become accustomed to but without sacrificing performance.
https://blog.logrocket.com/data-visualization-svelte-d3/
perardi · 2023-06-17
I usually roll my eyes when people claim that CSS is just too hard to learn, or that these new features are just too complex. I am generally of the opinion that once you are a day-to-day practitioner, CSS does broadly make sense once you build a mental model of how the system works.
And then they throw in this dynamic viewport unit stuff, and I realize…oh, I am guilty of hubris. I have angered the CSS gods, and they have struck me down for my arrogance—because this is complicated stuff.
https://blog.logrocket.com/improving-mobile-design-latest-css-viewport…
sbt567 · 2023-05-14
There is a recent article about this on r/rust https://blog.logrocket.com/build-desktop-app-qt-rust/
arcticbull · 2023-05-04
I used to feel similarly until I spent a bunch of time with nom [1].
There's not really any difference between tokens and grammar rules, in my experience. They're just terminal and non-terminal symbols yeah? Doing these things in one places doesn't get in the way of writing a nice LL recursive-descent parser.
I'm sure it will depend on what you're doing but for me at least splitting into lex and parse has a much higher bar now. I've done it both ways many times and at least for my applications adding a separate lexer has historically been the wrong abstraction in retrospect.
[1] https://blog.logrocket.com/parsing-in-rust-with-nom/