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
Suspicious Lump
Mar 11, 2004

nielsm posted:

If your whole data set is "small" enough that it can fit in maybe a few MB of JSON data, implementing everything in client-side JavaScript would be very reasonable. Then you can just have a static HTML file with some static JavaScript, loading the dataset as a static JSON file.

(I write "small" in scare quotes because I'm getting old and can't help but thing that a dataset taking up several megabytes is in fact very large, even though a "large" dataset today is measured in TB.)
Yeah the dataset is tiny, it's less than a MB but it changes frequently because the data is being scraped on a semi-frequent basis (say 3 times a week). I think this the way to go, thanks!

baka kaba posted:

I don't really know much about web dev, but from my experience of learning a bit about this stuff, you're looking at it the wrong way. If you want to make a modern web page, you don't really learn JavaScript and then code up the scripting and html in notepad, from the ground up. People used to do that, when websites were simpler, but they've built tools that let you put together much more advanced stuff

That's what frameworks are - the components of a modern website, providing all of the core functionality so you can focus on building your specific stuff on top of it. You could write all this stuff yourself, reinvent the wheel for a year or two, but why?

So yeah, if you're looking to make yourself a website, frameworks are absolutely a part of that. Which is both bad (there are so many and wrangling it all and developing a workflow is a big hump to get over) and good (you can do some real fancy stuff now, some of it with almost no effort!). It's also a good mindset to get into - that to solve a problem you look for the right tools, which might involve stepping outside of the stuff you know and learning something new. And frameworks mean you don't necessarily need to learn a new language, just enough to use the framework itself - they're tools like anything else

(Like I said I don't really know a lot about web dev, so maybe I'm off base with some of that, but I hopefully the general point stands)
I've come around and agree, frameworks do simplify the overall process.

The web dev landscape is super weird, especially to someone from academia who's used to tools doing 1 thing really well and stringing them together in a bash script. I wanted the shortest path to creating this idea and thought frameworks were the long way but apparently they're like a bash script/java lib (say GATK) that you need to figure out how to use. The real issue for me is understanding how front end interacts with backend but I can simplify this by pushing the computing onto the user/browser. The data isn't sensitive but I might need to use a framework to extend the functionality of the site later on.

Dominoes posted:

Web dev requires putting together several related skills. It presents you with an intimidating scatter of tutorials, tools and standards. Javascript, and more broadly web-dev, is a wild west of coding. I've found my sweet spot of Typescript/React/Redux/Django-Rest, but you might find success down a different path. Once you've focused more, fire away with specific questions.
Thank you, it's more like the middle east in my opinion!

Can I ask, is this an example what they call a "full stack" (front and back end) set of tools?

Adbot
ADBOT LOVES YOU

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Yes, that's basically a full stack.

SardonicTyrant
Feb 26, 2016

BTICH IM A NEWT
熱くなれ夢みた明日を
必ずいつかつかまえる
走り出せ振り向くことなく
&



Are there any sort of best practices for taking configuration data from a file? Right now I have a code base that loads properties from a .properties file, but it contains 50+ different variables, some have a limited range of accepted values, and some have an assumed default. At the moment it's very confusing to set up.

I was thinking of using a json file instead, but this is all kind of new to me.

The Fool
Oct 16, 2003


Use YAML


don’t shoot me

1337JiveTurkey
Feb 17, 2005

If it's Java based on the fact you're considering properties files, the HOCON library is pretty good. That's similar to JSON and properties files but immutable and with strong conventions about overrides and other such things.

SardonicTyrant
Feb 26, 2016

BTICH IM A NEWT
熱くなれ夢みた明日を
必ずいつかつかまえる
走り出せ振り向くことなく
&



The Fool posted:

Use YAML


don’t shoot me
I don't know much about YAML, so I don't get the joke.


1337JiveTurkey posted:

If it's Java based on the fact you're considering properties files, the HOCON library is pretty good. That's similar to JSON and properties files but immutable and with strong conventions about overrides and other such things.
Is it hard to set up? I'm hoping to keep this as simple as possible so the next person can't mess it up doesn't need to take as long to learn this.

1337JiveTurkey
Feb 17, 2005

SardonicTyrant posted:

Is it hard to set up? I'm hoping to keep this as simple as possible so the next person can't mess it up doesn't need to take as long to learn this.

Assuming that you're using a build script that lets you just drop a dependency in there: http://search.maven.org/#artifactdetails%7Ccom.typesafe%7Cconfig%7C1.3.3%7C

Here's the project's main documentation: https://github.com/lightbend/config

Assuming that you use the recommended project configuration file name it's just: Config conf = ConfigFactory.load(); and it does all the complicated stuff for you.

tracecomplete
Feb 26, 2017

SardonicTyrant posted:

Are there any sort of best practices for taking configuration data from a file? Right now I have a code base that loads properties from a .properties file, but it contains 50+ different variables, some have a limited range of accepted values, and some have an assumed default. At the moment it's very confusing to set up.

I was thinking of using a json file instead, but this is all kind of new to me.

The best practice is to not take configuration from a data file at all. Modern software development (containers, etc.) have settled on environment variables as a lingua franca for sharing config data into an application. If you can't do that, and there are good reasons why sometimes you can't, something like JSON or YAML might help you. But file formats are file formats; anything works. It sounds like your bigger problem is validation and the like. Since you're using Java .properties files I'm assuming you're using the JVM, and so looking at how Dropwizard pulls in configuration from a YAML or JSON file via object mapping and the use of Hibernate Validator to make sure that you're passing legal values might be helpful.

SardonicTyrant
Feb 26, 2016

BTICH IM A NEWT
熱くなれ夢みた明日を
必ずいつかつかまえる
走り出せ振り向くことなく
&



AFashionableHat posted:

The best practice is to not take configuration from a data file at all. Modern software development (containers, etc.) have settled on environment variables as a lingua franca for sharing config data into an application. If you can't do that, and there are good reasons why sometimes you can't, something like JSON or YAML might help you. But file formats are file formats; anything works. It sounds like your bigger problem is validation and the like. Since you're using Java .properties files I'm assuming you're using the JVM, and so looking at how Dropwizard pulls in configuration from a YAML or JSON file via object mapping and the use of Hibernate Validator to make sure that you're passing legal values might be helpful.
Yeah, right now validation is the biggest issue*. Our .properties file has around 50+ variables, some of which are optional (although I still don't know exactly which) and many of which have a default hardcoded in the Java code.

Is there a tutorial for properly using environment variables?

*for getting configuration details. The biggest issue is how utterly nonsensical our test cases are designed, but I think I can fix that.

SardonicTyrant fucked around with this message at 13:47 on May 21, 2018

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Suspicious Lump posted:

Unfortunately the data presentation I have in mind is a tad more complicated. Essentially it's a clickable heat map. Unfortunately, I think you're right, web dev is drat complicated!

Kinda like https://bokeh.pydata.org/en/latest/docs/gallery/image.html or http://bl.ocks.org/ianyfchang/8119685 ?

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe

AFashionableHat posted:

The best practice is to not take configuration from a data file at all. Modern software development (containers, etc.) have settled on environment variables as a lingua franca for sharing config data into an application.

What? Environment variables are a pain in the rear end: they're easy to accidentally leak to other executing contexts, they only really support key=value config (i.e. no complex schema), and they're hard to share/propagate/reuse. Explicit configuration files have none of those problems. Maybe certain domains of modern software development have settled on environment variables because of limiting constraints they need to operate under, but it's not at all clear to me that that means everyone should be using environment variables for their config.

Because I work at Google, I lean on protobufs for config: define a proto, make a text file containing the data for that proto, then load the text file into an empty proto instance using your language of choice. So that's the route I'd take. If you don't like protobufs, equivalent setups exist for JSON/XML/etc., I'm sure.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

I've been messing around with homeassistant and they use the python library Voluptuous for config file validation.

I'm not doing any development yet, but its really nice being told exactly what keys or values or whatever I messed up in the config files.

In other words, as an end-user I'm really liking good config file handling.

tracecomplete
Feb 26, 2017

TooMuchAbstraction posted:

What? Environment variables are a pain in the rear end: they're easy to accidentally leak to other executing contexts, they only really support key=value config (i.e. no complex schema), and they're hard to share/propagate/reuse. Explicit configuration files have none of those problems. Maybe certain domains of modern software development have settled on environment variables because of limiting constraints they need to operate under, but it's not at all clear to me that that means everyone should be using environment variables for their config.

If you work at Google, you've got a pretty niche view of the world and the tooling you have available to you in your deploy pipeline probably helps a lot with packaging those protobuf config files into per-environment deployments, yeah? None of k8s, docker-compose, Nomad, etc. really provide that, and there is a rush to the lowest common denominator. Which, TBH, means env vars.

I'm an independent software developer and consultant, and a large part of my business is devops/CI/CD stuff (because I have the secret superpower of being able to read documentation and log files, apparently). My post was descriptive, not prescriptive. A lot of it comes down to k8s/docker-compose/etc. being inelegant when used by...well, most people, because most people aren't. Getting configuration data via files into containers sucks--it is doable but it sucks, volumes are an ongoing tire fire--and if you're pulling down open-source/community containers you will overwhelmingly see configuration by environment variables; if you want to not use environment variables, then you are probably building your own from scratch. Given the way that Docker containers are, on the leading not-FAANG edge, becoming--and I'm not saying it's a good idea--de facto standard distribution packages, this is just becoming A Thing.

FWIW, while I agree that env vars are often a pain in the rear end, a lot of the downsides, though certainly not all, are mitigated by Our Shiny Container Future. They're a lot harder to leak to other executing contexts and they're usually fed by k8s deployments, docker-compose documents, and the like so they do become more easily shared and reused. (And that they still remain a pain in the rear end for some purposes is exactly why I pointed at Dropwizard/Hibernate Validator.)

SardonicTyrant
Feb 26, 2016

BTICH IM A NEWT
熱くなれ夢みた明日を
必ずいつかつかまえる
走り出せ振り向くことなく
&



Having given it some thought, I think I'm going to stick to config files over environment variables. If for no other reason than we don't currently use containers, and I don't want to make our code base more complicated. Also, I think it would require rewriting some Jenkins scripts we have, and I don't understand the scripts enough to risk touching it.

Appreciate the help in this thread though.

Pollyanna
Mar 5, 2005

Milk's on them.


Do what we do, and have config files set environment variables. :v:

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe

AFashionableHat posted:

If you work at Google, you've got a pretty niche view of the world and the tooling you have available to you in your deploy pipeline probably helps a lot with packaging those protobuf config files into per-environment deployments, yeah? None of k8s, docker-compose, Nomad, etc. really provide that, and there is a rush to the lowest common denominator. Which, TBH, means env vars.

I'm an independent software developer and consultant, and a large part of my business is devops/CI/CD stuff (because I have the secret superpower of being able to read documentation and log files, apparently). My post was descriptive, not prescriptive. A lot of it comes down to k8s/docker-compose/etc. being inelegant when used by...well, most people, because most people aren't. Getting configuration data via files into containers sucks--it is doable but it sucks, volumes are an ongoing tire fire--and if you're pulling down open-source/community containers you will overwhelmingly see configuration by environment variables; if you want to not use environment variables, then you are probably building your own from scratch. Given the way that Docker containers are, on the leading not-FAANG edge, becoming--and I'm not saying it's a good idea--de facto standard distribution packages, this is just becoming A Thing.

I'll freely admit that I'm not really up on this particular aspect of software development. But are containers really that big a deal? It seems to me that this is mostly focused on highly-scalable setups where you need to be able to just dump more VMs into your website or service by clicking a button. Which is certainly important but I have no idea what proportion of software developers are in that domain. Anyone else want to chime in with their experience or lack thereof on this front?

tracecomplete
Feb 26, 2017

TooMuchAbstraction posted:

I'll freely admit that I'm not really up on this particular aspect of software development. But are containers really that big a deal?
I would say so--and for folks for whom they aren't, they will be soon enough. Docker is kind of The Thing for LOB deployment and services and the like (as much as I might wish otherwise) but there are others like Flatpak (not really part of the "is it what should env var?" discussion though, as it's mostly intended for end-user application delivery). Docker, and to some extent their built-in orchestration gizmo, docker-compose, addresses problems most shops, particularly smaller shops, are bad at dealing with, like artifact versioning and rollback. I don't use them for my own stuff, but that's mostly because I have Opinions about how my systems should run and I have a background with Chef, too.

And while I used to be pretty unhappy with Docker, and parts of it still drive me bugshit, Docker as a whole is...fine, nnow. Some things, like signal handling, are weird, but they're known potholes. More importantly, for a long time it didn't support user namespaces, which presented some security challenges; this is now addressed, and while they're not as secure as VMs I would say that running applications inside of Linux namespaces, through whichever technology you want, is a better call than not doing so. A common pattern is to just use Docker as a packaging mechanism for services and launch a single container on each server in your fleet, and you keep the sharp objects away from your developers (more on that in a second).

The bigger question you asked, and where stuff like scaling comes into play, is whether container fleets are/should be that big a deal. And they probably shouldn't, but it seems like everyone and their dog is running k8s these days whether they need it. Depending on where at Google you are, you can probably appreciate what the various fleet technologies offer, but there are obvious questions, mostly unanswered, around how they scale downwards (in terms of people). I think the answer is "poorly," but I've also made a lot of my living the last few years helping companies who decided they wanted to add More Containers To It as an engineering strategy. It's still a leading-edge technology, but my larger customers, including a couple of large financial services companies, are either looking at moving to containers as a deployment strategy or are already doing it. And I think that most of the cloud vendors have decided that this is the way forward, with Google and Azure already having their own k8s-as-a-service offerings and every Amazon homegrown container platform[0] thing being more or less replaced with a k8s service in the not-too-distant future. There will always be people not using them, but I think that as a general trend the die is pretty well cast.

I think the overall drive, if unintentional, is to continue the trend of developer specialization. The "modern" environment is a lot of programmers who are either junior or knowledgeable only in a small vertical bashing on parts of a system, with the occasional wizard around to solve the "hard problems" created by everyone else[1]. Containerization tries to facilitate that by reducing the scope of things that developers (think, sometimes mistakenly, that they) need to understand about the software they're working on. Which eventually fails. Abstractions usually do. Our Shiny Container Future gives companies more reasons to pay me when those abstractions fail, so I'm not sad about it, but if it sounds bonkers to you I don't think you're wrong. :stare:


[0]: Except Fargate, but Fargate is a money trap for the stupid. Not that running a k8s cluster for a Rails app or whatever is not sometimes a money trap for the stupid, but Fargate is significantly worse.

[1]: As an example outside of operations/containers/etc. that's more directly related to writing code--about a year ago I had a client who had tried to implement job backoff in Node by recursively calling a function that returned a Promise, not knowing that doing so has some severe consequences, and called me in when they started seeing their server "crash"--which it wasn't actually doing, it was just in GC hell all the time. A smart group of developers, but uniformly young and ignorant of how the stuff they rely upon is implemented. And not really equipped with the tools to troubleshoot their problems.

tracecomplete fucked around with this message at 17:14 on May 22, 2018

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

TooMuchAbstraction posted:

I'll freely admit that I'm not really up on this particular aspect of software development. But are containers really that big a deal? It seems to me that this is mostly focused on highly-scalable setups where you need to be able to just dump more VMs into your website or service by clicking a button. Which is certainly important but I have no idea what proportion of software developers are in that domain. Anyone else want to chime in with their experience or lack thereof on this front?

No, containers are absolutely a big deal and really they're a smart thing to use no matter the size of your deployment.

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe

AFashionableHat posted:

I would say so--and for folks for whom they aren't, they will be soon enough.

[plus a bunch more stuff]

Thermopyle posted:

No, containers are absolutely a big deal and really they're a smart thing to use no matter the size of your deployment.

Hm, okay. Sounds like I'd better brush up on them then. Thanks y'all.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


AFashionableHat posted:

Getting configuration data via files into containers sucks

Why isn't that just a git clone?

Pollyanna
Mar 5, 2005

Milk's on them.


ultrafilter posted:

Why isn't that just a git clone?

lol if u commit secrets to git repos

tracecomplete
Feb 26, 2017

ultrafilter posted:

Why isn't that just a git clone?

This doesn't parse to me. But maybe it's a terminology collision, and a number of frameworks don't help with that. Like, you can credibly call Rails's `routes.rb` "configuration", but that's not an infrastructural definition of configuration. It's just part of your application. When speaking in an infrastructural sense, "configuration" is generally reserved for environment-specific data. This includes secrets, as Pollyanna suggests, but also stuff like "this is my DNS root" and "my Redis server is on this host".

Checking those into a git repo doesn't make a lot of sense. And, for reasons that I hope are reasonably obvious, you'd want to run in your production environment the same artifacts (be they JARs, containers, whatever) that you have tested in test/stage/preprod/whatever. They're what you tested--you don't want to rebuild the things and run something untested in production. So, for containers but also for other all-in artifacts like machine images (which for a while were a thing with "immutable servers" or whatever), you need to provide that configuration at runtime. For containers, that basically means environment variables, exposing a file or files (i.e., a JSON config file, but also possibly using /etc/default) via Docker volumes, or a runtime configuration service like Archaius or Consul...but then you have a turtles problem on your hands, in the sense of "where's my Consul cluster?", and you get to do it all over again.

reversefungi
Nov 27, 2003

Master of the high hat!
No idea where else to put this since the functional programming thread is locked. Trying to teach myself a bit of Elixir and I'm doing the exercises on exercism. Not sure I understand the solution someone posted for the following problem:

Problem:

quote:

Histogram function: Returns a summary of counts by nucleotide.

iex> NucleotideCount.histogram('AATAA')
%{?A => 4, ?T => 1, ?C => 0, ?G => 0}

Solution:
code:
  @spec histogram([char]) :: map
  def histogram(strand) do
    Map.new(@nucleotides, fn nucleotideVal -> 
      {nucleotideVal, count(strand, nucleotideVal)}
    end)
  end
Looking at the documentation for count, the only version I can find that takes 2 arguments accepts a function as the second argument. If I try to do this, it doesn't work, even if I use Enum.count instead of count. What's actually going on here?

code:
my_arr = [1, 2, 2, 2, 3, 4, 5]
count(my_arr, 2)

baka kaba
Jul 19, 2003

PLEASE ASK ME, THE SELF-PROFESSED NO #1 PAUL CATTERMOLE FAN IN THE SOMETHING AWFUL S-CLUB 7 MEGATHREAD, TO NAME A SINGLE SONG BY HIS EXCELLENT NU-METAL SIDE PROJECT, SKUA, AND IF I CAN'T PLEASE TELL ME TO
EAT SHIT

I don't know Elixir so this is uninformed chat, but looking around it seems like you're right about the count function needing a function parameter (here's someone else working through the same problem) - so either that person has written their own count function, or they are passing in functions?

This output looks suspicious to me:
code:
iex> NucleotideCount.histogram('AATAA')
%{?A => 4, ?T => 1, ?C => 0, ?G => 0}
Do those ?s in the keys represent some kind of 'is equal to' function? So your map generator isn't getting the character 'A', it's getting a function that checks if its single parameter equals A? Which would work in count... check what @nucleotides actually is

I'd try and research this but it's kinda hard to google things like ? and @ :frogbon:

reversefungi
Nov 27, 2003

Master of the high hat!
The @ symbol signifies module attributes which can be used as constants. The ? before the character returns its matching codepoint rather than a string representation of said codepoint. I wonder if you're onto something, with the ? essentially being treated as a function itself, but in any case I think the second parameter-function should be returning a boolean rather than an integer, so that doesn't quite line up precisely...

Edit: doh I'm an idiot, it's just calling a count that's defined inside that module rather than a library/API. Thanks for pointing me to that!

reversefungi fucked around with this message at 00:18 on May 24, 2018

baka kaba
Jul 19, 2003

PLEASE ASK ME, THE SELF-PROFESSED NO #1 PAUL CATTERMOLE FAN IN THE SOMETHING AWFUL S-CLUB 7 MEGATHREAD, TO NAME A SINGLE SONG BY HIS EXCELLENT NU-METAL SIDE PROJECT, SKUA, AND IF I CAN'T PLEASE TELL ME TO
EAT SHIT

Well that makes a lot more sense and provides less horrors, a good ending!

Total Meatlove
Jan 28, 2007

:japan:
Rangers died, shoujo Hitler cried ;_;
I have a table in PowerBI. The table looks like;

Report | Group | Reporting Area | Location | Voltage | Title | Reporting Year | Month | Month Year | Target | Actual

For each Report Title in the table (34) I have 2018-19 row-by-row with a target for each month.

Id like to be able to have a measure for under/over performance against target, and to be able to plot each Report Title across 12 months with target, monthly and ytd performance.

I’m having a mare tbh, there seems to be no way of using the initial table bar splitting it apart into a table per report title and then using that? But trying to use a date table is loving up otherwise because it’s be a many to many join?

Methanar
Sep 26, 2013

by the sex ghost
Has yarnpkg ate poo poo for anyone else? I'm seeing it spit out 403s. And this if I try to curl something off of it

You've requested a page on a website that is part of the Cloudflare network. The host is configured as a CNAME across accounts on Cloudflare, which is prohibited by security policy.

SardonicTyrant
Feb 26, 2016

BTICH IM A NEWT
熱くなれ夢みた明日を
必ずいつかつかまえる
走り出せ振り向くことなく
&



I think it has to do with the rollout of GDPR today.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
NPM switched to cloudflare, which broken yarn's things that point at npm. It's now back up.

huhu
Feb 24, 2006
Anyone have a good resource for popularity of backend frameworks? All I want to know is frameworks in use by percentage. All the articles I'm finding are for crap like "What frameworks you should learn in 2018!" Historical trends would probably also be useful.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

There's a site that crawls a bunch of other sites and breaks down what technologies they use and IIRC it has some heuristics to make a best guess at the backend.

Unfortunately, I can't recall what this site is called!

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

huhu posted:

Anyone have a good resource for popularity of backend frameworks? All I want to know is frameworks in use by percentage. All the articles I'm finding are for crap like "What frameworks you should learn in 2018!" Historical trends would probably also be useful.

These days it's all about the SPA and the REST API, except the REST API is being replaced by SOAP GraphQL. So pick something that can support GraphQL because it's hot and then ship all your code to the client and then fix your load times by rewriting your app in Express.js so you can add "server hydration". And then fix your SEO by throwing out all your SPA code and moving to a traditional old school framework like Django or Ruby on Rails.

I hear that Elixir/Phoenix thing is pretty cool though...

The Fool
Oct 16, 2003


huhu posted:

Anyone have a good resource for popularity of backend frameworks? All I want to know is frameworks in use by percentage. All the articles I'm finding are for crap like "What frameworks you should learn in 2018!" Historical trends would probably also be useful.

Stackoverflow Insights has some good info, including their developer survey. But they rely primarily on the usage of their site, and self-reported numbers from developers.

https://insights.stackoverflow.com/

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Oh, here's the one I was thinking about :

https://www.wappalyzer.com/technologies

There's also:

https://builtwith.com/

SAVE-LISP-AND-DIE
Nov 4, 2010
If I want to render SPA DOM code on the server am I stuck with a something running on Node? Can I get any of the big front-end frameworks to hook into my server-rendered DOM + state object?

mystes
May 31, 2006

strange posted:

If I want to render SPA DOM code on the server am I stuck with a something running on Node? Can I get any of the big front-end frameworks to hook into my server-rendered DOM + state object?
If you're writing your frontend in javascript, how are you going to render that on the server without using node unless you write another identical version of it in another language? (However, I guess if you're really determined, in some cases it may be possible to render a limited amount of content statically with node so you at least don't have to expose node to the internet.)

On the other hand, if you're transpiling to javascript from a language that has other compilation targets, then the framework you're using may also provide a way to do server side rendering using the other compilation targets so you don't need to use node.js.

mystes fucked around with this message at 20:16 on May 29, 2018

tracecomplete
Feb 26, 2017

mystes posted:

If you're writing your frontend in javascript, how are you going to render that on the server without using node unless you write another identical version of it in another language?
Node's not the only option out there. ReactJS.NET is able to render that code server-side (I don't know if they use Node directly or something like JScript.NET) and I not-too-long-ago saw a kitbashed mess doing React pre-rendering in the JVM with Nashorn.

It makes the baby jesus weep, but you can do it.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

strange posted:

If I want to render SPA DOM code on the server am I stuck with a something running on Node? Can I get any of the big front-end frameworks to hook into my server-rendered DOM + state object?

i'm almost inclined to say that if you want to render SPA on the server, you could like, consider not making an SPA. SPA is a specific technical term meaning "bloated website that uses a twenty megabyte of js framework to solve the challenging technical problem of making it so if the data in your model changes, your view should also update."

Adbot
ADBOT LOVES YOU

dupersaurus
Aug 1, 2012

Futurism was an art movement where dudes were all 'CARS ARE COOL AND THE PAST IS FOR CHUMPS. LET'S DRAW SOME CARS.'

strange posted:

If I want to render SPA DOM code on the server am I stuck with a something running on Node? Can I get any of the big front-end frameworks to hook into my server-rendered DOM + state object?

Theoretically there's no reason you couldn't write your DOM into, say, React js files or Angular template files and serve those to the client. Although you'd have to be careful how you do that so you don't lose the advantages of caching. Node's just the natural use case since the built-in tools use it.


Bruegels Fuckbooks posted:

i'm almost inclined to say that if you want to render SPA on the server, you could like, consider not making an SPA. SPA is a specific technical term meaning "bloated website that uses a twenty megabyte of js framework to solve the challenging technical problem of making it so if the data in your model changes, your view should also update."

Server-side rendering of the first page is a legit technique. Helps with web crawlers and speeding up the initial download and render.

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