X Tutup
The Wayback Machine - https://web.archive.org/web/20220519115656/https://github.com/preconstruct/preconstruct/issues/379
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esbuild option #379

Open
pkieltyka opened this issue Mar 3, 2021 · 6 comments
Open

esbuild option #379

pkieltyka opened this issue Mar 3, 2021 · 6 comments

Comments

@pkieltyka
Copy link

@pkieltyka pkieltyka commented Mar 3, 2021

hi there,

I <3 preconstruct. As the dust is settling on es modules and es6 targets (with little changes in sight, and app/tool adoption growing), and most new apps built today target these systems, it makes sense to optimize the developer experience such that it would simplify this use.

One such suggestion is to abstract the bundle/build function of preconstruct and allow a user to use either babel+rollup or esbuild. I believe this will make preconstruct perform way faster, but more importantly the esbuild will ship with the ideal default targets that most modern libs/apps expect.

The babel experience for me with preconstruct required investing in many days+hours to make decisions on what kind of target and output I'm looking to achieve (as my code does come from TS), and I preferred to skip the babel runtime, and keep it as clean es6 output, and allow front-end app bundlers transform the clean es6 to its final destination. I believe esbuild would be an ideal candidate here and elevate preconstruct greatly.

@MikeAliG
Copy link

@MikeAliG MikeAliG commented Jun 7, 2021

Hello! First of all I'd like to thank you for this great project!

I very much agree with @pkieltyka, Preconstruct is an absolute life-saver for monorepos (thanks to everyone involved) but the build time is extremely slow for larger projects. As I can see, internally, this project uses Rollup for the build process and I think integration with something like this would not be that hard as we have tested this package in production and we had 0 issues but this can be subjective on project basis and I'd like to hear your thoughts on whether or not this is a good option.

Many thanks for all your efforts.

@Andarist
Copy link
Member

@Andarist Andarist commented Jun 7, 2021

but the build time is extremely slow for larger projects.

Could you share some numbers? I have not experienced things being slow by any means and we had some positive feedback regarding performance in the past (for example here: #364 ). Of course, using ESbuild would speed things up even more but there are some tradeoffs related to this as well, so the decision about this has to be considered from all angles.

@MikeAliG
Copy link

@MikeAliG MikeAliG commented Jun 8, 2021

Hi! Sure, thanks for your response. So in our consultancy, we have one single codebase/monorepo which includes all our packages and our internal tools which consists of ~203 packages in total (both big and small packages combined) and the full build time for all of these packages ranges between 10-15mins (Although if you'd like I can take an accurate benchmark later) but as it was explained in #364, I totally respect the future decisions regarding this issue since this is probably such an edge-case that might not be worth investing into which either way is fine by us since this is one of those quality of life options which does not impact the project in major way. Anyway, thanks everyone for all you have done for this community. Much love.

@mitchellhamilton
Copy link
Member

@mitchellhamilton mitchellhamilton commented Jun 9, 2021

Yeah, I'm not sure esbuild would be that valuable here because because what I've found is that most large projects tend to use TypeScript these days and tsc generating declarations is the majority of the time.

Though 10-15 seems extreme - are you using TypeScript and if so, how do you have it setup? One tsconfig per package or one tsconfig for the whole repo or something else?

@MikeAliG
Copy link

@MikeAliG MikeAliG commented Jun 9, 2021

Hello! Thanks for your response!

Yeah, I'm not sure esbuild would be that valuable here because because what I've found is that most large projects tend to use TypeScript these days and tsc generating declarations is the majority of the time.

I fully understand this decision.

Though 10-15 seems extreme - are you using TypeScript and if so, how do you have it setup? One tsconfig per package or one tsconfig for the whole repo or something else?

That is correct, we use one tsconfig for all packages that every package extends from but do you have any suggestions for improving build performance?

@mitchellhamilton
Copy link
Member

@mitchellhamilton mitchellhamilton commented Jun 9, 2021

Try having just one tsconfig at the root rather than one per package

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

No branches or pull requests

4 participants
X Tutup