ft-interactive / starter-kit

A template for IG pages
64 stars 15 forks source link

RFC: Kill ./install and ./configure #243

Closed aendra-rininsland closed 1 month ago

aendra-rininsland commented 5 years ago

These are both BASH scripts that, while not terribly complex, are annoying to keep working in both Zsh and BASH, break the language idioms of Starter Kit, haven't been touched in ages and are overly complex from a UX perspective. They also do some pretty weird things with Git that are just wholly unnecessary (see, for example, all the .netrc instructions in README).

There are also better, newer approaches we can leverage with little difficulty.

Solutions:

If you could please respond with your preference of these two approaches, I can move forward as one of the few projects I'll have time for in the six days I'm in the office this month — thanks!

tlfrd commented 5 years ago

I prefer the first solution

maxharlow commented 5 years ago

In my mind the confused part of Starter Kit is that it mixes and conflates two different things -- boilerplate that's expected to change, and various build and setup stuff that isn't. I imagine this is due to the way Starter Kit has evolved rather than by design -- the creation of g-components was a great step forward in spitting the two apart, but the stuff that's left in this repository is still a mish mash of both.

The issue you mention about shipping Ipsum is symptomatic. There's no clear place for things such as type checking and validation of the config. It also means that when Starter Kit is updated, if you want to bring those updates into a project you're working on it's a tedious manual diff and copy-paste process. Worse, as Starter Kit can't be properly versioned in its current state, so trying to understand a Starter Kit project build means mentally comparing the state of Starter Kit at the point the project was created with the file you're looking at.

In my view the solution would be to transform Starter Kit into a static site builder that runs on the command line. It'd include everything that isn't boilerplate in this repo, including things like config default values, but not the boilerplate Ipsum stuff. It would have proper versions published to NPM. Running it would do everything necessary to produce a dist directory.

Then you'd separately have a new project generator that would produce something quite minimal. That would include a package.json with g-components and the new Starter Kit as versioned dependencies, and add a script to build via Starter Kit. The rest would just be boilerplate example files that we expect to modify. It would generate a config file, but only including required values as examples, as anything optional would fall back to defaults specified in Starter Kit. There'd also be an app.js with our Ipsum.

Which is I suppose a longer way of saying I prefer the second option

aendra-rininsland commented 5 years ago

@maxharlow This is a super good insight, Callum had thought way back in the day that we should just use create-react-app and lean entirely on that for our build-tooling.* Honestly, I'd love to do that and make SK just the most basic of scaffolders, it would be one more complex bit of code that we simply don't have to maintain.

I actually investigated that idea a bit and here were my conclusions:

Let's talk about this next week when I'm back in the office. It's a bigger piece of infrastructure work but we should totally do it if we can pull it off in a reasonable amount of time. 👍 👏 👏 🙌 🙌

* We didn't at the time because we thought SK's requirements too complex and not enough buy-in on React from the rest of Technology. Things have evolved substantially and I no longer think this is the case.

aendra-rininsland commented 5 years ago

Also, having just gotten back from a conference about doing all of this — let's think even bigger. What if we used something like NextJS or even Gatsby in conjunction with something like Netlify CMS? We could make interactive articles part of one single web-app. Updating components in one place updates every page to the latest styles. We don't have to worry about breaking old content during style/Origami updates because we have a single idiomatic model for building content. People ultimately author components and Markdown. We stop creating literal microsites for (pardon the profanity) every goddamn article.

It's an idea, is all I'm sayin'...

maxharlow commented 5 years ago

I've not spent long looking at Create React App et al, but my understanding of these tools is they're just collections of some rational default build options to get your project started, which you could then customise later. Given we'd want/need to do some customisations of that default config, adding FT-specific stuff, what does using CRA (or the others) give us?

One of the best things about our current setup is the isolated static nature of our deploys. Yes, there's duplication, but disc is cheap. And deploying like this has a couple of nice properties. One, when working on one project the risk of breaking every other project we've ever done is close to nil, no matter what you do. And two, the ongoing maintenance overhead for maintaining the S3 Bucket etc is almost nothing, as is the surface area we need to keep secure. So by all means let's explore Netlify CMS etc, but let's not give up these properties without good reason.

We should also consider doing little or nothing. We create perhaps a dozen IG pages per year, so let's be mindful of how long it would take for the time and effort spent on improving the process to be amortised across future projects.

aendra-rininsland commented 1 month ago

Closing as woefully outdated