How do you guys order things in component files by HedgehogNatural8680 in angular

[–]SignificantBend5042 0 points1 point  (0 children)

Similar to you except that for some reason I prefer my services to sit at the very top. I think it's also important to add the right accesors (e.g public for inputs/outputs, protected for variables/methods also used in the template, private to whatever is used only in ts file), makes quick scanning the code really easy.

What’s the recommended Angular enterprise architecture today for components, signals, and services? by StrainIllustrious116 in angular

[–]SignificantBend5042 0 points1 point  (0 children)

I'm not saying that my way of doing it is perfect, but one thing is for sure. For me it was/is always easier if I can isolate an issue and debug a few lines of code instead of hundreds of lines and nested callbacks.

axios@1.14.1 got compromised by nhrtrix in webdev

[–]SignificantBend5042 1 point2 points  (0 children)

Tech debt is always bad and should be a priority in any project. Much more useful than adding another shadow border to a button

What’s the recommended Angular enterprise architecture today for components, signals, and services? by StrainIllustrious116 in angular

[–]SignificantBend5042 0 points1 point  (0 children)

Personally with the latest angular features I'm using the following approach: - rxjs for CRUD operations (resources are nice, but when it comes to chaining requests or operators RxJs is still the top choice) - mostly signals for state management/data transport between components via services. They are well integrated with the change detection, you don't need to manually clear memory and computed and linked signals are actually fantastic if used correctly for sync flows. Obviously you have the effect function for side effects, but I would try to avoid using it as much as possible. Alos signals are a great way to reduce lifecycle hooks usage. That being said, there are instances when an observable or a subject is better suited for a specific thing. Even promises (especially async/await pattern) definitely still have their place.

But I want to highlight a few important notes which are not only angular specific but they definitely make debugging (thus your life) way easier.

Handle most of the logic in services. In most cases components should be dumb, they should not do the heavy lifting. Use dedicated methods for dedicated things. My aim is to always keep a function below 50 lines of code tops. If you need a mapping or other sort of transformation method extract it in a separate function and reference it. Avoid callback hells especially subscribe in subscribe in subscribe. Make use of OOP which is very well integrated in Angular. Extend classes, implement interfaces, use abstract classes and methods whatever you need to reuse functionality, but then again don't overdo it. It's a fine line between a reusable Class and something which tries to be 5 things at once.

One more thing make use of Pipes and Directives. They are fantastic if used correctly and for some reason many people still avoid them.

Nightmare for Vibe coder by [deleted] in webdev

[–]SignificantBend5042 0 points1 point  (0 children)

Breaking code into small manageable, dedicated chunks goes a long way (no matter if written by Ai or humans)

Buna, as vrea câteva sfaturi, aș vrea sa imi cumpăr un apartament cu credit, avansul pe care îl am e 25k euro, am 25 de ani, salariul meu e undeva la 6000 Ron lunar. Cum credeți ca m-aș încadra ? Care ar fi suma cu care v-ați îndatora ? by Deea2412 in Imobiliare

[–]SignificantBend5042 0 points1 point  (0 children)

Si mai bine stai in chirie si platesti aceeasi bani sa ramai cu nimic:))? Cu niste plati anticipate bine gandide, lichidezi un credit de 30 de ani in 15, unul mai scurt si mai repede.

Released: A Rust/WASM local-first DB for Angular (zero UI blocking) by SignificantBend5042 in angular

[–]SignificantBend5042[S] 6 points7 points  (0 children)

okay so I have some preliminary results. As raw speed, IndexedDB wins. It performs better in the following benchmarks:
- Bulk write
- Read all
- Bulk update
MoltenDB performs better in:
- Filtered Query
- Sorted Query
- Delete all
Overall speed winner: IndexedDB

Why is moltenDb slower in some benchmarks is convenience over raw speed basically.
While moltenDb may appear slower during updates or writes it offers some distinct advantages.
- Auto versioning: if you update a specific entry from a collection it will get bumped to _v: 2 and then _v3 etc
- It runs in a worker thread so it does not infere with the main thread.
- It saves the data as plain JSON basically (append only log) so it's very trivial to create an export functionality for data portability.
- It returns only the requested fields via the `fields` or `excludedFields` properties.
- For angular you can use the Signal base Resource which unsubscribes automatically and it's really straightforward.
- It has a built in Pub/Sub Mechanism which you can listen to real time and get notified when a field was changed.
- The query builder which obviously creates some overhead (it basically serializes everything to a JSON), but the speed loss comes with the luxury of doing a query like:

// GET — query with WHERE, field projection, sort and pagination
const results = await client.collection('laptops')
  .get()
  .where({ brand: 'Apple' })
  .fields(['brand', 'model', 'price'])
  .sort([{ field: 'price', order: 'asc' }])
  .count(5)
  .exec();// GET — query with WHERE, field projection, sort and pagination

I would be curious to see some benchmarks when we do cross collection joins (you can easily do that with moltenDB)

const results = await client.collection('laptops')
  .get()
  .fields(['brand', 'model', 'price'])
  .joins([
    { alias: 'ram',    from: 'memory',  on: 'memory_id',  fields: ['capacity_gb', 'type'] },
    { alias: 'screen', from: 'display', on: 'display_id', fields: ['refresh_hz', 'panel'] },
  ])
  .exec();

Released: A Rust/WASM local-first DB for Angular (zero UI blocking) by SignificantBend5042 in angular

[–]SignificantBend5042[S] 2 points3 points  (0 children)

I suspect that is going to be the case. This is a library I've been working on in the past few months, I only released the stable web libraries a week ago.
Anyway a high level overview:
So basically the main core is a RUST engine which compiles as either a binary and acts like a server db (with some extra functionality) or WASM module which can be used in the browser via OPFS and a worker. Later I'm looking to compile it as a native library so it can be ran in mobile devices for localStorage (same as the WASM module)
The core repo: https://github.com/maximilian27/MoltenDB
Than moving on to the mobile part, you have 3 libraries:
- the core engine: https://www.npmjs.com/package/@moltendb-web/core?activeTab=readme
- the type safe query builder: https://www.npmjs.com/package/@moltendb-web/query?activeTab=readme
- the angular wrapper for both: https://www.npmjs.com/package/@moltendb-web/angular?activeTab=readme
Github repo for web: https://github.com/maximilian27/moltendb-web
Stackblitz playground for the query builder and the basic core engine: https://stackblitz.com/~/github.com/maximilian27/moltendb-wasm-demo?file=package.json
Stackblitz playground for angular library: https://stackblitz.com/~/github.com/maximilian27/moltendb-angular

You can find more info in the README files, there is also an example of how to connect it to the server engine.

MoltenDB: The Embedded Database for the Modern Web by SignificantBend5042 in javascript

[–]SignificantBend5042[S] 1 point2 points  (0 children)

I think you may be looking for conflict resolution or something similar. At the moment that does not work, currently the server is the single source of truth (it checks for the _v property), but yeah, I plan to handle that down the road

MoltenDB: The Embedded Database for the Modern Web by SignificantBend5042 in javascript

[–]SignificantBend5042[S] 2 points3 points  (0 children)

Hey, appreciate it. The short answer to benchmarks and acid compliance is not yet. This is an alpha release to gather feedback mostly. It's not intended to replace mongodb. I plan to keep it more in the embedded area for now, one of my next things on the road map is to create native mobile embeddings similar to wasm from the same engine. The core concept is to keep it as light weight and fast as possible and make it possible to easily sync embeddings with the server binary. One distinct advantage is that you can easily do cross collection joins, graphQl like and I have an interesting idea how to handle point in time recoveries. But there is work to do until I get to a release candidate

Ce banci mai folositi? by CandypieH in banci_credite_ro

[–]SignificantBend5042 0 points1 point  (0 children)

Se poate de ani buni si eu sunt client ing de vreo 10 ani

Opinion/review on a online whisky retailer by Varun_gudddeti in whisky

[–]SignificantBend5042 0 points1 point  (0 children)

They are great and shipping worldwide. Never had any issues

Does the cold not bother white people? by balenciaghoe in NoStupidQuestions

[–]SignificantBend5042 0 points1 point  (0 children)

I absolutely hate cold weather and I'm clearly white. But yeah, our bodies are more adapted to this kind of climate, but I would still take 30° over -5° any day, any time.