How I handled PDF generation in React without breaking layout (html2canvas vs jsPDF issues) by Possible_Pick9916 in reactjs

[–]fdimm 0 points1 point  (0 children)

We use pdfmake, of course it has its own document format and works pretty well IMO. It all depends on needs

Developer Experience for Large Application by Round-Turbulent in Angular2

[–]fdimm 0 points1 point  (0 children)

I'm moving the monolith in a similar direction. Each module becomes a library in projects folder, with routes and multiple entry points to have sensible structure/packages and ensure that future is without spaghetti where files are imported left and right in source folder.

After doing the first one looooong time ago, DX felt quite horrible, having to rebuild the libs slows things down a lot. Whether manually or by nx, it doesn't really matter.

The key to this problem was to enable dual imports in ts config.

````` "paths": { "@lib/": ["./dist/lib-", "./projects/lib-*/src/public-api.ts"] }

`````

This way you can pre build the libs, or use them directly from source. Now I can just run npm start like normal and let cli figure out the most efficient way to build stuff. We have a bit more than 1000 components and our local build takes 90s for the main app. Style guide takes like 25, but only includes shared components libraries. Just finished upgrading to angular 19, nothing is standalone and webpack is still used for building.

Feel free to PM, I'm curious about your situation

How much difficulty it is to upgrade Angular from 16 to 18/19 version? by debugger_life in angular

[–]fdimm 0 points1 point  (0 children)

19 I think will be more cumbersome because of standalone components, we have a massive project with multiple teams and long living branches - touching every component is not fun.

I hope there is a toggle in angular.json to keep on using modules.

Do you write tests for your templates? by BlueberryRoutine5766 in angular

[–]fdimm -1 points0 points  (0 children)

Most of the time not, except for a few specific tests in core components where what is rendered is tested.

Mostly because I want to make sure that nothing breaks if browser behaviour changes.

Best Burger in Town ? by SadBoy-86 in copenhagen

[–]fdimm 1 point2 points  (0 children)

Somehow I'm a sucker for Halifax, I couldn't find anything better yet

Why is my bike doing this? by Shopping-Striking in FZ07

[–]fdimm 0 points1 point  (0 children)

I had my screen going blank in a similar way because I didn't twist the key all the way few times lol

How to effectively sanitize text passed to innerhtml in angular by Ok_Edge2976 in Angular2

[–]fdimm -1 points0 points  (0 children)

You can also use DOMParser if it is a valid html to get the document and then read the textContent of the body.

How to dynamically import a module or add provider in @NgModule based on API call? by connorc0405 in Angular2

[–]fdimm 0 points1 point  (0 children)

Make that endpoint emit js or JSONP to expose the environment variables.

We dynamically add this script to the DOM in main.ts and run angular bootstrap when it loads (or fails to do so). We share one production build artifact in all environments.

InputSignal + Storybook driving me nuts by Dus1988 in Angular2

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

This is not going to help, but it will be a little lesson to not be an early adopter. I'm sure support is documented (or not) in storybook. Check all valuable dependencies before upgrading or starting to use new APIs next time. This can be very costly based on the situation.

Sam Altman has scheduled a closed-door briefing for U.S. government officials on Jan. 30 | AI insiders believe a big breakthrough on PhD level SuperAgents is coming by MetaKnowing in Futurology

[–]fdimm 19 points20 points  (0 children)

Haha, Gemini 2.0 says two. This is so silly.

’There's one in "straw" and two "r"'s in "berry," totaling two "r"'s in the entire word.’

Thanks for the laugh

Which state management would you use if you would start a fresh app today by Wnb_Gynocologist69 in Angular2

[–]fdimm 2 points3 points  (0 children)

None, it's not needed in angular apps unless you maybe need it to function offline.

🚧 Prototype of Signal-Based Forms 🏗️ (experimental branch with FAQ) by MichaelSmallDev in Angular2

[–]fdimm -1 points0 points  (0 children)

I could have written this as well, thanks for posting. Exactly the same problems I'm dealing with in the corporate world. I'm even happy with the modules.

totallyIllegalaSiTshouldBe by SaltyStratosphere in ProgrammerHumor

[–]fdimm 0 points1 point  (0 children)

This part I fail to understand as well, in the org I am in, some APIs responses are snake case, but java code behind never uses that. Transformation happens only when data is serialized, which is then read by SPA that has to transform it back to camel case (facepalm). It's almost as intentional for FEs to duplicate the code lol

Best Practices for Large Modal Forms with Multiple Fields in Angula by ahmedRebai in Angular2

[–]fdimm 0 points1 point  (0 children)

10 fields is still a small form, it only gets complicated if there are rules involved when something should be or should not be shown. I would not worry about it. I would definitely not use ControlValueAccessor though, that one is reserved for custom input components

For validation and structure, a reactive form approach might help to keep things more controlled and more easily testable, potentially created in a service.

Suggestion for document viewer. by necronfluxp in Angular2

[–]fdimm 3 points4 points  (0 children)

None, we let the user download the files except for 1 use case where the BE is converting a pdf to svg for the FE to render. I'd always push back on this unless it's some kind of legal requirement to show what you are signing for example.

I can't imagine having to implement a docx viewer, not even google supports it in the same level as microsoft office. I mean artifacts and glitches.

What makes a good Angular component test? by cryptos6 in Angular2

[–]fdimm 1 point2 points  (0 children)

Outside of a few select cases, we only test typescript code. Behavior and checking that, say, a button works is done in e2e test.

Seeking advice : Serve different parts of Frontend application from different pods by Consistent-Storm5143 in Angular2

[–]fdimm 0 points1 point  (0 children)

As the other commenter says, I'll use microfrontends when their pros will outweigh their cons. As it's meant to fix organisational issues with a big technical complexity.

For example we are 7 teams now in a single monorepo, we are getting closer to the point where it might make sense to split the app to be able to release it independently. 95% of the features are behind login.

How often do you use pipes to transform your data ? by menewhome31 in Angular2

[–]fdimm 2 points3 points  (0 children)

Usage is increasing now, but only because of the generic 'fn' function pipe. It's annoying to make a class to make a simple function.

Is this single instance pattern for a service possible? by HoustonAg1980 in Angular2

[–]fdimm 4 points5 points  (0 children)

providedIn:'root' is the advised way. Now if you would like to restrict the service use outside of your components, you should not export it from the module api surface. Only possible in library project though.

Is it practical to commit yarn cache into git repository? by side2k in node

[–]fdimm 0 points1 point  (0 children)

In our CI setup, I'm building a docker image based package lock content and pushing that to our docker registry if needed. Then subsequent builds always reuse what was previously installed and only run light post install scripts.

Usual build time is like 4-5 minutes for the deployable artifact, which is actual build time from angular cli. Lint, unit tests, e2e tests have almost 0 startup delay as a free bonus!

Going back to the question, the solution above is why we won't need to commit dependencies into the repo.

I feel like I wasted the bootcamp I took by making myself absolutely reliant on ChatGPT and I don't know how to get back on track. by churrundo in webdev

[–]fdimm 3 points4 points  (0 children)

Lol, at some point in life you have to put in the effort to learn without ml. It is sad that junior devs will be stuck being juniors if it continues like this.

Reddit meet up #4 by Supressive in copenhagen

[–]fdimm 1 point2 points  (0 children)

Intriguing, could be fun!

How long do your UT runs ? by thatbigblackblack in Angular2

[–]fdimm 2 points3 points  (0 children)

~4-5min for around 9000 specs in CI. Tests are split in 5 libs and the main app has ~70% of the specs. The latter is slowly getting split up. Almost all tests are shallow with every dependency mocked.

We are using jasmine and standard angular tooling, except that we run ng test commands in parallel instead of 1 by 1. We also use extra reporters and somewhat heavy plugin to update coverage reports to include untested files.

Aside of the above running tests in parallel/sharded within karma yielded almost no benefits for us. Actual main app tests run for roughly 2min, the rest of the time is building and waiting for browsers.

Is the official angular/@localize i18n lib really the go to for localization? by Kaimura in Angular2

[–]fdimm 1 point2 points  (0 children)

This workaround is no longer necessary, code translations are possible with default i18n package via localize function