|
Full Circle posted:lmao I meant javascript unless you're laughing at something else. Compared to Wordpress/PHP sites where there's only so much optimization you can do.... IAmKale posted:Wasnt Gutenberg supposed to enable this for WordPress websites? Did that benefit never materialize? lmbo There are endpoints to use for pages and posts, but last I checked (two years ago) they were kind of hit or miss when it came to certain features and plugins being compatible. I might mess with Gatsby to see what can be done these days.
|
# ? Apr 22, 2021 02:12 |
|
|
# ? Jun 5, 2024 17:22 |
|
The problem I've been told with React Gatsby Next etc is that none of the content actually exists in the DOM , so who knows if google is actually indexing it as well as a php site. I do most of my work in wordpress but I agree with you, react and next are more enjoyable to work with and can do fun stuff, but I don't know if it's faster. I do however like WPGRaphql which would allow them to still mess with meta tags etc.
|
# ? Apr 22, 2021 02:15 |
|
https://campground-search-final.vercel.app/camps?city=all&campfeatures=all®ion=all&camptype=all Like this small work in progress app thing I'm working on gets all the data from wordpress to populate it within NextJS which wl then link back to wordpress. Granted it's slllooowwww but I haven't had time to figure out why yet.
|
# ? Apr 22, 2021 02:17 |
|
IAmKale posted:Wasn’t Gutenberg supposed to enable this for WordPress websites? Did that benefit never materialize? lmbo The Wordpress HTTP API really sucks because (iirc) it has to run the whole set of hooks for each request as thought it were rendering a whole page, meaning a page with a bunch of XHRs that hit WP will have much greater overhead than a single WP page.
|
# ? Apr 22, 2021 02:21 |
|
LifeLynx posted:I meant javascript unless you're laughing at something else. Compared to Wordpress/PHP sites where there's only so much optimization you can do.... with server side rendering, you can only have so much crap on a page until it becomes unmanageable, whereas react allows you to make websites that have literally hundreds of mb of javascript doing god only knows what. web slowness is generally caused by people being lovely web designers rather than any individual technology being fast or slow in and of itself.
|
# ? Apr 22, 2021 03:03 |
|
Empress Brosephine posted:The problem I've been told with React Gatsby Next etc is that none of the content actually exists in the DOM , so who knows if google is actually indexing it as well as a php site. server side rendering is a thing
|
# ? Apr 22, 2021 03:11 |
|
Empress Brosephine posted:https://campground-search-final.vercel.app/camps?city=all&campfeatures=all®ion=all&camptype=all It looks like you're fetching the data from WordPress with each page request. My guess is you'd be much better suited just running the request at build time. Try replacing getServerSideProps with getStaticProps. You'll need to ensure your app on Vercel runs the build script every time someone makes an update on WordPress, but the page should be much more performant.
|
# ? Apr 22, 2021 03:21 |
.shtml: well well, look who's come crawling back
|
|
# ? Apr 22, 2021 03:21 |
|
fsif posted:It looks like you're fetching the data from WordPress with each page request. My guess is you'd be much better suited just running the request at build time. Try replacing getServerSideProps with getStaticProps. Sweeet I'm going to try that. I don't think I'm using either of the props but using apollo client to do the fetching?
|
# ? Apr 22, 2021 03:23 |
|
Empress Brosephine posted:Sweeet I'm going to try that. I don't think I'm using either of the props but using apollo client to do the fetching? Ah, okay. If you're using Next.js, you're missing out on one of its killer features by not using it for data fetching: https://nextjs.org/docs/basic-features/data-fetching Using getStaticProps will fetch the necessary data at build time and then just hard code the data into a static page. Might take a tiny bit of elbow grease, but you should be able to just integrate your existing Apollo queries right in the getStaticProps() function.
|
# ? Apr 22, 2021 03:46 |
|
Yeah I should try that. I think I was using appolo so I didn't have to filter for search results in javascript but could do it with the graphql query, but maybe it's worth doing it with javascript. Tha ks for the help
|
# ? Apr 22, 2021 03:48 |
|
Hey did you folks know image maps still exist in 2021?
|
# ? Apr 22, 2021 15:35 |
|
Empress Brosephine posted:Hey did you folks know image maps still exist in 2021? Image maps are awesome.
|
# ? Apr 22, 2021 15:57 |
|
fsif posted:Ah, okay. If you're using Next.js, you're missing out on one of its killer features by not using it for data fetching: https://nextjs.org/docs/basic-features/data-fetching I took your advice and holy poo poo does it load much faster now. Thank you.
|
# ? Apr 22, 2021 17:34 |
|
The getStaticProps stuff also makes it super-easy to get "live-ish" data and all static pages with zero downtime by just setting up a scheduled re-deploy every X hours or whatever sounds reasonable.
|
# ? Apr 23, 2021 07:21 |
|
How do you do that, know if any link? I turned it into client side rendering also but I don't think I'm a fan of that, so I'm going to move it back to getstaticprops.
|
# ? Apr 23, 2021 12:09 |
|
How do folks handle forms in admin areas now? For a while I've been breaking out the actual fields and reusing them in my create and edit views. So _form.blade would include my fields and be embedded into both create.blade and edit.blade where I had the form elements. And in each field I would do something like (value="$field->value ?? ''") to automatically either print the data (if it was the edit form) or leave it blank if it was the create form. But now I'm working with some bigger forms and doing heavier validation, so now I have three possibilities for a field's value: old(‘value’) = form failed validation, reprinting the inputted data $form->value = pulling data from the database to populate the field null = empty, this is a create form I'm using Laravel so getting the first two data options is really clean and simple so I'm trying to avoid doing anything too complicated to build the data in the controller before printing the form. I'm not entirely sure what folks do nowadays. Is breaking the fields out into _form.blade overkill and I should just embed the fields in the create.blade and edit.blade and then just make the appropriate if/else statement in the field values? That seems like the easiest. Years ago I was told this _form separation was best practices so I want to make I'm relatively in line with what other folks do now. I freely admit this whole practice could be bullshit fed to me that I took on good faith at the time. :P
|
# ? Apr 26, 2021 18:09 |
|
By comparison, in Django there's a single form *definition* that can be shared between two separate create/edit views. The create view just gives empty or sane defaults, and the edit view populates them from the DB, and the validation code (which is in the shared form definition) is shared between the two. The create view has its own "validation passed" handler where it creates the record and redirects you somewhere else, and the edit view's "validation passed" handler simply saves the record and either redisplays the form or redirects elsewhere.
|
# ? Apr 26, 2021 21:32 |
|
minato posted:By comparison, in Django there's a single form *definition* that can be shared between two separate create/edit views. The create view just gives empty or sane defaults, and the edit view populates them from the DB, and the validation code (which is in the shared form definition) is shared between the two. The create view has its own "validation passed" handler where it creates the record and redirects you somewhere else, and the edit view's "validation passed" handler simply saves the record and either redisplays the form or redirects elsewhere. Hmm, yeah, that sounds like the way it should work here too. I’ll dig a little more into the docs and see what’s up.
|
# ? Apr 27, 2021 01:20 |
|
A friend is looking for a new web host, managed VPS, he's in Ireland but says it has to be U.S.-based. Doesn't want godaddy. I haven't ordered hosting in years, I have no idea. Any no-regrets choices I can steer him to?
|
# ? May 6, 2021 16:20 |
|
What's he hosting and what's his technical skill
|
# ? May 6, 2021 16:28 |
|
Does it need to be a VPS? Would a PaaS fit the bill?
|
# ? May 6, 2021 22:37 |
|
Forgive my ignorance, what's a managed VPS? Is it something like a DigitalOcean droplet?
|
# ? May 6, 2021 23:24 |
|
marumaru posted:Forgive my ignorance, what's a managed VPS? For a VPS, a "managed" offering would mean that someone who isn't you would take care of all the software installation, configuration, updates, security patches, etc for you. DigitalOcean's droplets are an example of an "unmanaged" VPS, where they just give you the credentials to access the server and from there you're on your own.
|
# ? May 7, 2021 00:07 |
|
Digital Ocean is my favorite unmanaged VPS for sure. The last managed VPS I used was probably Media Temple back when they were all the hotness, which was a very long time ago. These days everything I work on either ends up someplace like DO or on a software/platform specific service. Rackspace is probably still a good bet. What's he using it for? e: he's an old dev from Ye Olden Pre-AWS Days. kedo fucked around with this message at 01:08 on May 7, 2021 |
# ? May 7, 2021 01:05 |
|
Linode is unmanaged but has a managed service which is $100/mo per server on top of the normal hosting costs
|
# ? May 7, 2021 01:15 |
|
Why get a managed VPS these days? Either get an unmanaged VPS and do it yourself, or do whatever you're doing using PAAS/SAAS offerings and never directly touching paying for a server in the first place.
|
# ? May 7, 2021 01:19 |
|
Grump posted:Linode is unmanaged but has a managed service which is $100/mo per server on top of the normal hosting costs That sounds a lot like a "we want to eliminate this product" price point
|
# ? May 7, 2021 15:30 |
|
Munkeymon posted:That sounds a lot like a "we want to eliminate this product" price point haha can confirm. was an employee there. but i'm just giving options
|
# ? May 7, 2021 16:20 |
|
Yo, is there a devtool on desktop that'll let me simulate the ridiculous vh address bar compensation positioning/scaling situation on mobile browsers?
|
# ? May 7, 2021 16:45 |
|
If you’re on Mac, the Xcode toolset comes with an iOS simulator that hooks into Safari’s devtools. Google offers Android simulators you can download as well. I’m phone posting or I’d provide links!
|
# ? May 7, 2021 18:13 |
|
Ah, yeah, got those, I guess I meant something less heavy and slow that just switched a desktop browser to mobile vh mode so I can experiment quickly when I need to.
|
# ? May 7, 2021 22:07 |
|
MikeJF posted:Ah, yeah, got those, I guess I meant something less heavy and slow that just switched a desktop browser to mobile vh mode so I can experiment quickly when I need to.
|
# ? May 7, 2021 23:41 |
|
Nah, a whole responsive scaling with elements not fitting thing. I can figure it out, it was just frustrating 'cos my phone wouldn't connect to dev and it seems like the kind of thing than there really should be a devtools mode for.
|
# ? May 8, 2021 01:41 |
|
I am making a game, and is fun to use CSS3 to spice-up presentation the html of the box is something like this code:
code:
Tei fucked around with this message at 21:41 on May 8, 2021 |
# ? May 8, 2021 21:38 |
|
What's your technology stack for making a game? React? I'd like to make a simple card game for a personal project but don't really know the best way to do it. I guess having the cards be database entries that get pulled? I dunno lol.
|
# ? May 8, 2021 23:54 |
|
Empress Brosephine posted:What's your technology stack for making a game? React? I am using mustache for templates. The programming is ES5 with "modules" and classes. I am not using any reactive framework yet, just because I don't know how to use one and a game is a advanced use of one of these things. I am looking forward to use https://ractive.js.org/. in a future proyect
|
# ? May 9, 2021 06:38 |
|
Empress Brosephine posted:What's your technology stack for making a game? React? Just thinking out loud, why a database? Why not have an array of suits+values on the client side in a Let? mathrandom from the length of the array, render the suit+value as a react component into their "hand" container, remove that element from the array.
|
# ? May 9, 2021 07:19 |
|
the events looks like this in the codecode:
|
# ? May 9, 2021 07:29 |
|
|
# ? Jun 5, 2024 17:22 |
|
Vincent Valentine posted:Just thinking out loud, why a database? Why not have an array of suits+values on the client side in a Let? mathrandom from the length of the array, render the suit+value as a react component into their "hand" container, remove that element from the array. That's a much smarter way of doing it lol. Dang
|
# ? May 9, 2021 12:39 |