Giter Club home page Giter Club logo

simple-cloudbase's Introduction

simple-cloudbase

微信云开发的收费模式,即将迎来调整,添加了最低月费和按DAU收费,这背离了 serverless 的初衷

2022年7月4日,微信云开发计费调整公告,涨幅高达50倍!!还能给个人开发者使用吗?

这是一个为微信云开发定制的框架,结合 @cloudbase/cli使用来完成云函数的工程化

文档在此

前言

微信云开发中的云函数,能获取微信的上下文以及 调用 openapi的能力,这些都是它独有的优势。(相比原生的 SCF)

但是官方提供的解决方案,无论是 微信IDE,还是 Cloudbase ,开发体验都欠佳。

这个框架,就是把 Cloudbase 作为一个辅助的 CLI 部署工具,再结合这套框架进行部署,来改善微信云开发的体验。

目的

改善微信云开发的开发体验,在提升 Serverless 冷启动的同时,让工程化更加简单!

TODO LIST:

  • cloudbaserc.json 自动生成
  • 云函数自动打包 , Tree shaking , 压缩
  • 特殊情况处理, (excludeexternal) 的情况
  • Commonjs, ESM, TS 支持
  • 公共包逻辑复用
  • [] 本地调试
  • [] 部署到服务器环境(非Serverless)

部署及调试

直接使用 CloudBase CLI 作为部署工具

alias 支持

直接在项目根目录下添加 tsconfig.json or jsconfig.json

然后在里面添加

  "compilerOptions": {
    //...
    "baseUrl": ".",
    "paths": {
      "~/*": ["./src/*"]
      //...
    }
    //...
  },

这样在打包时,既可以使用alias,也可以顺便添加 vscode 智能提示,可谓是一举两得。

simple.json

这个是这套工具链的配置文件,在根目录(root)里的,控制所有的函数,在函数里的,控制这个函数的配置。

在多云函数部署时,每个云函数,可以看做是一个独立的 Nodejs 项目

原理

抛砖引玉:一种改善微信云开发 , 开发者体验的思路

抛砖引玉(2): Cloudbase Framework 助力改善微信云开发的体验

抛砖引玉(3): 微信云开发最佳实践

serverless 降低冷启动时间的探索 - 服务端打包 node_modules

非微信环境

个人使用的是 serverless framework

有关 serverless 的问题, 感兴趣可以关注我的知乎

simple-cloudbase's People

Contributors

sonofmagic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

yogjun

simple-cloudbase's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.