Feature Proposal: Conversational Components
In the last couple of weeks, I’ve experimented a lot with AWS serverless and with the serverless framework. I really love this approach and I would like to bring it to Jovo.
In my mind, I would like to create something that reduces the final bundle size (at the moment is more than 17mb with my project) and automates the deployment with serverless (Jovo CLI is doing a good thing but it’s not enough).
I’ve created a GitHub repo to test it out: https://github.com/StErMi/jovo-serverless-webpack/blob/master/serverless.yml
Option 1: serverless-bundle
One option would be to use serverless-bundle (look at the beta tree, they are adding the support to typescript). This serverless plugin is an extension of the serverless-webpack plugin. It bundles your Node.js Lambda functions with sensible defaults so you don’t have to maintain your own Webpack configs.
I still need to figure out why the output build is not working correctly. All the deployment process works like a charm, so as soon as we fixed it’s ready for production.
Option 2: ncc
I still need to finish the final pipeline to deploy the code to the lambda.
Problems and TODO
serverless-bundle VS ncc
I’m not an expert on those tools so I don’t know which one has a better-optimized code in the final bundle. We should evaluate all the options but to be honest I would like to use something that is more deeply into the serverless framework pipeline. Or we could just create a serverless-ncc plugin to solve the issue if we think that we should use ncc.
One common problem is how Jovo handles env config. They require the configuration to be at the same level of the index. It’s a problem because webpack/ncc uses tree shaking and they are not transpiling and packaging those files because they are not required anywhere.
I would like to allow the current Jovo Web debugger to run on the compiled code.
Add support to DynamoDB in the serverless build
This is not a huge issue, I just need time to add it to the configuration