foliojs / textkit

Text layout framework
41 stars 10 forks source link

New build system #30

Open diegomura opened 6 years ago

diegomura commented 6 years ago

@devongovett We introduced lerna to be able to inject different module implementation into textkit core, which I think it's great. It give us great flexibility, specially if we want foliojs projects to run everywhere (textkit itself and other libs still has node dependencies that, even if shimmed, people may want to avoid).

But working with it I experience a lot of pain: publishing many packages in cascade, complex project layout, etc.

That's why I thought about switching into a new approach (exactly what nextjs does):

I'm very convinced we should do this. Would love to hear your thoughts!

devongovett commented 6 years ago

Doesn't lerna automatically bump the versions when publishing?

diegomura commented 6 years ago

Supposedly yes. But I recall having issues working with it. No exactly what since it’s been awhile I don’t publish. But still I think there has some other benefits

devongovett commented 6 years ago

https://lernajs.io/#command-publish - says it will publish anything that changed.

So, if I understand you correctly, instead of separate npm packages, you would like to publish one package with subfolders. Correct? I think the general tradeoff here is whether the packages are tightly coupled together in the first place. if the sub-packages are tightly coupled, then you'll need to install everything anyway. If the packages are usable independently, then it is nice to only install that package without the rest of them.

diegomura commented 6 years ago

says it will publish anything that changed.

Yes. It's not that with Lerna I cannot achieve what I want (I do). It's more about not shipping textkit in +10 different packages, which IMO makes things a bit more akward both fo mantainers and users

if the sub-packages are tightly coupled, then you'll need to install everything anyway. If the packages are usable independently, then it is nice to only install that package without the rest of them.

Packages are made in a way that they are not tightly coupled together, which I think its nice. Installing everything it's not much concerning because even though you will download it, if you don't use a particular module you won't ship it in the final build.

Maybe I put much emphasis in Lerna, which is not my main concern. I was thinking more in not having to install more than 6 packages when you want to do a custom text layout. I worked with next extensively lately and I really enjoyed how it's shipped, so I thought proposing it. And if there's a time to do these types of changes is now that there are no reported people using textkit (rather than me haha).

Having said that, I'm more than ok of just keeping things how they are