vike icon indicating copy to clipboard operation
vike copied to clipboard

Extensions

Open brillout opened this issue 3 years ago • 3 comments

Description

Idea: be able to extend your app functionalities by simply installing npm packages:

// vite.config.js

import ssr from 'vite-plugin-ssr/plugin'
import renderer from 'vps-renderer-react'
// import renderer from 'vps-renderer-vue'
import sitemap from 'vps-sitemap'

export default {
  ssr({
    extensions: [renderer(), sitemap()]
  })
}

Means: all you have left to do is write your .page.js files.

Calling it extensions and not plugins because all renderer() and sitemap() does is to provide .page.js files.

If you know vps, then you know how to write extensions and how to debug extensions. You can easily fork extensions to your likings. (Whereas plugins usually use another set of APIs than what the end-user uses.)

brillout avatar Jul 01 '22 12:07 brillout

CC @aleclarson who is quite interested in that space.

brillout avatar Jul 01 '22 12:07 brillout

I have a very similar idea for Rakkas (and HatTip) but my plan was to make Rakkas plugins plain Vite plugins with some extra keys for Rakkas specific features. This would make things like (hypothetical) @rakkasjs/plugin-telefunc easier to use.

cyco130 avatar Jul 02 '22 15:07 cyco130

Related: https://github.com/brillout/research/issues/4.

brillout avatar Jul 02 '22 20:07 brillout

Done https://vite-plugin-ssr.com/extends.

brillout avatar May 31 '23 20:05 brillout