GithubHelp home page GithubHelp logo

Comments (10)

benferns avatar benferns commented on May 19, 2024 2

I'm working on something completely unrelated that also needs Node in Vapor, but I thought my research might be of interest: With Vapor the original runtime is PHP, so you would need to include a compiled node binary as a custom runtime.

Luckily LambCI have one here: https://github.com/lambci/node-custom-lambda. You can add it as a 'layer' so you don't need to ship it with the function code (otherwise you hit the 25MB limit very fast - tbh with node_modules it will be hard to stay under the 250MB overall limit!). You can see an example of adding layers to the vapor.yml file at the bottom here: https://github.com/laravel/vapor-php-build/issues/3#issuecomment-541922252

My project is still in the planning phase, so I can't confirm this all works yet, but thats the theory!

from laravel-server-side-rendering.

BurningDog avatar BurningDog commented on May 19, 2024 1

From the README: The server-side-rendering library ships with V8 and Node engines. Looks like setting the path in .env to the node binary will work. Going through the docker file from https://github.com/laravel/vapor-php-build/ it doesn't look like v8js is included in the php build.

I'm hoping to deploy a new project to Vapor something in the next month; will test SSR then.

from laravel-server-side-rendering.

connecteev avatar connecteev commented on May 19, 2024

@jcsoriano I have the same question.

Also one for you, since SSR on PHP is "unchartered territory" as the README says.
I am curious how you use this laravel-server-side-rendering package for SSR on your production setup. Does it work as well as Nuxt.js on production? Is it quick to load? Is it stable?
Any "gotchas" involved in using this package for SSR that we need to be aware of? Pros and cons of using this package versus Nuxt or Node?
Also, links to examples where this is working well for you would be helpful as well....depending on how much help you'd like to provide here. It's all useful and appreciated.

from laravel-server-side-rendering.

timrspratt avatar timrspratt commented on May 19, 2024

SSR with PHP and Vapor is something we're keen to get an answer for but we'd need to know more about the PHP build Vapor uses. If V8 is included then SSR should be possible, by changing the engine to V8js. If not, then I'm not sure yet how PHP can access Node. Somebody with more of an understanding of Lambda and getting PHP to run on it may know.

from laravel-server-side-rendering.

spatie-bot avatar spatie-bot commented on May 19, 2024

Dear contributor,

because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.

from laravel-server-side-rendering.

jcsoriano avatar jcsoriano commented on May 19, 2024

I see that this might be the container that Vapor uses: https://github.com/laravel/vapor-php-build/

Anyone knowledgeable with Docker / Lambda / Vapor know if this package will work with this container?

from laravel-server-side-rendering.

jcsoriano avatar jcsoriano commented on May 19, 2024

I checked the files in https://github.com/laravel/vapor-php-build/ and if I'm not mistaken node isn't included there either, but looking forward to know how your testing goes with Vapor + SSR next month

from laravel-server-side-rendering.

timrspratt avatar timrspratt commented on May 19, 2024

Thanks @jcsoriano that is correct, I'd be interested to know the outcome if you get it to work with the lambda node.

from laravel-server-side-rendering.

BurningDog avatar BurningDog commented on May 19, 2024

Node won't be in the vapor-php-build but is around somewhere because npm run prod needs to run in order to create the javascript and css files.

from laravel-server-side-rendering.

jcsoriano avatar jcsoriano commented on May 19, 2024

I've tried Vapor on a non-SSR project, and the build process (npm run prod etc) happens where you run vapor deploy from. So if you run it in your local or CI, it'll build there and only deploy the compiled files, as opposed to building it inside the Lambda container

from laravel-server-side-rendering.

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.