kunkun used a lot of design patterns to achieve all kinds of features. In each note I will go into more details with sample code.

  • Plugin: Load Extensions
  • Abstract Factory: Provide an extension template for extensions to implement, make sure they follow an interface
  • Builder: Build a dynamic valibot validation schema from a JS object sent from extension for form validation
  • Proxy: Use JS proxy to build a fully type-safe RPC called kkrpc
  • Facade: Build kkrpc and kunkun’s main extension API package @kksh/api
  • Command: Build Template UI extension render engine.