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
Doh004
Apr 22, 2007

Mmmmm Donuts...

Knyteguy posted:

Also has anyone tried developing with either with a Microsoft stack like MVC and SQL Server?

Thanks.

Our entire site is a MS stack and it works great. Using MVC.NET 4.

Adbot
ADBOT LOVES YOU

Doh004
Apr 22, 2007

Mmmmm Donuts...

Thermopyle posted:

I kind of wish I had a reason to use gatsby to create a site. For some reason I really like the idea of static site generators, and gatsby brings that together with my appreciation for React.

In case you don't want to click the link, gatsby generates static sites as react-based PWA's and can pull in data from a variety of sources.

I might have even give it a shot on a site like kloa is talking about if I had that kind of client right now.

edit: In case you're not aware, "static sites" in this context only means pages aren't generated on every request like you would have with something like Wordpress. They're pre-generated and re-generated every time you add content.

I've been doing iOS app development for the past 4 years and recently I've been looking for an excuse to catch up with the horribleness that has become webdev so my skills don't stagnate too badly. This seemed pretty cool and I was able to create something pretty neat in a day.

Doh004
Apr 22, 2007

Mmmmm Donuts...

smackfu posted:

Are there are any common languages with immutable data structures as first class citizens? Which would prevent that kind of example?

Come on over to the Swift side :getin:

Doh004
Apr 22, 2007

Mmmmm Donuts...

Nolgthorn posted:

Server code is also in my experience not all that complex, compared to a client side app so value is reduced.

Do you know how many engineers' ears just perked up and are ready to pounce on you for this statement?

Doh004
Apr 22, 2007

Mmmmm Donuts...

Nolgthorn posted:

When I make that statement I am ignoring devops, which thanks to lots of really smart people isn't as complicated as it used to be. Load balancing and sharding and stuff like that is still pretty complicated.

I'm talking about just the code. There are so many complex well tested frameworks/modules/etc out there it's all relatively straight forward, I mean, largely... if you need to process data from a satellite or something like that then to me we're talking about something else. You'd likely abstract that into a separate microservice or at least a module.

Then you just piece it together. It's all encapsulated in a reliable environment. It's like lego at that point.

Client side development on the other hand is the drat wild west.

Yep, just keep digging that hole bud.

Doh004
Apr 22, 2007

Mmmmm Donuts...

prom candy posted:

It's the Wild West because we also have to keep up with UI/UX trends in order to be as user friendly AND unique as possible. I loving love it though.

Just keep in mind, there are plenty of other "front-end"s that need to keep up with UI/UX trends that aren't being rendered on browsers and whose tooling ecosystem isn't a complete dumpster fire!

(yes, I know this thread is front end web-dev).

Doh004
Apr 22, 2007

Mmmmm Donuts...
I'm starting to dabble in front end web dev to keep myself up to date, and I was looking through React and saw they had some recommended starter kits: https://reactjs.org/community/starter-kits.html

I played around with Next.js and two hours later I had a deployed server side rendering SPA which is pretty dope. I'm a big proponent of not using a lot of "precanned" solutions, but this one seemed nice?

Doh004
Apr 22, 2007

Mmmmm Donuts...

Ferdinand the Bull posted:

It's good for getting MVPs up, but of course you'd want to have your entire build system understood by someone on your team if you are hinging your company's success on it not breaking in a year and no one knowing how to fix it.

MVP might be pretty good. I'm thinking this could be good for a standalone microsite for us to test out some new concepts (to help break out of our monolith).

Doh004
Apr 22, 2007

Mmmmm Donuts...

smackfu posted:

How do people handle live deployments where a feature requires compatible private API and front end changes? We have all the dev ops stuff worked out, so people stay logged in and there is no outage. But they are still running the old version of our SPA against the new backend until they refresh the page somehow. Do you version your private API just to handle that short time period? Or just try very hard not to change API?

Doing deployments at night and just logging everyone out avoided this problem nicely since it forced everyone to refresh the front end.

Versioned APIs are important and you shouldn't be breaking that contract with live code. If you're making breaking changes (different endpoints, properties having their names changed) and not providing backwards support, you're doing it wrong.

That said, perhaps you could have a client "version" number that's passed along as a header in your API requests, and have your backend service return a specific status/response if your client's version is too old and needs to refresh. Then, in your client's networking code, have a standardize way to alert the user that they need to refresh their page (a link or something).

I've never done this with a SPA before, but I imagine that could work.

Doh004
Apr 22, 2007

Mmmmm Donuts...

Capri Sun Tzu posted:

Yeah but XML though

The lesson's still the same. There are pros and cons to tightly coupling your datastore to your client-side representation.

Doh004
Apr 22, 2007

Mmmmm Donuts...
It's incredibly easy to do all of this with Rails or Django.

Doh004
Apr 22, 2007

Mmmmm Donuts...
I finally forced myself to "launch" my GatsbyJS blog:

https://blog.bayphillips.com

The entire thing is free as it's hosted on Github Pages, uses Contentful as the CMS and uses CircleCI to deploy updates. This poo poo is pretty cool.

Doh004
Apr 22, 2007

Mmmmm Donuts...

prom candy posted:

Gatsby is great, I'm really looking forward to finding another project to do with it.

I'm slowly trying to influence folks at work for us to start using it for marketing pages...

Doh004
Apr 22, 2007

Mmmmm Donuts...

Lumpy posted:

So that UIkit framework you are using "just works" with React?

No issues so far! It's been interesting getting UIKit + React + Gatsby specific components working as I'll have to add some of the specific classes to various wrappers (particularly the gatsby-image), but it seems to work fine.

It took me a while to realize I had to pass in the UIKit specific html attributes as `data-uk-whatever` in React because it kept yelling at me. I thought the `data` part would break UIKit but it didn't.

Doh004
Apr 22, 2007

Mmmmm Donuts...

my bony fealty posted:

That's what I've been doing at my new job, well more so taking some of our older marketing sites that were built in AngularJS and rebuilding them in Gatsby. It has been a great experience. I'm the only dev on our team though so I get to use whatever tools I want (and get solely blamed when something breaks yay).

Netlify is my free host of choice, has CI built in once you link it to the repo. Works with Github and Gitlab and Bitbucket.

Anyone that can speak to Gatsby V2 vs V1? Is it worth moving to V2 or no real point right now?

I moved over to v2 and it was fine and easy, but keep in mind it's for my stupid personal site and not used in any real production way. The upgrades to babel and webpack are cool and good, as well as making the layout a component is a smart move.

I'm not sure if I'm a fan of the introduction of StaticQuery, which allows you to hit GraphQL from within components instead of having to pass things down from props. I'm still grappling with this one because I've never used a static site generator, but the notion of requesting data from within individual components sounds like a really bad code smell to me. I could foresee that being a huge issue if you start relying on it for complex systems, but alas, we're dealing with static sites. :iiam:

Doh004
Apr 22, 2007

Mmmmm Donuts...

Analytic Engine posted:

Galaxy Brain: forcing dozens of new hires to use first guy's spaghetti architecture

This is me right now...

Doh004
Apr 22, 2007

Mmmmm Donuts...
I *almost* have my Gatsby v2 site working with S3 and Cloudfront. Static sites are great and all, but you do have to reimplement a lot of things that traditional webservers make quite a lot easier. The last thing I need to figure out is why Cloudfront isn't gzipping my assets.

Going through all of this does provide more context as to why static site services like Netlify exist and why they're worth it.

Doh004
Apr 22, 2007

Mmmmm Donuts...

Dominoes posted:

Thanks dude. Will investigate the dets once I find a proper front-end host.

I wrote up a blog post about how I got my Gatsby site hosted on S3 and Cloudfront should you choose to go down that path: https://www.bayphillips.com/blog/gatsbyjs-using-amazon-s3-and-cloudfront/.

tl;dr you can use a Lambda@Edge to detect if a request is going to a "directory", and to append an index.html to the end of it.

Was this more work than using something much simpler and just as (if not more) performant as S3/Cloudfront? Yes. Was it fun and gave me an excuse to tinker around in AWS? Yes.

Doh004
Apr 22, 2007

Mmmmm Donuts...
If you're doing .NET, why WOULDN'T you use Visual Studio? I loving miss it so much.

*edit* Also, VS Code is dope and works great for so much.

Doh004
Apr 22, 2007

Mmmmm Donuts...

Mr Shiny Pants posted:

Because you run Linux? Ionide is pretty awesome.

Do people develop .NET on non Windows machines these days? I haven't done it in 6+ years so I'm definitely not up to speed on it anymore.

Hadn't heard of Ionide, looks interesting :)

Doh004
Apr 22, 2007

Mmmmm Donuts...

Ape Fist posted:

Visual Studio Code is not Visual Studio and does not have the support for .NET development out of the box. You have to install a bunch of helper plugins (which bug out when it looks at cshtml files because Visual Studio Code can't figure out where Razor Syntax begins and HTML ends.) as well as a bunch of other poo poo.

You can get YEOMAN to scaffold up .NET Core poo poo pretty decently and Core can be compiled via CLI but anything before Core is really just not workable outside of Visual Studio.

I think we are all on the same page with this?

Doh004
Apr 22, 2007

Mmmmm Donuts...
Thanks for the heads up. Looks like we're clear on that but goddamnit.

Doh004
Apr 22, 2007

Mmmmm Donuts...

Grump posted:

Thanks. I think I'm going to end up dropping firebase and NoSQL. I know Firebase says that duplicating data is fine, but it seems like I'm basically just creating two very similar documents, at that point.

I've been looking at GraphQL and GraphCMS this afternoon and it looks promising. Honestly this project is just so I have something more recent to put on a resume, so I might just end up learning some Python/Flask to make me look better.

Definitely for another thread, but please make sure you have a solid understanding/experience with relational databases if you're gonna start applying around (I assume from your comment on padding your resume). GraphQL is cool and new, but SQL's been around for a long time and is good.

Doh004
Apr 22, 2007

Mmmmm Donuts...

Munkeymon posted:

Anyone know how to make Gatsby poo poo out a minimal bundle with a predictable name?

Ehhh this sounds funky. As in you don't want the chunked, path based bundles?

I'd steer clear of doing this, but I'd imagine you can do something to this extent by overriding/adding your own rules to the webpack config: https://www.gatsbyjs.org/docs/add-custom-webpack-config/

Doh004 fucked around with this message at 13:33 on Jan 31, 2019

Doh004
Apr 22, 2007

Mmmmm Donuts...

Munkeymon posted:

I'm just using it as a static site generator that happens to use a framework I'm familiar with and it's slightly more annoying to clean up the old files when I copy stuff to the server. Plus I almost certainly won't need, say, the map files because I'm not doing anything complicated, so leaving them out of the build output should be fine.

If you don't have a tool to handle the diffing for you (I host mine on S3 and use their CLI to sync the folder), couldn't you just clear out the folder entirely and reupload it each time. Obviously depends on the size of your site.

Doh004
Apr 22, 2007

Mmmmm Donuts...

Grump posted:

Apparently this solution wasn't good enough because it "creates the potential for latency to cause edge cases." :shrug:

... but you need the refreshed token before making the rest of the API requests...?

Doh004
Apr 22, 2007

Mmmmm Donuts...

bartkusa posted:

Webpack renames our images with hashes of their content.

This is correct and a major advantage to using modern build tooling like Webpack. It also lets you start to use aggressive cache-control headers on your static assets.

Doh004
Apr 22, 2007

Mmmmm Donuts...

Sistergodiva posted:

We are working with a bank which has a like 3 week onboarding to get to their jira through citrix so I am assuming we can't change their server environments.

My project manager thinks we can solve thid by ejecting and removing webpack but am I assuming right when I think we would need to conf their server to fix it?

It sounds like you're confusing React with something like Node & Express. Like others have said, React is not a web server that handles requests and provides responses. It's literally just HTML and Javascript that runs in the browser.

Doh004
Apr 22, 2007

Mmmmm Donuts...
All codebases are poo poo. Literally the moment you push code out to production it becomes tech debt.

Scope, time and resources. Those are the three levers when developing software and very rarely (if ever) do we have control on all three of those things.

Doh004
Apr 22, 2007

Mmmmm Donuts...
Gatsby is dope and good with a really extensive plugin system that allows you to pull from dynamic data sources at build time to statically generate the entire site.

Doh004
Apr 22, 2007

Mmmmm Donuts...
Used it at last job, worked pretty well for our manual web QA work.

Doh004
Apr 22, 2007

Mmmmm Donuts...
As someone who was on a team building out web-apps with Silverlight back in 2010, let me just say I'm wary of web-based Microsoft UI frameworks.

Blazor looks p cool though, hadn't heard of it until now.

Doh004
Apr 22, 2007

Mmmmm Donuts...

Careful Drums posted:

imo the only thing that sunk silverlight was that it was a proprietary browser extension. Blazor is built on top of the WebAssembly standard so we can at least say it won't have that problem.

Famous last words ;)

Doh004
Apr 22, 2007

Mmmmm Donuts...
And you can then ask him about it on Twitter and he'll explain it even further.

Doh004
Apr 22, 2007

Mmmmm Donuts...
I'd say it's also fundamentally different from how FB has handled a lot of its other open source projects before. React is good.

Doh004
Apr 22, 2007

Mmmmm Donuts...

Rex-Goliath posted:

Oh yeah I know those exist I more want to do it as a hobby. I guess doing it on AWS would be good experience as well though. I just want to physically own the machine, I guess. :shrug:

I too hung on quite long about having dedicated machines because it's how I did things damnit. But then I tried out running my wife's blog on EC2 and my crappy site on S3 and Cloudfront: https://www.bayphillips.com/blog/goodbye-to-dedicated-server-hosting/

It's exactly what I need.

Doh004
Apr 22, 2007

Mmmmm Donuts...

Ape Fist posted:

I have a young family and it's ten thousand pounds in a city where ten thousand pounds is loving huge. So I don't get to make these kinds of decisions thinking solely about myself.

The usual justification to get you to move without good cause (toxic environment, dying company etc) is a 25% raise. If the 10k hits that mark, go for it.

Adbot
ADBOT LOVES YOU

Doh004
Apr 22, 2007

Mmmmm Donuts...

Grump posted:

So I'm looking to deploy my personal site as a Gatsby site, using Nginx on Debian 9.

I want to set up a little bash script that will:

git pull && yarn build

and send a 200 or 400 status via a Github webhook when a PR is merged. And also log any errors to a text file. Can anyone point me to a helpful guide? I'm not so great with bash.

Go use a cloud-based CI like CircleCI or Travis to do be hooked up your Github repository, build and deploy your site to your host. They're super easy and free. I use Circle to deploy my Gatsby site: https://circleci.com/gh/BayPhillips/gatsby-blog

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