JavaScript

Topic: Anything JavaScript, ECMAScript including Node, React, ...
Sep 27, 2023 13:08
And i would redirect to login on no token... but there IS a token, we just don't have it at first render because we're not on client. And I could implement some way of waiting for the first true client render... and then rendering child components that use graphql and etc, but it feels hacky. I feel like i've got some fundamental misunderstanding of the new nextjs paradigms
Sep 27, 2023 13:08
Before I go craft a whole question, does anyone have any pointers on auth in next.js using the new "app router" paradigm? Our tricky thing we're encountering is that we can grab a token after login, which normally we'd store in localStorage, but with the new next.js paradigm, even clients marked with "use client" are rendered first server-side and then hydrated, so they don't have localStorage. So we have like, graphql clients and stuff that are trying to fire off without a token
Feb 17, 2023 04:37
Does anyone have any recommendations on something similar to airtable in terms of ease of use as CMS that I can hopefully hot swap out, that supports static image hosting? Or like.. maybe some workaround for airtable? I'm looking into hooks maybe to upload an attachment to S3 and then grab the attachment URL but that's really stretching what airtable automations can do i think
Feb 17, 2023 04:36
Yooo so I got a client that was using airtable image attachments to serve static image URLs, that's been deprecated. I set him up some simple static image hosting on S3 but he thinks the friction is too high lol, he liked how he could just drop images in airtable and they'd magically show up in the app I've got using airtable as a backend. I asked around in the airtable forums about if there's like, a paid way to continue using airtable as a static image host, but to no avail
Feb 3, 2021 07:07
Ah, mystery solved by a friend on IRC, it's styled components syntax: medium.com/styled-components/…
Feb 3, 2021 07:05
with a template string just sitting there after styled.div. I'm not really sure what that means. It can't just be evaluating as a string that then evaluates to a property name off styled surely? Then that would mean styled as a property on it called div\nposition: relative; which seems impossible
Feb 3, 2021 07:04
... i don't know how to newline lol. but it looks like: `const Header = styled.div`
  position: relative;`
Feb 3, 2021 07:03
Sorry, thought ctrl+enter would newline, not send. Editing above message
Feb 3, 2021 07:03
I'm looking at some javascript / possibly typescript syntax I've never seen before in this new project. I'm not even sure how to google it, it looks like:
May 30, 2019 23:35
I wanna find a word/phrase that when you see it, you think "ah, .."
May 30, 2019 23:35
Right, good point. I'm trying to figure out a word/phrase that is self-inclusive as well as exclusively refers to "..". So words/phrases like "relative parent folder" or "navigate to parent directory" don't actually mean ".." on their own - they're descriptions of what ".." does
May 30, 2019 23:32
If you had to use a word to refer to the concept of ".." in the directory navigation sense of the idea, what word would you use?
Apr 29, 2019 22:41
Cheers all
Apr 29, 2019 22:41
yay web dev
Apr 29, 2019 22:41
Lol fuck it we just took the working build from my coworker's machine and threw the static files on mine
Apr 29, 2019 22:04
I was on on the github version github.com/firstandthird/load-grunt-config
Apr 29, 2019 22:04
Why didn't I become a devops engineer
Apr 29, 2019 22:04
what black hole of ancient code have i waded into
Apr 29, 2019 22:04
Terrifyingly, raw searches for that package.name string turn up literally nothing relevant
Apr 29, 2019 22:03
Cheers though
Apr 29, 2019 22:03
Yup that was what I was on T_T
Apr 29, 2019 22:00
Apr 29, 2019 21:59
yea one sec lemme strip out HIGHLY_VALUABLE_INFORMATION (notwithstanding we'll never extract value from this project lmao)
Apr 29, 2019 21:59
Hmm... good shout, lemme try popping in some parts of those variables into package.json
Apr 29, 2019 21:58
actually, package.name appears to be: "Auto expose package.json (<%= package.name %>)." from the docs. Nothing about the other ones
Apr 29, 2019 21:58
or how to find out what's getting popped in to like package.name
Apr 29, 2019 21:58
I mean it does look like a templating syntax I just have no idea which one
Apr 29, 2019 21:57
That gives me hope :D
Apr 29, 2019 21:57
The linked plugin does use that same syntax but I can't find any info on it, like finding out how "ui" gets populated and etc
Apr 29, 2019 21:56
Yo, someone tossed me a horribly old repo with a grunt.js file that has syntax like this in it, that I've never seen before: '<%= ui %>/css/<%= package.name %>.css': '<%= ui %>/scss/<%= package.name %>.scss', <--- that goes where normally i'd put a path for a scss input and css output. I thin kit has something to do with github.com/firstandthird/load-grunt-config but I'm not sure - anybody ever seen that syntax before?
Feb 6, 2019 17:20
@KendallFrey unfortunately that errors >.<
Feb 6, 2019 01:22
Man, only thing that's worked is just initializing the array. That's obnoxious. {thing: [1,1,1]} worked. Ugh.
Feb 6, 2019 01:20
Yo, I don't understand how to do typescript when I'm working with values of objects... all I want is an array that will contain Numbers, so I try {thing: number[] = []}, that doesn't work, nor does {thing: number[]}, {thing: Array<number> = []}, {thing: Array<number>} or any other wonky configuration I can come up with. I can't find anything on "how to use typescript when working with object values" either...
Oct 19, 2018 02:52
Damn I wish I was better at math. This makes sense though, thank you
Oct 19, 2018 02:51
What's the triangle rule?
Oct 19, 2018 02:50
Guys, for the life of me I'm tripping over this, what would be the O(n) for an algorithm that operates like this: first run n, second n-1, third n-2... so like n + n-1 + n-2 + n-3...
 
Sep 24, 2018 19:29
but otherwise, it doesn't run
Sep 24, 2018 19:29
if i paste it in the console manually, it runs
Sep 24, 2018 19:29
`eval("\n\nconsole.log('DRAGONHELLO');//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9wdWJsaWMvanMvcmVzZXRfcGFzc3dvcmQuanM/ZjY5ZSJdLCJuYW1lcyI6WyJjb25zb2xlIiwibG9nIl0sIm1hcHBpbmdzIjoiOztBQUNBQSxRQUFRQyxHQUFSLENBQVksYUFBWiIsImZpbGUiOiIuL3B1YmxpYy9qcy9yZXNldF9wYXNzd29yZC5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIlxuY29uc29sZS5sb2coJ0RSQUdPTkhFTExPJylcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./public/js/reset_password.js\n");
Sep 24, 2018 19:29
No idea what it doesn't work. I see this line inside the reset_password.js file
Sep 24, 2018 19:28
Wait, manually pulling them might not have worked, I was looking at tthe wrong consoole log. By the way, if you're ever in San francisco, beer's on me
Sep 24, 2018 19:22
I didn't realize the order of the imports matter. You're right, manually pulling the files in they work. I wonder if it's cause I stuck them at the top. Going to mess with the order now, would love to just get it working out of the box
Sep 22, 2018 22:11
Interesting. Ok I will check this. Will have to let you know Monday, I'm in Las Vegas lol!
Sep 21, 2018 17:23
Cheers, taking off now, thanks so much again
Sep 21, 2018 17:20
It's a huge app so there could also be some random other thing blocking. I'll investigate while I'm offline as well. You're being very generous with your time and energy, and I appreciate that
Sep 21, 2018 17:19
Ok cheers.
Sep 21, 2018 17:19
I'll need to test the built files , maybe serve them through pytbonsimpleserver or something
Sep 21, 2018 17:18
Work*. It's all through webpack dev server for now so on second thought, maybe that depends on some files in node_modules...
Sep 21, 2018 17:18
Hence why I was confused why including vendor.js made it worl