Skip to content

Server-Side Rendering with PHP V8Js (without node.js) #4101

@lerouxju

Description

@lerouxju

Feature description

PHP V8Js allows to execute JS server side. It is some sort of alternative to node.js.

Currently it is not possible to execute Vue.js this way. It complains that "setTimeout" & "document" are not defined.

As Vue.js is running fine server side with node.js it should be possible to run it with PHP V8Js.

Code sample

`<?php

$vueSource = file_get_contents('https://cdnjs.cloudflare.com/ajax/libs/vue/2.0.3/vue.js');
$v8 = new V8Js();
$result = $v8->executeString($vueSource);
?>`

Result

V8Js::executeString():5628: ReferenceError: document is not defined"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions