Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
The Fool
Oct 16, 2003


Don’t store passwords yourself, use an identity service like auth0

Adbot
ADBOT LOVES YOU

Chenghiz
Feb 14, 2007

WHITE WHALE
HOLY GRAIL

Paul MaudDib posted:

what's considered gold-standard for a password hashing algorithm these days? salt per-user+argon2+pbkdf2?

I’d say so, that’s what OWASP recommends

Elephant Ambush
Nov 13, 2012

...We sholde spenden more time together. What sayest thou?
Nap Ghost
I realize this might not be the right thread for this question and I apologize in advance but I can't seem to find a relevant thread. If I wanted to create a small online store where should I ask?

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
this is probably the right place. I'm assuming the answers are use Shopify or Squarespace

kedo
Nov 27, 2007

Shopify if you want lots of store functionality and limited other site functionality, Sauarespace if you want lots of page building/layout functionality but limited store functionality.

Elephant Ambush
Nov 13, 2012

...We sholde spenden more time together. What sayest thou?
Nap Ghost
Thank you both for the replies. I'll look into those and I'll probably have more questions afterwards.

:tipshat:

worms butthole guy
Jan 29, 2021

by Fluffdaddy
has vue and or svelte taken over NextJS yet in usage in the workplace?

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!

Fixins posted:

has vue and or svelte taken over NextJS yet in usage in the workplace?

We use Vue (and Angular) where I work. That's anecdotal so maybe the State of JS 2020 is more indicative of the workplace as a whole.

Chenghiz
Feb 14, 2007

WHITE WHALE
HOLY GRAIL

Fixins posted:

has vue and or svelte taken over NextJS yet in usage in the workplace?

They aren’t direct competitors so no

LifeLynx
Feb 27, 2001

Dang so this is like looking over his shoulder in real-time
Grimey Drawer
I'm eyeing Svelte since it's much closer to writing vanilla HTML and JS. Svelte/SvelteKit doesn't have the amount of support that React/NextJS does though; maybe once SvelteKit has an official 1.0 release?

Violator
May 15, 2003


I'm trying out the new version of https://alpinejs.dev and it's going OK. Good for the little tiny bits of interaction I want to add here and there.

worms butthole guy
Jan 29, 2021

by Fluffdaddy
Do any of you use prismic? How do you access the data in a tabbed sheet of a custom post type

fsif
Jul 18, 2003

Fixins posted:

Do any of you use prismic? How do you access the data in a tabbed sheet of a custom post type

Can't actually help you with your question, but I'm curious about your experience with it overall. I've been trying fruitlessly to get us off Wordpress for our headless architecture but my boss is incredibly skeptical of any of these JAM stack centric CMS's.

worms butthole guy
Jan 29, 2021

by Fluffdaddy
It sucks compared to WordPress tbh. I've yet to find another crm that is nearly as "good" as WordPress. I wish WordPress had a lite /& JavaScript version though that strips out things like plugins etc. Prismics only plus is that it's very very easy to make custom types.

I'm open to other crm suggestions as well.

worms butthole guy
Jan 29, 2021

by Fluffdaddy
I've been messing with sveltekit and I kinda like it. Granted I haven't done anything super in depth with it but it's been real easy to use and is similar to express which is what I love to use.

Impotence
Nov 8, 2010
Lipstick Apathy

Fixins posted:

It sucks compared to WordPress tbh. I've yet to find another crm that is nearly as "good" as WordPress. I wish WordPress had a lite /& JavaScript version though that strips out things like plugins etc. Prismics only plus is that it's very very easy to make custom types.

I'm open to other crm suggestions as well.

Headless Wordpress exists in somefashion, if that works

LifeLynx
Feb 27, 2001

Dang so this is like looking over his shoulder in real-time
Grimey Drawer
NextJS + Headless WP has been working for me. It's a learning curve trying to parse data from the REST API vs. relying on a plugin to do that with its own PHP, but you get complete control over the front end and don't need to worry about jQuery. I'm not sure I'm doing things The Right Way, so I'm not quite ready to put it into regular use yet... what are some must-have diagnostic tools to make sure I haven't caused giant memory leaks or whatnot?

worms butthole guy
Jan 29, 2021

by Fluffdaddy
Yeah I use headless WordPress with nextjs via wp graph ql. The only thing I don't like is that the block editor let's clients think it's going to 1:1 look like the editor but that's a me and client issue than a WordPress one.

the heat goes wrong
Dec 31, 2005
I´m watching you...

Fixins posted:

The only thing I don't like is that the block editor let's clients think it's going to 1:1 look like the editor but that's a me and client issue than a WordPress one.

You can edit how things look inside the editor so that front and back-end editor view look the same. Will probably end up doing that sometime soon.

worms butthole guy
Jan 29, 2021

by Fluffdaddy
Oh sweet then I'll check that out ty

kedo
Nov 27, 2007

How does previewing work with headless JS?

Impotence
Nov 8, 2010
Lipstick Apathy

kedo posted:

How does previewing work with headless JS?

you get json or gql, and you write your own frontend, so it's not really up to WP to determine what your output is supposed to be. do you want to output html? markdown? plain text?

LifeLynx
Feb 27, 2001

Dang so this is like looking over his shoulder in real-time
Grimey Drawer

Fixins posted:

Yeah I use headless WordPress with nextjs via wp graph ql. The only thing I don't like is that the block editor let's clients think it's going to 1:1 look like the editor but that's a me and client issue than a WordPress one.

If I was giving someone a site as a hand-off where they would go in and edit stuff themselves, I think I'd stick to Real Wordpress. For better or worse, there's going to be a whole mess of stuff in the CMS that doesn't make its way into the front-end or even into the API, because I didn't tell it to, and that's going to confuse a user who enters data and expects it to display a certain way or show up at all. There's probably ways to hide things in WP from specific user roles, but I don't want to be redesigning the CMS in addition to everything else. Plus, have you seen what it takes to code a "basic" Gutenberg block?

I've just been using REST API because it's more work to make custom post types and fields show up in GraphQL, plus REST is native to Wordpress so the risk of it simply stopping to work one day is low.

worms butthole guy
Jan 29, 2021

by Fluffdaddy
thats a good point yeah. I still do 99% of my work in wordpress and php. I kinda like the way PHP works with ACF. wish it was possible to make stuff "reactive" though.

UtahIsNotAState
Jun 27, 2006

Dick will make you slap somebody!
Wish me luck boys I'm going all in.

the heat goes wrong
Dec 31, 2005
I´m watching you...

UtahIsNotAState posted:

Wish me luck boys I'm going all in.


Good luck.
Recently dId same on the new job with the program I'm supposed to maintain. 4000 errors and counting.

Don't forget to add Prettier too, makes life so much easier.

UtahIsNotAState
Jun 27, 2006

Dick will make you slap somebody!

the heat goes wrong posted:

Good luck.
Recently dId same on the new job with the program I'm supposed to maintain. 4000 errors and counting.

Don't forget to add Prettier too, makes life so much easier.

You'll be needing this https://github.com/bfanger/eslint-plugin-only-warn

I was going through the rule list and I had never heard of the Yoda syntax before: https://eslint.org/docs/rules/yoda

The rationale not to use it seems moronic. "It'll confuse the reader". That makes no sense. It's like complaining that react code is too hard to read because it tricks the reader into thinking they are XML tags.

Anyone know of any actual harms with it?

Vincent Valentine
Feb 28, 2006

Murdertime

Very few linting rules actually break anything. The reason behind things like Yoda syntax is to try and force an industry-wide standardization that makes sense. The primary reason for this is that if we all use the exact same syntactical rules, anyone could theoretically look at anyone elses code and find it very easy to follow.

If 90% of people say "If Variable Equals Value" and then 10% say "If Value Equals Variable", then the vast majority of people are going to get tripped up for a second when they read the minorities code.

Cugel the Clever
Apr 5, 2009
I LOVE AMERICA AND CAPITALISM DESPITE BEING POOR AS FUCK. I WILL NEVER RETIRE BUT HERE'S ANOTHER 200$ FOR UKRAINE, SLAVA
Yeah, stylistic choices like that may be technically meaningless, but impart significant efficiencies when it comes to reducing cognitive load between engineers, especially at scale. Ideally, the requirements are automated such that everyone's IDE is formatting on save and no real thought ever needs to be put into holding to the rule.

Clear, quickly-parseable code is a godsend.

Splinter
Jul 4, 2003
Cowabunga!

Vincent Valentine posted:

If 90% of people say "If Variable Equals Value" and then 10% say "If Value Equals Variable", then the vast majority of people are going to get tripped up for a second when they read the minorities code.

Yeah IIRC there was a popular book or style guide that was a proponent of "value equals variable", as it prevents accidental variable assignment if you accidentally put = instead of == or === (which by itself isn't a syntax error, so the code still runs). As much sense as that made, it never stopped hurting my brain reading / writing "value equals variable".

prom candy
Dec 16, 2005

Only I may dance
I mean we should probably be preventing accidental assignment via testing, not weird little syntax conventions

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
also I feel like more generally there's a better eslint rule for this?

https://eslint.org/docs/rules/no-constant-condition

Splinter
Jul 4, 2003
Cowabunga!

Grump posted:

also I feel like more generally there's a better eslint rule for this?

https://eslint.org/docs/rules/no-constant-condition

Yeah definitely, it IME it was more back pre-eslint (and maybe even jshint/lint) where I'd occasionally run into people advocating for yoda conditions. IIRC this was a thing even going back to when C was the most popular language, but C has had a linter forever, so even in the olden days I don't think it was ever a great practice.

fuf
Sep 12, 2004

haha
can anyone help me parse this sentence and figure out what they are asking for?

quote:

we need a one-hop type core redirect from all -non-www/http and https- to go to https://www.domain.com and the root URL made indexable. The https://www.domain.com/index.html page to remain non-indexable but the canonical tag pointing to the root homepage URL https://www.domain.com/

Redirect http://domain.com and https://domain.com to https://www.domain.com - ok that's fine, I can put a 301 redirect in the .htaccess file

Make the root URL indexable - ???

domain.com/index.html to remain non-indexable - ???

Add a canonical tag to domain.com/index.html pointing to domain.com - ok I guess but seems pointless??

They seem to think that domain.com and domain.com/index.html are totally separate pages. I know the URLs are technically different but does that really affect SEO?

I dunno if there is an SEO thread but maybe this would be better there

Impotence
Nov 8, 2010
Lipstick Apathy
just add the canonical tag so that if anyone else links to index.html it'll just show up as /

LifeLynx
Feb 27, 2001

Dang so this is like looking over his shoulder in real-time
Grimey Drawer
Is it safe to start using webp yet? caniuse.com says everything supports it except Safari, with the asterisk being "macOS 11 Big Sur or later" but I don't know how common that is. I mostly want PageSpeed Insights to stop yelling at me to serve images in next-gen image formats.

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!

LifeLynx posted:

Is it safe to start using webp yet? caniuse.com says everything supports it except Safari, with the asterisk being "macOS 11 Big Sur or later" but I don't know how common that is. I mostly want PageSpeed Insights to stop yelling at me to serve images in next-gen image formats.

code:
<picture>
    <source srcset="myimage.webp" type="image/webp">
    <source srcset="myimage.jpg" type="image/jpeg">
    <img src="myimage.jpg" alt="my image">
</picture>
Then the browser will just pick the first one it knows how to use, you could even throw AVIF in there as the first source if you want.

UtahIsNotAState
Jun 27, 2006

Dick will make you slap somebody!

Splinter posted:

Yeah IIRC there was a popular book or style guide that was a proponent of "value equals variable", as it prevents accidental variable assignment if you accidentally put = instead of == or === (which by itself isn't a syntax error, so the code still runs). As much sense as that made, it never stopped hurting my brain reading / writing "value equals variable".

I just don't understand this.

How are all the syntax changes in es6 (spread operator, arrow functions, de structured parameters, single object thingy(i dont know what it's called {value} vs {value: value})) acceptable but Yoda syntax is an issue.

es6 is near impossible to read without fully studying it.

marumaru
May 20, 2013



UtahIsNotAState posted:

I just don't understand this.

How are all the syntax changes in es6 (spread operator, arrow functions, de structured parameters, single object thingy(i dont know what it's called {value} vs {value: value})) acceptable but Yoda syntax is an issue.

my guess is that it's just really uncommon? most "bad for cognitive load" things are just "this is really weird and most people don't do it this way, so you'll have to think more than you'd otherwise have to to understand what this means", no?

UtahIsNotAState posted:

es6 is near impossible to read without fully studying it.

pretty much every single programming language has different syntax. that's just to be expected

Adbot
ADBOT LOVES YOU

Splinter
Jul 4, 2003
Cowabunga!

UtahIsNotAState posted:

I just don't understand this.

How are all the syntax changes in es6 (spread operator, arrow functions, de structured parameters, single object thingy(i dont know what it's called {value} vs {value: value})) acceptable but Yoda syntax is an issue.

es6 is near impossible to read without fully studying it.

I think it's because with Yoda you're taking an existing syntax and using it in the opposite manner most people are used to using it, while what you're mentioning is just new syntax to learn (similar to learning a new programming language). It also probably doesn't help that an if comparison is something that can be easily 'read' like a sentence.

I'm not sure if it's due to "if var == val" being one of the first things any programmer learns, and thus is deeply, deeply ingrained (and transcends any specific programming language). Or if it has to due with == using similar syntax as = for variable assignment, and with assignment it's always var = val and thus that's what feels right with == comparison as well. Probably a combination of both.

Imagine a es16 allowed reversing the assignment operator so now you're able to write things like "let 0 = count" and "let 'splinter' = user", and your team (or just someone on your team) decides to adopt this for new code (because someone read a blog post with 'reasons'). Would that not cause you to pause and throw you for more of a loop than learning a new programming language that just had a completely new assignment syntax?

Splinter fucked around with this message at 02:12 on Oct 8, 2021

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply