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
abraham linksys
Sep 6, 2010

:darksouls:

libcxx posted:

If you ever thought to yourself "I wish make was worse and depended on node-loving-js" then grunt is the tool for you.

:confused: Node is basically the easiest runtime of any language to get up and running with. There's no virtual environments or bundler to worry about.

The problem with Grunt is that its declarative nature makes it a poor fit for creating complex build pipelines, and it totally lacks any kind of partial rebuild support (i.e. I have ten ES6 files that get compiled through Traceur and concatenated, I change one, all of them have to rebuild).

Also the problem with Bower is that it's based on loving Git and after years of telling people "don't check in your built assets to Git" you now have to tell devs "okay check in your built assets to an orphaned build branch or another repo," which is a pain in the rear end compared to npm publish.

There's apparently a slow-rear end rewrite of Bower happening to add a real registry, but really we just need to use NPM for browser packages because it literally already does everything you'd want it to do except let you install to a folder not called node_modules :v:

Kobayashi posted:

Ahh OK, I can see that.

I have a different use case: My job is to occasionally build prototypes that demonstrate design ideas, without worrying about things like latency, memory usage, performance, older browsers, etc. Because I'm not a real developer, I try to keep my environment as simple as possible. When I'm working on something, I run a super simple, Express-based Node server locally, with everything else as client-side Javascript. With LESS in watch mode, all I need is a text editor, a browser, and web server -- any web server -- to make changes. It doesn't matter what my client is running, I just need an FTP login and I can "deploy" my work for them to play with. Sure SASS is more powerful and concatenation/minimization is essential for real-world apps, but the scope of my work is such that I don't care about such things.

With that in mind, I was hoping bower would let me say "bower jqeury" or "bower moment" or "bower handlebars" and it would go grab the scripts (and any dependencies), strip the version from the filename (if specified) and put them all in a standard, predictable location without any other cruft. I realize it's my own laziness holding me back from embracing a real build system, but I don't do anything complicated enough to force me to learn it right now. On the contrary, I'm actually being driven to try to learn something like require.js so that I can programmatically bring in random Javascript libraries. From what I can tell, this is highly discouraged, but it works for my needs (highly wasteful demos/prototypes).

There's nothing discouraged about Require.js, except for the part where its documentation is unreadable. Just make sure to run it through the optimizer (probably via Grunt) before deploying.

Please Use Modules. If you're writing more than one <script> tag in 2014, you're doing something wrong.

Adbot
ADBOT LOVES YOU

abraham linksys
Sep 6, 2010

:darksouls:

Head Bee Guy posted:

I'm also open to rethinking the stack. For reference, I have some familiarity with React and would like to stick with that, and the company will most likely be using Shopify logistics for shipping/returns etc.

not to blow up what you've got so far, but shopify has their own react-based framework called hydrogen, might be worth taking a look: https://shopify.dev/docs/custom-storefronts/hydrogen

they have been investing big in it over the last year or two and are doing a lot of cutting edge react-y things, but i have no experience with it myself so can't actually vouch for it. just always seemed like a neat thing if you're already invested in that world

abraham linksys
Sep 6, 2010

:darksouls:
if you just want runtime type-safety with no ORM, you can hand-write zod schemas for the expected query results, and this brings up typescript to parity with, like, every other typed language where the types exist at runtime. there's some libraries that'll integrate this like slonik (https://github.com/gajus/slonik).

MrMoo posted:

Drizzle ORM is the main one that comes up in search results, although it’s a bit tedious that yet again another layer wants to be the single source of truth for domain models.

https://orm.drizzle.team/docs/zod

if you're using an ORM like drizzle you probably don't need any extra runtime validation? it already has its own schema DSL that i assume would enforce stuff at runtime

if you want actual end-to-end type safety when interacting with a database that is a huge can of worms in any language and can be a pit of a pain in the rear end to get set up (e.g. my java-heavy employer eventually gave up on JOOQ's DSL for being way too hard to work with and is still keeping on with JDBI). stuff like prisma exists but whoof that is some heavyweight stuff

abraham linksys fucked around with this message at 19:07 on Mar 25, 2024

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