Skip to content

Upgrade to now v2#217

Merged
styfle merged 14 commits intomasterfrom
now-v2
Feb 24, 2019
Merged

Upgrade to now v2#217
styfle merged 14 commits intomasterfrom
now-v2

Conversation

@styfle
Copy link
Copy Markdown
Owner

@styfle styfle commented Dec 18, 2018

This is my first attempt to get Package Phobia running on Now v2

@vercel
Copy link
Copy Markdown

vercel Bot commented Dec 18, 2018

This pull request is automatically deployed with Now.
To access deployments, click Details below or on the icon next to each push.

@styfle
Copy link
Copy Markdown
Owner Author

styfle commented Jan 28, 2019

Related issue:

stelligent/dromedary-serverless#3

The solution seems to be adding the HOME environment variable in 748e7de.

@vercel vercel Bot temporarily deployed to staging February 7, 2019 21:28 Inactive
@vercel vercel Bot temporarily deployed to staging February 7, 2019 22:20 Inactive
@vercel vercel Bot temporarily deployed to staging February 8, 2019 00:16 Inactive
@r0mflip
Copy link
Copy Markdown

r0mflip commented Feb 8, 2019

Are you trying to use ts files directly unlike in Now 1.0 where they were compiled?

@styfle
Copy link
Copy Markdown
Owner Author

styfle commented Feb 8, 2019

With Now 2.0 builders, the entry point to the builder can be TypeScript and it will perform the compilation and actually bundle all the code into a lamda.

The problem I’m running into is that the bundle does not include the CLI so I can’t spawn a child process to invoke npm install.

So now I'm attempting to use the npm API directly so it gets included in the bundle, but ran into a different problem with ncc.

@vercel vercel Bot temporarily deployed to staging February 9, 2019 02:49 Inactive
@r0mflip
Copy link
Copy Markdown

r0mflip commented Feb 10, 2019

I think you can try using @now/static-build instead of making it into a lambda if it won't let you fork processes. Just compile the ts and run it.

Maybe like this https://github.com/r0mflip/actions-deploy-zeit/blob/master/now.json#L6 and https://github.com/r0mflip/actions-deploy-zeit/blob/master/package.json#L7

@styfle
Copy link
Copy Markdown
Owner Author

styfle commented Feb 10, 2019

@r0mflip If you think you can fix it, feel free to create a PR 😁

I’m pretty certain I can’t use a static builder because this is not a static website.

At best, I could use the node-server builder but I would like to wait for feedback on this ncc bug: vercel/ncc#275

@r0mflip
Copy link
Copy Markdown

r0mflip commented Feb 10, 2019

@styfle Yeah, you are right, I'am wrong about that. Can't build a traditional server on zeit right?

@styfle
Copy link
Copy Markdown
Owner Author

styfle commented Feb 10, 2019

@r0mflip You can build a traditional server. See https://github.com/styfle/react-server-example-tsx for an example that was just upgrade to Now 2.0

The thing to remember is that "traditional" servers have the assumption that they can take as long as necessary to boot because it only happens once. But serverless favors many smaller, faster booting microservices so it can be scaled out on-the-fly as traffic increases (or scaled down when traffic decreases).

Now 2.0 pushes you (the developer) towards this serverless architecture.

@r0mflip
Copy link
Copy Markdown

r0mflip commented Feb 10, 2019

Each route becomes an isolated microservice right.

@styfle
Copy link
Copy Markdown
Owner Author

styfle commented Feb 10, 2019

Ideally, yes

@styfle
Copy link
Copy Markdown
Owner Author

styfle commented Feb 24, 2019

LET'S DO THIS! :shipit: 🚀

@styfle styfle merged commit 3cf296f into master Feb 24, 2019
@styfle styfle deleted the now-v2 branch February 24, 2019 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants