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

chore: [RUN-4878] Add Node16 support #435

Merged
merged 2 commits into from
Nov 21, 2022
Merged

Conversation

pthirumurthi
Copy link
Contributor

@pthirumurthi pthirumurthi commented Nov 9, 2022

Description

JIRA Ticket: https://issues.corp.twilio.com/browse/RUN-4878

  • Adding support for Node16 Runtime

Testing

Follow this doc to setup Serverless toolkit

Updated Twilio Serverless Plugin to point to my local

➜  plugin-serverless git:(RUN-4876-Serverless-Node16) twilio plugins:link .
twilio-cli: linking plugin @twilio-labs/plugin-serverless... done

➜  plugin-serverless git:(RUN-4876-Serverless-Node16) twilio plugins
@twilio-labs/plugin-serverless 3.0.4 (link) /Users/pthirumurthi/code/Projects/serverless/serverless-toolkit/packages/plugin-serverless

Node 18 Warning

Added a debug log to print the Node version. This warning doesn't appear for v14 and v16.

test-node18-toolkit % twilio plugins
@twilio-labs/plugin-serverless 3.0.4 (link) /Users/pragad/Pragad/Twilio/ServerlessToolkit/serverless-toolkit/packages/plugin-serverless

test-node18-toolkit % nvm current
v18.12.1

test-node18-toolkit % twilio serverless:start
PRAGAD 1. nodeVersion: 18.12.1

│ WARNING Different Node.js Version Found
│
│ You are currently running Node.js 18.12.1 on this local machine. The production environment for Twilio Serverless currently supports versions 14.,16.x.
│
│ When you deploy to Twilio Serverless, you may encounter differences between local development and production.
│
│ For a more accurate local development experience, please switch your Node.js version.
│ A tool like nvm (https://github.com/creationix/nvm) can help.

Node 16

Created a deployment and verified that node16 is being used

test-node16-toolkit twilio serverless:deploy --override-existing-project

Deploying functions & assets to the Twilio Runtime

Username	SK6cf05c5a49b4101137f2ad05292d6dc5
Password	HfAO****************************
Service Name	test-node16-toolkit
Environment	dev
Root Directory	/Users/pthirumurthi/Pragad/Twilio/Serverless/Toolkit/test-node16-toolkit
Dependencies	twilio, @twilio/runtime-handler
Env Variables
Runtime		node16

✔ Serverless project successfully deployed

Deployment Details
Domain: test-node16-toolkit-9479-dev.dev.twil.io
Service:
   test-node16-toolkit (ZS3047dabd47c45aa5d2348e5600a4d872)
Environment:
   dev (ZE0962a3d3e42f3111fdfd9139b4c08f98)
Build SID:
   ZBdbf5e94036b21ae40c52f836b721110d
Runtime:
   node16
View Live Logs:
   Open the Twilio Console
Functions:
   [protected] https://test-node16-toolkit-9479-dev.dev.twil.io/sms/reply
   https://test-node16-toolkit-9479-dev.dev.twil.io/hello-world
   https://test-node16-toolkit-9479-dev.dev.twil.io/private-message
Assets:
   [private] Runtime.getAssets()['/message.js']
   https://test-node16-toolkit-9479-dev.dev.twil.io/index.html
   https://test-node16-toolkit-9479-dev.dev.twil.io/style.css

Packager logs for the above request

[2022-11-08T13:21:08.100-08:00] - INFO  - c.t.s.s.a.Dequeuer -  - [1165390e-68a2-4e4e-aa95-387cbbd4d3f1] [e2d288adc8e27fa987fd1fc5ddb63ece] New build request: {"manifestSid":null,"deploymentSid":null,"retry_attempts":0,"build_sid":"ZBdbf5e94036b21ae40c52f836b721110d","account_sid":"AC42667b466a342f0604c3b1072bb8d25b","request_sid":"RQd59796df3d62ed0abbf3381189983194","service_sid":"ZS3047dabd47c45aa5d2348e5600a4d872","packager_account_sid":"AC7d36f8dd1a7a706a8474eebd39c98324","packager_service_sid":"ZS42353afe0e5e75955044b93356add049","packager_domain_name":"packager-node16-v1-5223-227981179943781.dev.twil.io","packaging_method":"SANDBOXED","runtime":"node16","origin_region":"dev-us1"}

Node 14

Successful deployment

➜  test-node16-toolkit twilio serverless:deploy --runtime=node14 --override-existing-project


Deploying functions & assets to the Twilio Runtime

Username	SK6cf05c5a49b4101137f2ad05292d6dc5
Password	HfAO****************************
Service SID	ZS3047dabd47c45aa5d2348e5600a4d872
Environment	dev
Root Directory	/Users/pthirumurthi/Pragad/Twilio/Serverless/Toolkit/test-node16-toolkit
Dependencies	twilio, @twilio/runtime-handler
Env Variables
Runtime		node14

✔ Serverless project successfully deployed

Deployment Details
Domain: test-node16-toolkit-9479-dev.dev.twil.io
Service:
   test-node16-toolkit (ZS3047dabd47c45aa5d2348e5600a4d872)
Environment:
   dev (ZE0962a3d3e42f3111fdfd9139b4c08f98)
Build SID:
   ZBe7bb9d073869aacde0e24fce5144d30b
Runtime:
   node14
View Live Logs:
   Open the Twilio Console
Functions:
   [protected] https://test-node16-toolkit-9479-dev.dev.twil.io/sms/reply
   https://test-node16-toolkit-9479-dev.dev.twil.io/hello-world
   https://test-node16-toolkit-9479-dev.dev.twil.io/private-message
Assets:
   [private] Runtime.getAssets()['/message.js']
   https://test-node16-toolkit-9479-dev.dev.twil.io/index.html
   https://test-node16-toolkit-9479-dev.dev.twil.io/style.css

Packager logs

[2022-11-08T17:07:52.244-08:00] - INFO  - c.t.s.s.a.Dequeuer -  - [cb498138-d353-4b3f-8491-d20d9f8646dc] [1c4bd34218138f091a89d572c2621a19] New build request: {"manifestSid":null,"deploymentSid":null,"retry_attempts":0,"build_sid":"ZBe7bb9d073869aacde0e24fce5144d30b","account_sid":"AC42667b466a342f0604c3b1072bb8d25b","request_sid":"RQc0a159b3fd061db93760517d3458891e","service_sid":"ZS3047dabd47c45aa5d2348e5600a4d872","packager_account_sid":"AC7d36f8dd1a7a706a8474eebd39c98324","packager_service_sid":"ZS88b3d4637d36ef3fff7d35ee0f3c7547","packager_domain_name":"packager-node14-v1-8663-295131147494397.dev.twil.io","packaging_method":"SANDBOXED","runtime":"node14","origin_region":"dev-us1"}

Contributing to Twilio

All third-party contributors acknowledge that any contributions they provide will be made under the same open-source license that the open-source project is provided under.

  • I acknowledge that all my contributions will be made under the project's license.

@pthirumurthi pthirumurthi requested a review from a team November 14, 2022 17:56
@pthirumurthi pthirumurthi requested a review from dkundel November 15, 2022 14:57
@dkundel dkundel merged commit b95f16b into main Nov 21, 2022
@welcome
Copy link

welcome bot commented Nov 21, 2022

Congratulations on your first contribution to the Serverless Toolkit!
If you are on the look out for more ways to contribute to open-source, check out a list of some of our repositories at https://github.com/twilio/opensource.
If you want to stay up-to-date with Twilio's OSS activities, subscribe here: https://twil.io/oss-updates
And if you love Twilio as much as we do, make sure to check out our Twilio Champions program!

@pthirumurthi pthirumurthi deleted the RUN-4876-Serverless-Node16 branch November 21, 2022 19:54
@github-actions github-actions bot mentioned this pull request Dec 7, 2023
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

Successfully merging this pull request may close these issues.

4 participants