mobx icon indicating copy to clipboard operation
mobx copied to clipboard

Move away from TSDX

Open kubk opened this issue 4 years ago • 11 comments

It looks like TSDX is not maintained: https://github.com/jaredpalmer/tsdx/issues/1065

As an alternative I suggest to migrate to plain Rollup. eslint-plugin-mobx is already using Rollup without TSDX. I'd be happy to work on this feature to get better understanding how to build frontend libraries.

UPD: Lerna is also unmaintained: https://github.com/lerna/lerna/issues/2703

kubk avatar Dec 15 '21 20:12 kubk

rollup is great, can definitely recommend! The core lerna stuff is addressed by yarn workspaces as well, so I'd expect we could do without it

mweststrate avatar Dec 15 '21 20:12 mweststrate

One observation from today: If you run yarn install --frozen-lockfile, it still modifies yarn.lock, because it also runs prepare script, which calls yarn install and yarn dedup (without the flags).

urugator avatar Dec 22 '21 20:12 urugator

@urugator Should I keep this behavior? There is an opinion to not commit lock file at all for libraries: https://dev.to/gajus/stop-using-package-lock-json-or-yarn-lock-3ddi

kubk avatar Dec 23 '21 09:12 kubk

I've noticed that Mobx uses Yarn 1. Should I continue using it or update to Yarn 2 or 3? I've never used Yarn, only NPM.

kubk avatar Dec 23 '21 09:12 kubk

Absolutely do commit lock files. I still have nightmares from the world before lock files and they were the feature that made npm bearable. Personally I'd still pick yarn 1, I think it pretty perfect and never got clear what problems yarn 2/3 solves. But I'm fine with anything frictionless :). I'd make sure to set up yarn workspaces at least, it should make testing a lot simpler.

mweststrate avatar Dec 23 '21 10:12 mweststrate

calling yarn install and yarn dedup sounds strange btw, sounds like that can be removed completely

mweststrate avatar Dec 23 '21 10:12 mweststrate

Another option is a fork of TSDX called “dts-cli”.

https://github.com/weiran-zsd/dts-cli

danielyogel avatar Dec 28 '21 22:12 danielyogel

Another option might be Vite. For instance, mobx-keystone uses it.

sisp avatar Feb 09 '22 14:02 sisp

@sisp Thank you for the suggestion. Recently I've successfully migrated a few of my libraries (like mobx-log) to Rollup bundler + Vite as a playground, so far it works well 👍 When I have time to migrate Mobx away from TSDX, I'll definitely check what benefits Vite may bring.

kubk avatar Feb 09 '22 14:02 kubk

Suggest https://github.com/egoist/tsup which depends on rollup and simple configuration.

geekact avatar Apr 26 '22 07:04 geekact

I'm using Microbundle. It uses rollup under the hood and has a ton of useful features. It's really easy to use.

ivandotv avatar Jun 21 '22 19:06 ivandotv

Well FWIW Lerna is no longer unmaintained at least!

ScottAwesome avatar Oct 07 '22 18:10 ScottAwesome

I've moved my internal projects from tsdx to rollup. Has worked very well - and delighted by how well maintained it is!

Rollup is very simple, well-maintained, fast. It makes you feel in control of your builds. Nice plugin ecosystem as well.

tony avatar Nov 06 '22 16:11 tony