> not using TypeScript for any serious product Well, here is your problem.
Would Typescript have solved this though? They still would have been using npm etc
A JavaScript Nightmare
41–50 of 101 posts
Re: A JavaScript Nightmare
#42This is the second time I've ended up reading this post, and I confess I still don't exactly understand what was going on here. There's an issue with PDFs missing their contents, but also timeouts and a missing method exception? The problem seems to have come from upgrading some dependencies at some point, but the solution is also an upgrade, as far as I can tell? And then the cache issues at the end sound very much…
Stuff that gets pulled in when you do 'npm install' is scary for a more traditional server-side developer. Python for example comes with a lot of built-in libs maintained by the core python team. These could get you pretty far before you start pulling in libs from random authors.
Re: A JavaScript Nightmare
#43Earlier quoted context omitted.
The package wasn't following semantic versioning. Only major versions should introduce breaking changes.
The only change that isn't "breaking" is one that only adds functionality. Otherwise, it changes behavour, and has the potential to break your software. In practice, almost all changes should be major version bumps. Anyway that's besides the point. Let me control when version changes happen!
Ha! Think again. On of the more annoying problems I had to analyze was when a new PHP version added a function that already existed in my application (this was before namespaces). The runtime did not like that.
Re: A JavaScript Nightmare
#44This is the second time I've ended up reading this post, and I confess I still don't exactly understand what was going on here. There's an issue with PDFs missing their contents, but also timeouts and a missing method exception? The problem seems to have come from upgrading some dependencies at some point, but the solution is also an upgrade, as far as I can tell? And then the cache issues at the end sound very much…
> The next message I sent: “We found it!”
May be I misunderstand something, but from the post it sounds that they don't even commit their package-lock.json. They're using node like its 2012.
Re: A JavaScript Nightmare
#45I didn't quite understand why they had to debug on the spot, thus working like 36 hours uninterrupted or so. A sane working environment would file a priority 0 bug and address it during working hours. I'm not throwing a rock but oftentimes this sort of heroic behavior is self-inflected. Also why is heroic debugging required on something that is not production? The article mentions it was a "quick demo". Then who give…
it‘s called „motivation“
Sure, I would also do long programming sessions on my own things every now and then, but those happen because I am in the flow and it feels like more work to come back into it the other day. But those are my own projects. I don't owe this to my employer. If they want that they could offer me double my current salary and even then I would insist on only doing it when it makes sense to me.
Re: A JavaScript Nightmare
#46Earlier quoted context omitted.
> this.subset.encodeStream is not a function Yes?
TypeScript types work only on compile time. If library changes without changing its public TypeScript signatures it won't help at all. Also, after coming from real compiled languages I find TypeScript ecosystem not to be robust at all. Change in one file sometimes does not result in compile time error in another file where changed type is used. Yes, it's not an issue with TypeScript itself but with its ecosystem, tra…
> Change in one file sometimes does not result in compile time error in another file where changed type is used.
Sounds to me like you are missing types or the types you have are incomplete.
When you do things correctly, this is not an issue. Part of doing things correctly is preferring (and in some cases requiring) that your dependencies either be written in Typescript or at least ship the types directly in the NPM package, per best practice.
Re: A JavaScript Nightmare
#47Earlier quoted context omitted.
This was a runtime issue in a third party lib, so no.
If the library used TypeScript, it wouldn’t have the issue. The point still stands.
Re: A JavaScript Nightmare
#48> not using TypeScript for any serious product Well, here is your problem.
I'm not sure where that quote comes from, but these days in terms of TS vs JS it's 100% "not using untyped JavaScript for any serious product".
Re: A JavaScript Nightmare
#49Re: A JavaScript Nightmare
#50Earlier quoted context omitted.
> this.subset.encodeStream is not a function Yes?
This was a runtime issue in a third party lib, so no.