Noticing a huge slowdown in a query with a ton of related tables in Zero.
The query is
return z.query.scenarios
.where("teamId", team.id)
.related("team", (q_team) => q_team.one())| I'm trying to debug an issue with this project and I've never seen this syntax before `#views = new Map<string, ViewWrapper<any, any>>();`. What is the `#views` signifying in this typescript file? | |
| The `#` symbol in `#views` is JavaScript's private class fields syntax, introduced in JavaScript/ECMAScript 2022. It's not TypeScript-specific, but TypeScript supports it. | |
| When you prefix a class field or method with `#`, it makes that member strictly private and only accessible within the class itself. This is different from TypeScript's `private` modifier in a few important ways: | |
| 1. It's actually enforced at runtime (TypeScript's `private` is only enforced at compile time) | |
| 2. It's truly private - there's no way to access it from outside the class, even through reflection | |
| 3. The privacy is implemented through a special JavaScript runtime mechanism |
Reading through the Zero docs on authentication, I saw that JWT authentication was all that was supported (for now). I'm building a project using Ruby on Rails as an API and Next.js for the UI. While JWT auth is possible with Rails, most auth implementations are session based, included the built in auth solution to the latest Rails 8 release. Thus I wanted to figure out how to best set up Zero while still using the built in session based auth.
In this reply @aa, outlined how the Zero constructor can take a function for the auth param https://bsky.app/profile/aaronboodman.com/post/3ldyz5bet3s2s
This all sounds right. The
authparam to Zero's constructor can be a function. When the token expires, Zero invokes the function to get a new token. It's async so you can call an endpoint or whatever.
and later
To clarify further:
- keep the refresh token in an http-only cookie
Collecting thoughts and information about background jobs across many different programming languages. What are commonalities, differences, etc. The list definitely won't be exhaustive, it just needs enough information to make some decisions.
I wanted to figure out how I might be able to take advantage of Apollo Client caching while using RSC. I came up with this
approach, which is rather rudimentary, but seems like a good starting point. It is taking advantage of the new localStorage
API added in Node 22 https://nodejs.org/api/globals.html#localstorage
I built up a new query method which wraps the existing query and adds in ability to pass in an identifier (likely a user ID
or something of that matter) to ensure that caches don't overlap.
| You can exec into a container as root, rathern the defined USER | |
| `docker exec -it --user root <> <cmd> | |
| # Logging Related | |
| `docker container logs —tail 5 <id>` | |
| # Tagging and Pushing Images | |
| The most generic way to define an image tag is <registry URL>/<User or Org>/<name>:<tag>. | |
| When pushing, given no registry, Dockerhub is assumed. |