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

Is Parcel suitable for a monorepo toolchain with Typescript project references? #3853

Closed
tommedema opened this issue Nov 27, 2019 · 3 comments
Labels
❔ Question Stale Inactive issues

Comments

@tommedema
Copy link

tommedema commented Nov 27, 2019

❔ Question

I'm trying to determine if Parcel is right for me. I'm looking to setup a toolchain with the following stack:

  • Typescript project references (composite)
  • Monorepo using Yarn workspaces + Lerna
  • React (Typescript)
  • Serverless framework (Parcel needs to bundle package to be zipped as artifact)

Unfortunately I haven't been able find much information at all regarding using Parcel with Typescript project references (i.e. where one typescript package imports another package within the same monorepo; Typescript understands the graph dependencies etc.).

Is Parcel suitable for a monorepo toolchain with Typescript project references?

@DeMoorJasper
Copy link
Member

DeMoorJasper commented Nov 28, 2019

For project references there is a seperate issue #1839
Parcel supports linked node_modules, which is what a monorepo is... Not entirely sure what you specifically want though.
React has been supported from the start, in Parcel 2 it's even more reliable with TypeScript due to the default ts transformer using Babel.
Not sure how the zipping of bundles would work. I guess we could create a zip per entrypoint? Maybe that would be a reporter plugin? Not entirely sure how you see this.

@tommedema
Copy link
Author

Thanks @DeMoorJasper

I'm giving it a try and documenting my attempt at https://github.com/tommedema/startup-boilerplate

So far it works by relying on Babel to pickup the linked packages, and my editor picks up the typings because it understands Typescript project references. It seems ugly that Typescript's native support for project references is not used by Babel, but it does work.

My approach re serverless is a little naive: I simply have parcel bundle node_modules too, and then the Serverless Framework builds with Parcel prior to packaging, while completely skipping all node_modules except for the Parcel bundled files. There are two problems with this approach:

  1. it only works if the dependency in node_modules can be bundled/understood by Parcel, e.g. no unknown file types
  2. it doesn't include implicit dependencies such as binaries that are packaged with the node_module

I'd really prefer to not have Parcel bundle node_modules, but then the Serverless framework doesn't know how to create the artifact since the node_modules would have to be flattened again (which is not the case in a mono repo).

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.

@github-actions github-actions bot added the Stale Inactive issues label May 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❔ Question Stale Inactive issues
Projects
None yet
Development

No branches or pull requests

2 participants