|
go play outside Skyler posted:if you put HandleChange in a callback context, "this" will refer to the callback context with version 2. With version 1, "this" will be implicitly captured and refer to whatever it was when the function was defined. Thanks, I just about get this. MrMoo posted:usually the same people believe https://standardjs.com/ is actually real. This looks kind of good? What's the issue?
|
# ? Nov 16, 2022 14:38 |
|
|
# ? Jun 5, 2024 08:35 |
|
fuf posted:Thanks, I just about get this. No semicolons alone is enough to throw that out. “Just memorize all the stupid automatic semicolon insertion rules~” no I’ll just tell it what I intend by using semicolons.
|
# ? Nov 16, 2022 15:47 |
|
necrotic posted:No semicolons alone is enough to throw that out. “Just memorize all the stupid automatic semicolon insertion rules~” no I’ll just tell it what I intend by using semicolons.
|
# ? Nov 16, 2022 15:48 |
|
Semicolons should be required I don't understand this whole "write it like a caveman and it'll still work" attitude. Make the syntax strict! I'm so tired of opening popular repositories on github and realizing I don't want to use it.
|
# ? Nov 22, 2022 22:20 |
|
Nolgthorn posted:Semicolons should be required I don't understand this whole "write it like a caveman and it'll still work" attitude. Make the syntax strict! I'm so tired of opening popular repositories on github and realizing I don't want to use it. are you saying you won't use a library if the author doesn't use semicolons? what the gently caress? weren't you the guy that was complaining about typescript absolutists a page ago?
|
# ? Nov 22, 2022 23:20 |
|
Typescript does have a benefit in that it'll format the code when you compile it.
|
# ? Nov 22, 2022 23:36 |
|
teen phone cutie posted:are you saying you won't use a library if the author doesn't use semicolons? i don't know if you're trying to accuse Nolgthorn of hypocrisy or something but if I saw a library, looked through the github, and saw that it was written in semicolon-less javascript, I'd nope the gently caress out pretty much independent of any other merit the library has.
|
# ? Nov 23, 2022 09:07 |
|
Bruegels Fuckbooks posted:i don't know if you're trying to accuse Nolgthorn of hypocrisy or something but if I saw a library, looked through the github, and saw that it was written in semicolon-less javascript, I'd nope the gently caress out pretty much independent of any other merit the library has. Wow, that's stupid.
|
# ? Nov 23, 2022 11:05 |
|
I think you start to become more wary of what's in your node_modules directory with age, as it causes increasingly large headaches over the course of your career. So I end up assuming people who don't care just aren't very experienced yet. Which is fine there's nothing wrong with that but I'm not going to argue about it. When I see poorly written code in a repository I second guess how badly I need it. Those libraries are going to be the first to stop being supported by their repository owner. Maybe they decide to rewrite it, which if the repository is popular means they'll branch off to a different library entirely. Which will involve either a migration task in the future or I'll have to babysit what node version it supports. I'll have to see warnings from npm saying there's security vulnerabilities in my dependencies. All of this says nothing about how many dependencies the dependencies have, each of which has the same problem. And code that's written poorly tends to be written by people who don't care about what's in their node_modules directory. So, it is all part of the same pile.
|
# ? Nov 23, 2022 11:13 |
|
Wasn’t there a big todo over a library that wasn’t using semicolons in their doc examples and it caused a lot of angst?
|
# ? Nov 23, 2022 14:02 |
|
Recently collaborated with a developer that used no semicolons. It was fine. Code readability is exactly the same.
|
# ? Nov 23, 2022 14:06 |
I don't care if they use semicolons or not, as long as they are using some sort of linter. Standard may not be what I like but if a library is using it the fact that they are obeying a strict guide-style is a big plus.
|
|
# ? Nov 23, 2022 14:16 |
|
This is a great example of why the language should just require semicolons (or require no unnecessary semicolons I suppose). If consistency is enforced then nobody needs to argue opinions about it.
|
# ? Nov 23, 2022 15:08 |
|
fsif posted:Recently collaborated with a developer that used no semicolons. It was fine. Code readability is exactly the same. semicolonless javascript is fine except when it's not. the problem is there are edge cases and they suck - like https://stackoverflow.com/questions/2846283/what-are-the-rules-for-javascripts-automatic-semicolon-insertion-asi. i don't want to have to learn these rules when people can just put the loving semicolons where they ought to go.
|
# ? Nov 23, 2022 15:14 |
|
fsif posted:Code readability is exactly the same. It’s not when you see a line with a semicolon at the start, it’s like “you typoed here bud.”
|
# ? Nov 23, 2022 16:18 |
|
Bruegels Fuckbooks posted:semicolonless javascript is fine except when it's not. the problem is there are edge cases and they suck - like https://stackoverflow.com/questions/2846283/what-are-the-rules-for-javascripts-automatic-semicolon-insertion-asi. i don't want to have to learn these rules when people can just put the loving semicolons where they ought to go. This never came up and we have a linter that formats on save anyway. MrMoo posted:It’s not when you see a line with a semicolon at the start, it’s like “you typoed here bud.” I don't know what this sentence means.
|
# ? Nov 23, 2022 16:27 |
|
fsif posted:I don't know what this sentence means. code:
|
# ? Nov 23, 2022 17:24 |
|
Hey everyone, I'm not sure the best way to word this question but hoping someone can decipher what i'm asking lmao. I have a system of timestamps in C#: code:
I am trying to make a way of capturing times in a React app using javascript, which captures time from the audio player like this: code:
code:
Thanks...hope this kinda made sense
|
# ? Dec 4, 2022 02:16 |
|
worms butthole guy posted:
code:
|
# ? Dec 4, 2022 06:04 |
|
That did it, I was overthinking it. Thank you!
|
# ? Dec 4, 2022 22:12 |
|
I'm in node_modules heck So, as with every company I've ever worked for I was given a bug ticket. It says that puppeteer which opens our html assets server side is taking screenshots and the images in the screenshot are blurry. I track it down to our version of Chrome running on the server needing to be updated. Well this means the version of puppeteer needs to be updated since every version of puppeteer is only suitable for one version of chrome. However when I update the version of puppeteer and I update the version of Chrome now I get the following error. Because why would it work? What possible scenario could I ever expect the updating of a module to ever work? The whole point of node_modules is to break the second you have to touch anything in there. code:
Thankfully I found the rogue dev who posts their findings, usually this happens on mailing list archives. There were more than one, I tried all of them but one got me closer than the others. They say that the new version of puppeteer doesn't throw this error as long as it's below a certain version. So I downgrade puppeteer and go through the effort of figuring out what version of Chrome that version supports, and find a copy of that too. Now, I get a little bit further, now it's a totally different error. code:
I have spent an entire day on this now. It's pretty unbelievable. I just want the dang version of Chrome to update.
|
# ? Dec 6, 2022 22:18 |
|
i have no idea what the error could possibly be, but if there's truly some broken code in the module itself, patch package is always a good tool to rely on. https://github.com/ds300/patch-package#readme basically you can make a diff to node_module code and it'll apply your new change on the postinstall hook
|
# ? Dec 6, 2022 22:25 |
|
Sounds interesting, thanks
|
# ? Dec 6, 2022 22:39 |
|
Whats the VS Code Typescript shortcut for jumping out of brackets/parenthesis like Tab does in C#? I don’t know what the setting is called to change the keybind
|
# ? Dec 7, 2022 03:14 |
|
ThePopeOfFun posted:Whats the VS Code Typescript shortcut for jumping out of brackets/parenthesis like Tab does in C#? I don’t know what the setting is called to change the keybind I don't know if there is a keybind for that but I use Tab Out and have never had a problem with it.
|
# ? Dec 7, 2022 17:37 |
|
Nolgthorn posted:ERR_PACKAGE_PATH_NOT_EXPORTED The solution to this was to update node to a compatible version inside of the docker instance. Now instead npm is telling me dotenv is not installed, it certainly absolutely is. I've deleted node_modules and .lock again, re-installed, force installed, cleared cache, audit fix on and on and on. Npm is impossibly bad.
|
# ? Dec 7, 2022 21:02 |
|
Ever feel like "is this honestly what they pay me for?"
|
# ? Dec 7, 2022 21:11 |
|
well deleting your .lock is usually a bad idea because it's going to update almost all your packages and just cause more problems. e; maybe if you post a github repo with the issue happening we could help better?
|
# ? Dec 7, 2022 21:26 |
|
I'm at a company that enforces strict versions in the package json file, like most companies are these days. You can't rely on third party developers to use semvar properly, which is why the lock file was introduced. But then when you look up just about any npm related issue half the suggestions are to delete the lock file. So, it's worthless. I can't imagine depending on it. It's not the cause of this issue anyway.
|
# ? Dec 7, 2022 21:28 |
|
Works on my machine
|
# ? Dec 7, 2022 22:04 |
|
bigperm posted:I don't know if there is a keybind for that but I use Tab Out and have never had a problem with it. Excellent, thank you.
|
# ? Dec 7, 2022 22:53 |
|
Nolgthorn posted:The solution to this was to update node to a compatible version inside of the docker instance. Now instead npm is telling me dotenv is not installed, it certainly absolutely is. I've deleted node_modules and .lock again, re-installed, force installed, cleared cache, audit fix on and on and on. Er , if docker is in the picture and you “update node … in a docker instance”…. Might that be your issue? I mean, docker? Have you tried rebuilding the container?
|
# ? Dec 8, 2022 00:29 |
|
Yes. The problem was that I need separately to run `npm install` inside each docker container that wants to use this specific library, after navigating to the directory where it is used, because of the way that library is being triggered, which is inside of a postinstall hook or something like that. I've forgotten the details because when it comes to problems like this I hate them so much I erase the solution from my brain. That way if they ever come up again I can re-experience solving the problem from scratch. Separately updating node broke many libraries in node_modules and so on. And then every so often I'll be browsing the web and someone shows up and is like "I don't know why anyone would care what's in their node_modules directory that seems silly to me." So anyway, all I wanted to do a few days ago was update chrome.
|
# ? Dec 8, 2022 16:10 |
|
Quick question: what's the easiest way to call a function when a div scrolls into view? End users want a giant single-scrolling app, "like the Word document we use that this app is based off of", so I implemented a single accordion style menu that they can click on and it'll scroll them to the appropriate section of the page using this code: code:
Sab669 fucked around with this message at 18:30 on Dec 15, 2022 |
# ? Dec 15, 2022 18:27 |
|
Check the position of the screen after scrolling and compare it to element positions, something like this.
|
# ? Dec 15, 2022 19:10 |
|
Obfuscation posted:Check the position of the screen after scrolling and compare it to element positions, something like this. Thanks!
|
# ? Dec 15, 2022 20:28 |
|
Using an Intersection Observer is the preferred approach these days https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#a_simple_example
|
# ? Dec 15, 2022 21:41 |
|
I have some Christmas blues reflecting on my current (non Javascript) dev job. Are there any Javascript / React learning resources that people would particularly recommend? Something that will make me feel less like an impostor and possibly set me up for applying for some jobs? There's a million different "courses" out there so any kind of "this helped me" endorsement would be appreciated.
|
# ? Dec 20, 2022 11:39 |
|
fuf posted:I have some Christmas blues reflecting on my current (non Javascript) dev job.
|
# ? Dec 20, 2022 17:34 |
|
|
# ? Jun 5, 2024 08:35 |
|
Armauk posted:What are you using at your current job? Uhhh an incredibly obscure platform / language that's only used by Universities called SITS ("Strategic Information Technology Systems"). It's a weird niche I fell into by accident that means a secure job but development that is straight out of the 90s. I have a fair bit of web dev experience though so I'm definitely not starting from scratch with JS or anything. I'm firmly in 'intermediate' territory, just with a strong sense that I'm missing fundamentals and need to update my skills.
|
# ? Dec 20, 2022 17:48 |