svelte-go-only

command module
v0.0.0-...-e7160de Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2022 License: GPL-3.0 Imports: 23 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

svelte-go-only

Experiment with SvelteJS and Golang (with grpc-web)

In this project I just want to learn how to use svelte.js / sveltekit and grpc-web using golang.

In this project I experiment a bit with embed also to make an executable that is self-contained (including html/css/js files).

This is heavily inspired by this demo: https://github.com/agrism/grpc-web-svelte

This project consists in a simple seltejs/sveltekit application (client side) that will communicate with the golang web server (server side) using gRPC, it builds a single self-contained executable.

Requirements

To build this project the below software has to be installed:

  • protoc (3.20.1), this package include:
    • protoc-gen-go (generate go files for types from proto files)
    • protoc-gen-js (generate js files for types from proto files)
  • protoc-gen-go-grpc (generate go files for services from proto files), install it with go install google.golang.org/grpc/cmd/protoc-gen-go-grpc
  • protoc-gen-ts (generate js files for service from proto files), install it with npm -g i @safanaj/ts-protoc-gen
  • sponge, utility used in the Makefile
Notes

The output of protoc-gen-js plugin is not ready for es6, so sveltekit and vitejs are not working to generate client-side JS code, for that reason a simple pythong script is provided to consistently "patch" the js files generated by protoc-gen-js.

Build and run

make build
./svelte-go-only

or

make start

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址