Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

Stop shipping TypeScript #391

Closed
timsuchanek opened this issue Jan 9, 2020 · 6 comments
Closed

Stop shipping TypeScript #391

timsuchanek opened this issue Jan 9, 2020 · 6 comments
Assignees
Labels
kind/improvement An improvement to existing feature and code.
Milestone

Comments

@timsuchanek
Copy link
Contributor

timsuchanek commented Jan 9, 2020

As of now Photon.js uses TypeScript in its generation process.
By directly generating the right files, we can get rid of the TypeScript dependency. That will greatly improve performance and bundle size.

Related: #388

Related: #7

@timsuchanek timsuchanek added the kind/improvement An improvement to existing feature and code. label Jan 9, 2020
@timsuchanek timsuchanek self-assigned this Jan 9, 2020
@janpio janpio added process/candidate Candidate for next Milestone. and removed process/candidate Candidate for next Milestone. labels Jan 9, 2020
@timsuchanek timsuchanek added the process/candidate Candidate for next Milestone. label Jan 17, 2020
@divyenduz
Copy link

Internal note: dropping from current sprint

@janpio janpio added this to the Preview 21 milestone Jan 17, 2020
@janpio
Copy link
Member

janpio commented Jan 17, 2020

@divyenduz: Investigate a bit what this means for platforms.

@divyenduz
Copy link

This only affects AWS lambda deployments using the AWS CLI and manual packaging. All major platforms like zeit, netlify, heroku do not bundle the dev dependencies and hence, do not include typescript in their bundle.

@timsuchanek
Copy link
Contributor Author

timsuchanek commented Jan 19, 2020

@divyenduz to my knowledge both heroku and netlify will ship TypeScript due to their algorithm. (Note that TypeScript is also part of the @prisma/client bundle)
Please create a reproduction with each to be sure.

@timsuchanek timsuchanek removed their assignment Jan 20, 2020
@janpio janpio removed the process/candidate Candidate for next Milestone. label Jan 21, 2020
@divyenduz
Copy link

Heroku, netlify, zeit, serverless framework all platforms are able to remove typescript and Prisma CLI dependencies from node_modules root folder but the dependency from the client bundle itself (which lives in generator-build) stays because it is a part of the production package. Which is expected.

E2E tests can serve as the reproductions (with adjustment of running ls on the node_modules at runtime): https://github.com/prisma/prisma2-e2e-tests/tree/master/platforms

This means that AWS CLI is the only tool which doesn't make the bundle optimized for its size.

However, since Prisma client is really large in size, it is easy to hit these limits in any platform. Which is why I recommend taking this one up before the release.

I was trying to deploy a Prisma project with a Lambda layer (ffmpeg, 40MB) and I hit this limit. I assume for any large projects the limit will be hit. I could get around it by thinning my layer and pre, post deploy hooks like this:

image

@divyenduz divyenduz added the process/candidate Candidate for next Milestone. label Jan 29, 2020
@timsuchanek timsuchanek assigned timsuchanek and unassigned divyenduz Jan 30, 2020
@janpio janpio added process/next-milestone and removed process/candidate Candidate for next Milestone. labels Jan 30, 2020
@janpio janpio modified the milestones: Preview 21, Preview 22 Jan 31, 2020
@timsuchanek
Copy link
Contributor Author

Thanks a lot for reporting 🙏
This issue is fixed in the latest alpha version of prisma2.
You can try it out with npm i -g prisma2@alpha.

In case it’s not fixed for you - please let us know and we’ll reopen this issue!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/improvement An improvement to existing feature and code.
Projects
None yet
Development

No branches or pull requests

3 participants