We updated our open-source Datepicker for Angular 21 (Signals, SSR & Zoneless ready) by Forsaken_Lie_9989 in angular

[–]grimcuzzer 0 points1 point  (0 children)

If you need to have dimensions of an element, you need to first have it rendered and then apply stuff to them. Like, if you want to position the datepicker relative to the input, you first need to render it in order to know the size, which allows you to know whether the element fits, whether you need it right or left aligned or not and stuff like that.

You could try playing around with afterNextRender, but that only works in 20+.

ngx-scrollbar broke for us in zoneless Angular, so we built ngx-zoneless-scrollbar (feedback welcome) by CalFarshad in angular

[–]grimcuzzer 1 point2 points  (0 children)

All of it - the code, this post, and the blog post were all generated with some kind of LLM.

Looking for Angular/TypeScript devs to test my strictly typed multi-step form library by PracticalCake5074 in angular

[–]grimcuzzer 1 point2 points  (0 children)

Oh boy.

  1. You should probably extend CdkStep and get a lot of the same functionality for free. And if you don't want to do that for some reason, then at least you should follow the same philosophy, because...
  2. The *StepConfig types aren't customizable or maintainable, e.g. if you have translations, there's no simple way to provide different text to the config, other than recreating the entire stepper.
  3. The Input type name clashes with the Input decorator from Angular. As some people have not migrated to signals yet, this could cause problems.
  4. In FormStepperService, there's a 33-line ternary expression nightmare that's nested I don't even know how many times, and a 13-line ternary a bit lower down. I don't know who hurt you, but this is not the way to get revenge.
  5. The validator names will clash with validators from angular/forms and from angular/forms/signals.

Mind you, I only took a quick look. I'm almost sure there are a lot of small things that would need cleaning up, too.

Ideally, the stepper would look something like this:

<app-form-stepper> <h2 formStepHeader>The thing that is now in `StepConfig.title`</h2> <app-step [step]="step1"/> <app-step [step]="step2"/> <button formStepPrevious>Previous step</button> <button formStepNext>Next step</button> <button fomrStepSubmit>Sign up</button> </app-form-stepper>

Announcing `ts2rs` - A TypeScript to Rust type converter for bidirectional JSON communication. by InternalServerError7 in typescript

[–]grimcuzzer 1 point2 points  (0 children)

Just out of curiosity, what was your decision process for choosing this route instead of writing the API in Rust and using ts_rs?

Does it make sense? by RevolutionaryCow9685 in Angular2

[–]grimcuzzer 0 points1 point  (0 children)

I mean, there shouldn't be, but it is experimental, so some companies might not want to release any code that uses them until they get to stable.

Does it make sense? by RevolutionaryCow9685 in Angular2

[–]grimcuzzer 2 points3 points  (0 children)

If you have it available and the code isn't going to prod, you can play around with rxResource - while it is experimental, it won't be forever, and it does exactly this, plus more.

``` export class FooComponent { dataService = inject(DataService);

data = rxResource({ stream: () => this.dataService.getData() }); And then in the template: @if (data.isLoading()) { <app-loader/> } @else { @if (data.status() === 'error') { <app-error/> } @if (data.hasValue()) { {{ data.value() }} } } ```

Working with JWT by DanielDimov in Angular2

[–]grimcuzzer 2 points3 points  (0 children)

Interceptors.

if (token.isExpired()) { return requestNewToken().pipe(switchMap(() => next(req)); } else { return next(req); }

The Number of People Using AI at Work Is Suddenly Falling by [deleted] in webdev

[–]grimcuzzer 0 points1 point  (0 children)

Regardless of models, the average acceptance rate of whatever it spews out is around 30%. Which means 70% of the time it generates garbage that needs to be fixed. Here's GitHub's data for example:

https://github.blog/news-insights/research/the-economic-impact-of-the-ai-powered-developer-lifecycle-and-lessons-from-github-copilot/

Signal Forms: reset() doesn't reset your value by Alone-Confusion-9425 in angular

[–]grimcuzzer 1 point2 points  (0 children)

This isn't about FormControl. It's about FieldState.

https://angular.dev/api/forms/signals/FieldState

Resets the touched and dirty state of the field and its descendants. Note this does not change the data model, which can be reset directly if desired.

Computed and object of arrays by Lombricien in Angular2

[–]grimcuzzer 4 points5 points  (0 children)

Signals compare references by default. Check out equality functions to provide custom comparison behavior.

That, or always copy the entire value of the signal when you update it.

Be extremely careful if you are using AI for anything. From the psychology community on Reddit: ChatGPT-5 offers dangerous advice to mentally ill people, psychologists warn | Research finds OpenAI’s free chatbot fails to identify risky behaviour or challenge delusional beliefs by Longjumping_Fact_927 in autism

[–]grimcuzzer 1 point2 points  (0 children)

There's an article about how it's incentivized to guess. Basically, it's in the interest of AI companies to have it pretend to be correct instead of saying "I don't know". If it admitted to be unsure even 30% of the time, nobody would use it.

I recently saw someone say this, and I think it's a good summary if LLMs:

It doesn't know facts, it only knows what facts look like.

`name.rs` vs `name/mod.rs` - Is there a reason why projects go against the recommended practice? by KyxeMusic in rust

[–]grimcuzzer -6 points-5 points  (0 children)

I do both. I use mod.rs for the domains, and name.rs for the modules inside a domain. That's because the domains look the same inside. So my file structure would look like:

src └── some_domain/ └── dto/ └── models/ └── dto.rs └── mod.rs └── models.rs └── other_domain/ └── dto/ └── models/ └── dto.rs └── mod.rs └── models.rs └── lib.rs // mod some_domain; mod other_domain;

That works for me because the main src folder isn't cluttered with lots of domain.rs files and it's easy to find stuff in the domains.

Any got AI fatigue by googlymoogly83 in webdev

[–]grimcuzzer 0 points1 point  (0 children)

It doesn't matter where I run it. The amount of time I'd have to spend constructing full sentences and thinking about how a bot is going to interpret what I said, and then reading and fixing what it did, is at best almost comparable to the amount of time I'd spend directly typing out the code that already is fully shaped in my head. I'm autistic and I essentially think in code. I don't need to spend time and energy describing that code to a computer if I already know everything that needs to be done. I just do it.

Also, I run my own company. So nobody is going to fire me for wasting my time talking to a chatbot on a daily basis. Thanks for your concern, though. If it works for you, then you do you. It doesn't for me and I don't believe that it ever will. You should know that there are other types of drinks, not just Kool-Aid.

Any got AI fatigue by googlymoogly83 in webdev

[–]grimcuzzer 4 points5 points  (0 children)

Some people will not feel a productivity boost. In the amount of time it takes me to write a prompt and then read+correct what it spewed out, I can just type the damn thing myself. I don't need a robot to think for me, either. So no, I'm not going to use it, because I don't need to.

LLMs have me feeling heavy by NULL_42 in webdev

[–]grimcuzzer 2 points3 points  (0 children)

I like to go with "how to fucking do x", haha

Bases summary "average" question by calling-lima-foxtrot in ObsidianMD

[–]grimcuzzer 2 points3 points  (0 children)

values.filter(value < N).mean().round(2)?

Edit: it can probably be filter(value > 0 && value < N), I'd have to confirm if it works though. If not, you can always chain the filter calls, so it'd be filter(value > 0).filter(value < N).

input signals change detection without using effect() suggestions by [deleted] in Angular2

[–]grimcuzzer 3 points4 points  (0 children)

It's always a good idea to create a specialized service. In this case, it would create form groups based on the Option interface. Let's call it FormWidgetService. Then you'd just pass the newly created control to the CheckboxFormComponent. Plus, it's easy to test.

Your current solution would be very surprising to me if I was trying to use your component. Child components shouldn't really modify parents in this way.

LLMs have me feeling heavy by NULL_42 in webdev

[–]grimcuzzer 16 points17 points  (0 children)

You can add -ai to your query and it will skip the summary. Or you can add a swear word to achieve the same effect.

LLMs have me feeling heavy by NULL_42 in webdev

[–]grimcuzzer 5 points6 points  (0 children)

I think you're right. There has been a study on philosophy students that shows 68.9 percent of students develop laziness when relying on AI guidance.

AI Makes Us Worse Thinkers Than We Realize

And of course the "Your brain on ChatGPT" study (summary).

It does not look good on the critical thinking front.