Open anzalabidi opened 3 months ago
iso := v8.NewIsolate() defer iso.Dispose() if iso == nil { log.Fatal("Failed to create V8 isolate") } v8Ctx := v8.NewContext(iso) defer v8Ctx.Close() _, err = v8Ctx.RunScript(backendBundle, "bundle.js") if err != nil { log.Fatalf("Failed to evaluate bundled script: %v", err) } val, err := v8Ctx.RunScript(fmt.Sprintf("renderApp(%s)", string(propsJSON)), "render.js") if err != nil { log.Fatalf("Failed to render React component: %v", err) }
Need to make this usable via context pool.
Need to make this usable via context pool.