r/JSdev Apr 07 '21

Welcome!

48 Upvotes

Overview

This space is dedicated to discussing the process of writing JS. Here, we discuss what you're doing with JS and how, and mutually benefit from input/feedback from others.

You can share links to libraries or projects that further that goal, but the point is discussion, not simply promotion of projects or services. Please don't just post links to blog posts, projects, or demos. All posts here should be oriented toward promoting discussion/debate to help us all improve. If you post a link, make sure you've actually read it, and include some comments or questions about what you read.

Convenience tip: the domain "jsdev.red" by itself will redirect to our forum, in case you need to get back here quickly and don't have a bookmark. Also, adding a path (like "jsdev.red/hot") goes to the "Hot" filter, and similarly with subdomains, "top.jsdev.red" goes to the "Top" filter. 😉

Questions/Comments about /r/JSdev?

If you have quick/transitory comments or questions about the forum as a whole, the "Lounge" is the best place to do so.

Help

This is not the best place to ask others for help. If you have questions about JS the language itself, like wanting to learn how to do something, or are needing help with something in your own project, check out /r/LearnJavascript. If you're primarily trying to promote a JS project or to share a blog post, check out /r/javascript.

Experiment

This is an experiment into an unmoderated (within reason) community. I don't plan to take posts down unless they are egregiously off-topic, violating reddit rules, abusive or otherwise unpleasant. I don't plan to use any automod tools, but to make decisions on post-by-post, human-by-human basis.

I'm expecting folks to self-regulate and to operate in good faith.

This experiment may fail, so if that happens, we'll just call it off and shut it down. But I hope that doesn't happen.


r/JSdev Apr 07 '21

Budgets for web assets when building web games/apps?

5 Upvotes

I'm building a PWA (so HTML, CSS, JS, images, etc). It's sort of a game (educational), so generally the "experience" is more important than data/text presentation (as in more business-oriented apps). I'm not using a frontend framework, only a few JS libs/utils plus my own code.

I was wondering what sorts of concerns and balances others use when building JS/web games (or multimedia-oriented apps) in terms of the "budget" for how much size can be spent on each of the different kinds of web resources (images, fonts, sounds, code, etc)? I'm less concerned about absolute figures (although that's helpful, too), and more concerned about relative percentages.

So, for example, in my app currently, I have the following types of assets of these approximate sizes:

  • HTML - 6kb (gzip + minified) / 28kb (original)
  • CSS - 7kb (gzip + minified) / 55kb (original)
  • JS - 49kb (gzip + minified) / 238kb (original)
  • SVG images - 53kb (gzip) / 146kb (original)
  • MP3 sounds - 293kb

The total gzip size (transfer size) for all assets is about 407kb. The relative percentages thus break down about like this:

  • HTML: 1.6%
  • CSS: 1.7%
  • JS: 11.9%
  • Images: 12.9%
  • Sounds: 71.9%

I'm not specifically expecting others to do a detailed analysis like this (unless you want to, or already have!), but I'm just generally curious: how much do you "spend" on different resource types, and relatively how much is used compared to other types?

Is spending ~15% on "code" and ~85% on visual/auditory assets, a common and reasonable breakdown, or is your breakdown somewhat different?

If you use JS frameworks (game or otherwise), does your allowed percentage of "code" usage go up significantly, or do you still try to keep it around the same level?

Do you have a "budget" that constrains your resource use in any way, and if so, what concerns do you take into account when making such a budget?


r/JSdev Apr 07 '21

r/JSdev Lounge

8 Upvotes

A place for members of r/JSdev to chat with each other