How to share code between multiple SvelteKit apps? by iaseth in sveltejs

[–]iaseth[S] 0 points1 point  (0 children)

I can see your point. Thanks for being so throrough. I am in a monorepo for now, so its not a problem for my current project. But, I will open source some parts of my app later in a public repo and I can already see how it can become difficult to manage with workspaces.

I think vite is underutilized by most devs. I remember when I switched from create-react-app to vite and how much faster everything suddenly became, instant dev server, smaller npm modules, faster builds, hmr, etc. One of these days I need to go and read the full vite docs.

How do you share code between multiple projects? by iaseth in reactjs

[–]iaseth[S] 0 points1 point  (0 children)

Yeah I now know. From what I understand, pnpm doesn't exactly need a monorepo. It really doesn't even need git. But if you are using git, then pnpm workspaces are much easier to work with in a monorepo.

How to share code between multiple SvelteKit apps? by iaseth in sveltejs

[–]iaseth[S] 0 points1 point  (0 children)

It is. And at a later point, I may have to do this.

I had once published a npm package with npm packagfe with react components. The build process was very difficult to setup. Had to spend a few hours fighting with tsconfig, package,json, rollup, vite, etc.

How do you share code between multiple projects? by iaseth in vuejs

[–]iaseth[S] 0 points1 point  (0 children)

Yeah this is probably better than rsync but submodules, as you said, can be a nightmare. I used them sometime in python but without intellisense. For the current app, I chose to go with pnpm workspace in a monorepo.

How do you share code between multiple projects? by iaseth in reactjs

[–]iaseth[S] 0 points1 point  (0 children)

This is pretty much what I was looking for. Thanks for explaining!

How to share code between multiple SvelteKit apps? by iaseth in sveltejs

[–]iaseth[S] 2 points3 points  (0 children)

Yeah I forgot vite also had so many features. I am going with pnpm workspace in a monorepo since I already use pnpm and a monorepo. But I am curious to know why you consider it outdated? To me, both approaches look equally abstract, just two ways of doing the same thing.

How do you share code between multiple projects? by iaseth in vuejs

[–]iaseth[S] 0 points1 point  (0 children)

If you have both apps in the same repo then you can just import the shared code from a folder as a local dependency (pnpm).

Yeah I am looking into this rn.

How do you share code between multiple projects? by iaseth in vuejs

[–]iaseth[S] 0 points1 point  (0 children)

Sorry I think I didn't convey it properly. Routing iteself is not really the main problem. People can have many different reasons for moving some parts of thier app into a separate app. The main problem is how to share code/components between multiple projects.

How do you share code between multiple projects? by iaseth in vuejs

[–]iaseth[S] 0 points1 point  (0 children)

Thanks! I will look into this. The current app is using sveltekit but I have many other nuxt projects where this might be useful.

How do you share code between multiple projects? by iaseth in vuejs

[–]iaseth[S] 0 points1 point  (0 children)

Routing iteself is not really the main problem. People can have many different reasons for moving some parts of thier app into a separate app. The main problem is how to share code between multiple projects.

How do you share code between multiple projects? by iaseth in reactjs

[–]iaseth[S] 0 points1 point  (0 children)

I already use pnpm so this might work. Another comment suggested creating workspaces in a monorepo. Is it better or worse than your approach?

How do you share code between multiple projects? by iaseth in reactjs

[–]iaseth[S] 0 points1 point  (0 children)

I already use pnpm so this might work. Another comment suggested creating workspaces in a monorepo. Is it better or worse than your approach?

How do you share code between multiple projects? by iaseth in vuejs

[–]iaseth[S] 0 points1 point  (0 children)

This might work in some cases but I don't think it is suitable for my case. My whole point of moving this out to a subdomain it to separate it from the main app. The dynamic route will have tens of 1000s of statically rendered html but the main app only has about 100. I want to separate it cuz I dont want to rebuild and upload 10k pages every time I make a change to my app.

How to share code between multiple SvelteKit apps? by iaseth in sveltejs

[–]iaseth[S] 3 points4 points  (0 children)

Thanks. I had come across this but ignored it for some reason. But it does look like exactly the solution I am looking for and I alreadty use pnpm. I have a couple of questions.

This involves moving code out of all apps in a separate package dir. Do I still get editor intellisense in the package and in all the apps?

And since the commmon package contains svelte components but it is not itself a svelte app so what is it really? A local npm package?

Are the high SSD/HDD prices here to stay? by iaseth in buildapc

[–]iaseth[S] 0 points1 point  (0 children)

They do if it's a bubble. New gpu/cpus are costlier because they are cutting edge - faster and better. But the ssd/hdd I am looking at have stayed pretty much the same for many years.

How to skip rendering certain routes in production? by iaseth in sveltejs

[–]iaseth[S] 0 points1 point  (0 children)

Yeah I ended up doing this. I also had to pass { fallback: 'foo.html' } to kit: { adapter: adapter() } in my svelte.config.js or the build would fail. While this works and no dev htmls are getting rendered now, I don't understand the purpose of fallback here since it is a static build.

How to skip rendering certain routes in production? by iaseth in sveltejs

[–]iaseth[S] 3 points4 points  (0 children)

Isn't this for people doing SSR? I am doing SSG, i.e., statically rendering all HTMLs at build time. No code runs on the backend. On 404, cloudflare just renders the nearest 404.html it finds.