Comments (10)
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.
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.
@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.
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.
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.
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.
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.
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.
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.
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)
- SSR React with import 'style.scss' dosnt work HOT 2
- process.env always empty HOT 2
- Target class [] does not exist. BindingResolutionException HOT 1
- It is not working HOT 1
- Svelte - TypeError : cannot set property '.svelte' of undefined at registerExtension. HOT 1
- How to catch errors in vue render HOT 1
- PHP 8 Support HOT 1
- error when using Style section
- Question about webcomponents
- vue3 support HOT 1
- Can rollback to support for Laravel 5.5 ~ 5.8? HOT 1
- html parameter of renderVueComponentToString is an empty string HOT 5
- nuxtjs SSR HOT 1
- nextjs SSR HOT 1
- self is not defined HOT 3
- Cannot find element: #app HOT 1
- document is not defined HOT 1
- Spatie-Laravel Server Side working absolutely fine over localhost but when I uploaded it to the server it shows ssr() is undefined Please help how to solve it? HOT 3
- Laravel SSR: ReferenceError: window is not defined HOT 1
- Use spatie/laravel-server-side-rendering for rendering blade and its js. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-server-side-rendering.