|
go play outside Skyler posted:Better to make it an npm package with 5 dependencies And make sure each one of those has at least 5 dependencies.
|
# ? May 26, 2020 20:59 |
|
|
# ? Jun 1, 2024 06:38 |
|
Lumpy posted:And make sure each one of those has at least 5 dependencies. https://npm.anvaka.com/#/view/2d/react-native
|
# ? May 26, 2020 21:19 |
|
Managing dependencies well is so tricky. Sometimes though I wonder if npm isn't just saying the quiet part out loud. Computers are built on a house of cards.
|
# ? May 26, 2020 23:09 |
|
It's time to start over. At some point we shifted every piece of software running it's own operating system with purpose built drivers, to one massive ball of poo poo. It doesn't matter that my phone is a super-billion times faster than what was used to land on the moon, if every time I launch Snapchat it shits itself.
|
# ? May 27, 2020 00:52 |
|
Nolgthorn posted:It's time to start over. At some point we shifted every piece of software running it's own operating system with purpose built drivers, to one massive ball of poo poo. It doesn't matter that my phone is a super-billion times faster than what was used to land on the moon, if every time I launch Snapchat it shits itself. This is because Snapchat intentionally tries to do a number of hosed up things, device fingerprinting and invasive garbage on boot.
|
# ? May 27, 2020 07:13 |
|
Snapchat is a bad example because the software itself is so poor. I was just using it for humour. But it is the case that an incredible number of cycles are spent doing tings that any given piece of software doesn't need, just because it's baked into the operating system. The Linux kernel has ballooned to almost 30 million lines of code and it keeps growing. I'm just suggesting that any given piece of software only really needs a tiny fraction of that. I watched a guy talk about it for an hour. https://www.youtube.com/watch?v=kZRE7HIO3vk
|
# ? May 27, 2020 12:17 |
|
Oh, the guy who made a 45 minute video ranting about how Visual Studio is too bloated because it does more than debug C? He's kind of a crank, IMO
|
# ? May 27, 2020 14:03 |
|
Compared to most developers I've met? well... I mean I prefer visual studio code myself.
|
# ? May 27, 2020 19:37 |
|
Yeah that guy is definitely a crank.
|
# ? May 27, 2020 20:35 |
|
if casey wants to code on a win95 machine and msvc++ 5.1 i mean im more than happy to let him do that he will soon realize that its actually not fast, and the drat thing runs at 800x600 resolution max with 16-bit color
|
# ? May 28, 2020 01:04 |
|
I scratch my "close to the metal" itch by tinkering with shaders in my free time. For dev dependencies, who cares? For prod dependencies, modern tree shaking does a pretty good job of cutting unused code. For everything else, I keep an eye on import costs and every time I think to myself "I bet there's a library for this" I spend 15 minutes checking our existing dependencies and code and trying to work it out from scratch to gauge the complexity. I'm far more concerned about internal code duplication and the fact that my team's code base currently has cruft such as: three distinct React modal components plus the one from our internal library package (yes really).
|
# ? May 28, 2020 09:26 |
|
I have tried making an offline PWA with a service worker that caches all the files needed for the app. I also added a manifest and an icon and I'm able to install the app on my phone's home screen and run it from there. However, if I turn on the phone's airplane mode and try to reload the page it will say "no internet" "chrome will let you know when this page is ready" Am I doing something wrong or does reloading just always bypass the service worker and the cache? edit: okay, I'm definitely doing something wrong since airhorner.com works fine even in airplane mode and reloading the page Wheany fucked around with this message at 16:15 on Jun 1, 2020 |
# ? Jun 1, 2020 16:12 |
|
Okay, I followed the "Offline fallback" recipe from https://serviceworke.rs/offline-fallback_service-worker_doc.html That example tries to fetch first, then catch errors and respond with a cached version. Instead I got it working by reading the cache first and then trying to fetch data over the network if not found. Which sounds reasonable in hindsight.
|
# ? Jun 1, 2020 16:47 |
|
Wheany posted:Which sounds reasonable in hindsight. Another option that can be good is read the offline version first, then request the live version, and update if a live one comes back - that way you get the fast response of a cache, but remain server-updatable (possibly at the cost of a glitchy-looking blink if an update happens.) And if you want to get fancy, you can send a version number or a hash of the offline one with your request, and have the server just reply with a "you're up to date" signal instead of a new value if there's no update, to save bandwidth - e.g. http status code 204.
|
# ? Jun 2, 2020 03:28 |
|
So I'm doing some pre boot camp coursework, and I'm trying to make a change calculating function for one of the assignments. I put this line in to make sure my variables were working ok: double result = amntGiven - amntRecieved; System.out.println(result); amntGiven is 18, amntRecieved is 17.18, and I go to compile and the thing shits out an answer of 0.8200000000000003. This doesn't seem normal, and I was thinking my decimal lengths in previous assignments were kind of long as well. I'm sure I'm missing something painfully obvious.
|
# ? Jun 2, 2020 08:34 |
|
Guildenstern Mother posted:So I'm doing some pre boot camp coursework, and I'm trying to make a change calculating function for one of the assignments. I put this line in to make sure my variables were working ok: You've been introduced to the wonderful world of floating point numbers. This should be a good primer: https://www.youtube.com/watch?v=PZRI1IfStY0 Also, Java isn't Javascript, but you run into the same things there.
|
# ? Jun 2, 2020 08:51 |
|
I listened to a guy talk about number formats for like an hour. He said floating point numbers used to make a lot of sense but computers are better now, the conclusion was that we don't need all these number formats we just need one. He proposes that the answer is UNUM, or universal numbers. Which gives you precise numbers. He also talked for a while about how adding two int32s together the result isn't an int32. Because the sum could be larger than the space provided by an int32. Multiplication the problem was even worse and so on. Basically he ranted about how numbers in computers suck and that future programming languages should adapt.
|
# ? Jun 2, 2020 09:57 |
|
Guildenstern Mother posted:So I'm doing some pre boot camp coursework, and I'm trying to make a change calculating function for one of the assignments. I put this line in to make sure my variables were working ok: You may be looking for the Java questions thread, this is the JavaScript questions thread. Anyway, as a general rule in handling currency it's best to avoid using fractions, because of exactly this problem. See if you're able to do this using integer amounts of cents (or pennies or whatever), so you have 1800 minus 1718 is exactly 82. Only add the decimal point when printing to the screen.
|
# ? Jun 2, 2020 13:01 |
|
roomforthetuna posted:Depends if you want to be able to update the data - you've got a permanent cache in what you describe, the server is never asked again once the client has any data. I think what I want to accomplish in the end is to have a fallback cache and a fresh cache and try to fetch the data into the fresh cache. If the fetch succeeds, the fresh cache becomes the new fallback and the old fallback is deleted. This has all been for https://github.com/everestpipkin/image-scrubber where I think the idea is that it stays as offline and simple as possible. Either using service workers for "app like" behavior or easily zippable html js and css that you can unzip and use on your computer without ever sending anything over the network.
|
# ? Jun 2, 2020 15:15 |
|
Thanks for the explanations and sorry for wrong thread posting
|
# ? Jun 2, 2020 15:22 |
|
Guildenstern Mother posted:Thanks for the explanations and sorry for wrong thread posting If it's any consolation, javascript was named javascript in the 90s because there was this new cool programming language called java. You were meant to be confused by the name
|
# ? Jun 2, 2020 20:18 |
|
Wheany posted:If it's any consolation, javascript was named javascript in the 90s because there was this new cool programming language called java. You were meant to be confused by the name
|
# ? Jun 2, 2020 20:32 |
|
Can we rename the thread to ECMAScript(6|2020|11|2021|...) questions?
|
# ? Jun 2, 2020 21:16 |
|
Biowarfare posted:Can we rename the thread to ECMAScript(6|2020|11|2021|...) questions? Not until the last computer capable of running IE6 is no longer functional.
|
# ? Jun 3, 2020 03:27 |
|
Lumpy posted:Not until the last computer capable of running IE6 is no longer functional. Ah, good, and when can you accomplish this? I will create the Kanban board.
|
# ? Jun 3, 2020 11:04 |
|
Where's the hacker that was supposed to exploit one of IE6's millions of security vulnerabilities in order to fry the motherboard of every computer running that piece of software? They are way way behind schedule.
|
# ? Jun 4, 2020 02:57 |
|
Nolgthorn posted:Where's the hacker that was supposed to exploit one of IE6's millions of security vulnerabilities in order to fry the motherboard of every computer running that piece of software? They are way way behind schedule. Its already happened but the simulation self-corrected because without IE6 there would not be enough suffering for the human brain to accept this reality.
|
# ? Jun 17, 2020 06:39 |
Trying to detect GSM-7 extension characters in a string using regexp. https://en.wikipedia.org/wiki/GSM_03.38#GSM_7-bit_default_alphabet_and_extension_table_of_3GPP_TS_23.038_.2F_GSM_03.38 Regex gods, what am I missing here?: code:
Polio Vax Scene fucked around with this message at 14:06 on Jun 18, 2020 |
|
# ? Jun 17, 2020 22:48 |
|
I don't think JavaScript has console.writeLine but that's not the problem... Your regular expression is looking for the nine-character fixed string "€|^{}[~]\\". You want something like: JavaScript code:
|
# ? Jun 18, 2020 00:56 |
|
This isn't a question, but I just did a blog entry on rendering markdown in React using react-markdown and I don't see another javascript or react thread on the forums. So I'm linking it here: https://jacobwicks.github.io/2020/06/19/rendering-markdown-and-resizing-images-with-react-markdown.html
|
# ? Jun 19, 2020 23:07 |
|
Biowarfare posted:Can we rename the thread to ECMAScript(6|2020|11|2021|...) questions? Lol
|
# ? Jun 19, 2020 23:07 |
|
Biowarfare posted:Can we rename the thread to ECMAScript(6|2020|11|2021|...) questions?
|
# ? Jun 21, 2020 03:12 |
|
I'm currently lost when it comes to "build" systems/tools. My current setup is based around my own bash script. The source javascript file has a hardcoded constant BUILD_TYPE, and then some logic to sets the .css file to either a local one or online depending on the BUILT_TYPE constant. I have a bash script which sets/replaces the BUILD_TYPE variable. The bash script then runs google-closure-compiler, obscurify, uglfy, updates a html page with the output, uploads the output to s3, and runs git commit. I want to add in babel but I'm not even sure what order that should go in. Also now I'm using Jest for testing but to get that to work I need to comment out the target browsers in .babelrc. I'm pretty sure I should be using a proper tool rather than my own bash script. So is there something where I can set build variables in an external file/config, that can run google-closure-compiler, babel, with their own config files depending on if I'm compiling for browser or testing. I'm using vscode.
|
# ? Jun 21, 2020 12:00 |
Look into webpack.
|
|
# ? Jun 21, 2020 12:22 |
|
Seconding webpack. The tutorial/getting started on the official website is pretty good too. Once you get the project structure mostly there, you can start adding plugins to the mix
Wheany fucked around with this message at 14:01 on Jun 21, 2020 |
# ? Jun 21, 2020 13:58 |
|
I'm having a real poo poo of a time getting into the kind of frontend development i'm being asked to do, which is things like customise Bigcommerce through JS injected scripts. It feels like an infinite nightmare of reading minified JS from thirdparties and trying to reverseengineer it and change behaviour. Is this actually a usual thing (hey this compiled JS does X, change it to do Y by intercepting mutators and hunting events and charting out its flow) or am i starting with the hard stuff? it's really dispiriting since i feel like i'm spending days staring at the debugger and occasionally get a win but often it's just 'nope i can't figure out how to do this short of breaking into react's hidden state fields' and i've wasted a lot of time.
|
# ? Jun 23, 2020 06:08 |
|
xiw posted:I'm having a real poo poo of a time getting into the kind of frontend development i'm being asked to do, which is things like customise Bigcommerce through JS injected scripts. It feels like an infinite nightmare of reading minified JS from thirdparties and trying to reverseengineer it and change behaviour. Is this actually a usual thing (hey this compiled JS does X, change it to do Y by intercepting mutators and hunting events and charting out its flow) or am i starting with the hard stuff? This sounds like it ought to be banned by the Geneva convention jfc
|
# ? Jun 23, 2020 06:21 |
|
There are tools that can help you refactor scripts iirc but it's mostly around renaming obfuscated variables and functions semantically and it's basically all manual beyond making sure you're renaming something correctly in the right places. And I can't tell you where Ive seen it because it's probably just phpstorm stuff that I'm imagining had a web app
|
# ? Jun 23, 2020 06:23 |
|
xiw posted:I'm having a real poo poo of a time getting into the kind of frontend development i'm being asked to do, which is things like customise Bigcommerce through JS injected scripts. It feels like an infinite nightmare of reading minified JS from thirdparties and trying to reverseengineer it and change behaviour. Is this actually a usual thing (hey this compiled JS does X, change it to do Y by intercepting mutators and hunting events and charting out its flow) or am i starting with the hard stuff? Use the API. That's why they have an API. Also, BigCommerce would also probably be unhappy if they knew a client was monkeying with their scripts, given both any legal TOS implications and that they don't want people relying on internal undocumented behavior.
|
# ? Jun 23, 2020 06:35 |
|
|
# ? Jun 1, 2024 06:38 |
|
xiw posted:I'm having a real poo poo of a time getting into the kind of frontend development i'm being asked to do, which is things like customise Bigcommerce through JS injected scripts. It feels like an infinite nightmare of reading minified JS from thirdparties and trying to reverseengineer it and change behaviour. Is this actually a usual thing (hey this compiled JS does X, change it to do Y by intercepting mutators and hunting events and charting out its flow) or am i starting with the hard stuff? This sounds absolutely awful. Make it your goal of 2020 to stop doing it, either by changing their minds or changing your job.
|
# ? Jun 23, 2020 09:26 |