DEV Community

Big Giant Vue Apps

Jacob Schatz on October 03, 2019

I recently took a huge risk and left Netlify to pursue an opportunity of a lifetime to start a startup. Subs is currently in development. You can r...
Collapse
 
akryum profile image
Guillaume Chau

Yarn workspaces could save you the common linking step. :)

Collapse
 
akryum profile image
Guillaume Chau

What you need to add to the root package.json:

  "workspaces": [
    "packages/*"
  ],

Then remove all node_modules folders in the mono-repo, remove the package-lock.json file and then run yarn in the root directory.

Example with yarn workspaces and lerna

Collapse
 
jakecodes profile image
Jacob Schatz

Thanks a lot! I'll give this a try. This is exactly what I am trying to do.

Collapse
 
karmablackshaw profile image
KarmaBlackshaw

is there anything like this for NPM ?

Collapse
 
olavoasantos profile image
Olavo Amorim Santos

Came to write exactly this. Workspaces with Lerna can really help organize and manage the monorepo.

Collapse
 
seniorwebdeveloperlife profile image
seniorWebDeveloperLife

Not to rain on your parade but what does Subs offer that Google password management does not? I have already sold my soul to Google and it fills in passwords already connected to my google account in every browser that I use without using a fourth party. What is your use case? What would I gain by switching and how much will it cost? Good luck on your startup (no sarcasm intended)!

Collapse
 
sonicoder profile image
Gábor Soós

What is the benefit of a planned to be gigantic monorepo vs using packages?

Collapse
 
jakecodes profile image
Jacob Schatz

It's a Coke and Pepsi argument, both have their pluses and minuses. For me I can add in GitLab CI instructions to build for all the different platforms and make sure everything is good before releasing all at once.

Also so far I've really enjoyed doing one commit that represents a larger body of work. For example, I needed to make a Chrome extension and that doesn't just involve the extension package, it involves, the client package and the api package. So it makes sense to me to have centralized commits that represent the whole idea. It's easier for me to track things.

And each of these repos is technically a npm package. I am just not publishing them.

Also running git push origin master once just saves time rather than doing it 8 times. And having one PR/MR is easier to deal with for me. It's a larger PR/MR which is usually bad but in this case it doesn't cause conflicts because it's many separate packages.

Also by keeping the yarn link inside the repo the setup is easier. One clone and a link, and you are good to go. It means I can develop the common library at the same time as the client for example.

Collapse
 
v6 profile image
🦄N B🛡

// , I'm glad to see you want your git commits to tell a cohesive story. It's kind of what the Sand of Sky blog recommends:

sandofsky.com/workflow/git-workflow/

Collapse
 
v6 profile image
🦄N B🛡 • Edited

// , I recommend being careful not to optimize too closely. One of the best ways to avoid optimization is the ultimate flexibility: Keeping the option on the table to throw out the code, or well abstracted parts of it, and rewrite that code or product from scratch.

It's a little known "dark" pattern of Software Design, from the shadows of Agile, called "Sacrificial Architecture."

exponential growth isnt kind to architectural decisions

It came to mind when I read this in your post:

One thing I've learned: the prototype usually becomes the final code, so do it right the first time.

Should the prototype usually become the final code?

Essentially it means accepting now that in a few years time you'll (hopefully) need to throw away what you're currently building.

I've already run into a couple of projects that took the microservice path without really needing to — seriously slowing down their feature pipeline as a result. So a monolith is often a good sacrificial architecture, with microservices introduced later to gradually pull it apart.

martinfowler.com/bliki/Sacrificial...

Collapse
 
emlautarom1 profile image
Martín Emanuel

Great content! Thanks for sharing your workflow. I'm about to start a project with Vue targeting web, desktop (Electron) and mobile (NativeScript) so this is comes really in handy.

Collapse
 
madza profile image
Madza

Secure password management tools are in high demand, tho nowadays it's very challenging venture to go into by actually building them :) Best of luck with Google OAuth and AES256, if you can bring unique features compared to Lastpass, Dashline, Bitwarden, etc and reduce the security risks, all roads are open.

Collapse
 
padakipavan profile image
padaki-pavan

Looks pretty neat. Have you looked into flutter yet? Seems like it can further reduce your codebase.

Collapse
 
hawkeye64 profile image
Jeff Galbraith

Instead of yarn link which I used to use a LOT, look into yarn workspaces. I have converted to this and it is much more seamless in automatically linking between shared/common packages.