Skip to content
This repository has been archived by the owner on Oct 2, 2018. It is now read-only.

Remove HUGE Dependencies #159

Open
kenan-rhoton opened this issue Sep 21, 2018 · 6 comments
Open

Remove HUGE Dependencies #159

kenan-rhoton opened this issue Sep 21, 2018 · 6 comments

Comments

@kenan-rhoton
Copy link
Owner

Description

Our dependencies are huge. Like REALLY big. For context we are over three times the size of Windows 95

To Reproduce

  1. Clean up the repository: git clean -fdX
  2. Check disk useage: du -hs . (8.6M on aws-lambda branch mostly due to .git history which we should clean up a bit maybe)
  3. Run lein uberjar in backend and yarn install in frontend
  4. Size is 31M after lein uberjar (still big) and 194M after yarn install
  5. Cry painfully

Expected behavior

Less than 30M for everything compiled and ready. For context this is more than the size of the entire 1911 26-volume Encyclopaedia Britanicca. I'm pretty sure we can use less code than that.

Additional context

For the backend over half of the size is accounted for by the taoensso.faraday library we're using to connect to DynamoDB (again in aws-lambda)

For the frontend, we only really want 3 things:

  1. Testing (maybe use klud.js? It's half a kilobyte... or maybe Canary or something)
  2. Run a server (maybe just base http with Rlite for the routing?)
  3. Compile pug to HTML (maybe just switch to tiny-mustache like normal people)

Microjs has a bunch of good stuff we can use.

Why does this matter?

Speed, cost of storage, speed, use of memory and speed.

Especially if we're going with an AWS pricing model were CPU and Memory Usage is the basis of our billing, so this is a way to save money. I rest my case.

@Masclins
Copy link
Collaborator

Maybe we could remove the npm packages for testing from what's uploaded to AWS...?

@kenan-rhoton
Copy link
Owner Author

That might be hard to do... I would like to consider more aggresive options once frontend is functioning. (Like straight up killing npm/yarn)

@kenan-rhoton
Copy link
Owner Author

My proposal for now:

  1. Switch the web server to express (very fast and powerful one, just 2MB)
  2. Switch the testing framework to klud (1KB and lightning fast)
  3. Don't yet know what to do with pug, css, sass, less or whatever

@kenan-rhoton
Copy link
Owner Author

Oh actually, if we can move away from .pug (cringe, I know) to use mustache instead, there is a tiny implementation in 0.4KB or a full implementation in 2.2KB

And I really doubt we need to do any css treating with sass, or whatever, we can just use the standard css...

@pernilsalat
Copy link
Collaborator

well, with sass we can have styles function (not styles repetition code) and some logic (loops, etc), so i thinks it is really useful and will give us a lot of freedom

@kenan-rhoton
Copy link
Owner Author

Ok, seems reasonable!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants