Coder Social home page Coder Social logo

Comments (7)

tooolbox avatar tooolbox commented on July 4, 2024 1

Lots of interesting data here: plentico/plenti#3

And follow-up here: plentico/plenti#169

Looks like Matthew Mueller wound up using v8 for Bud though: https://github.com/livebud/bud/tree/de977798451d9b3f84695254a84377581a653286/package/svelte

from algernon.

diyism avatar diyism commented on July 4, 2024

@tooolbox yes, the plenti(v8go) performance is very close to the nodejs:
Screenshot 2022-11-15 at 14-20-32 Remove nodejs dependency ยท Issue #3 ยท plentico_plenti

from algernon.

xyproto avatar xyproto commented on July 4, 2024

Thanks for the feature request!

from algernon.

jimafisk avatar jimafisk commented on July 4, 2024

Hey ๐Ÿ‘‹

Achieving a zero dependency, reactive UI for Go is a problem we're still trying to solve with Plenti. We're currently compiling Svelte in V8 at the moment, and that works, but it's not without blemishes. If you're ever interested in talking through what we've tried, I'd be happy to hop on a call. Thanks!

from algernon.

xyproto avatar xyproto commented on July 4, 2024

@jimafisk Sounds interesting! ๐Ÿ‘ I'm on vacation, but I want to take a look at Plenti when I get back.

from algernon.

diyism avatar diyism commented on July 4, 2024

I found svelte-bun (https://github.com/terrywh/svelte-bun) which realized realtime building of svelte components on dev environment.
The performance of Bun is touted to be twice that of Deno and six times that of Node.
But Bun is not on golang.

from algernon.

diyism avatar diyism commented on July 4, 2024

I've tested svelte-bun with bun, its performance is amazing, the building is realtime.
And I've tried to run svelte-bun with v8go, but I failed.

I packaged the whole svelte-bun project with:
./node_modules/.bin/esbuild ./sbin/server.js --bundle --outfile=out.js --format=esm --platform=node
then run it with test.go:

package main

import (
	"fmt"
	"io/ioutil"

	v8 "rogchap.com/v8go"
)

func main() {
	js, _ := ioutil.ReadFile("./out.js")
	ctx:= v8.NewContext()
	val, err := ctx.RunScript(string(js), "main.js")
	if err != nil {
		fmt.Printf("failed to run JavaScript file: %v\n", err)
		return
	}

	fmt.Println(val)
}

it shows error:
failed to run JavaScript file: SyntaxError: Cannot use import statement outside a module

I guess the corresponding lines are:

import { stat as asyncStat } from "fs/promises";
import { extname, join as join2 } from "path";
import { resolve as resolve2 } from "path";

Maybe an experienced guy can work around it, but I can't.

ref: plentico/plenti#276
ref: terrywh/svelte-bun#2

from algernon.

Related Issues (20)

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.