Comments (6)
Quick follow up... It seems that I misconfigured the project... I was hoping to provide a full static (target: 'static'
) page for initial load, however, the build is serving an SPA...
According to NuxtJS Docs, the ssr
config flag prepares the project to be either rendered by a server or by the client entirely.
- If set to
false
(current value), the project will be configured to render entirely by the client as a SPA, ignoring thetarget: 'static'
configuration if not enforced by a plugin (Like a markdown renderer or something). - If set to
true
(going to set this), the project will be configured to render by a server.- If
ssr: true
andtarget: 'static'
, then the project will be completely rendered at build time, publishing pure HTML and CSS for static content, and injecting payload for dynamic content (smart!) - If
ssr: true
andtarget: 'server'
, then the project will be published as a runtime to execute using NodeJS on a server and render each page on the server whenever a request is received.
- If
So, we are already expecting target: 'static'
, now the thing is to configure ssr: true
and expect full static payloads 🎉.
from uanl-repo-search.
Sadly this is expected behavior at the moment.
Each time you load, reload or update the search parameters, one request is sent to GitHub’s API.
The best we could do is to only spend 1 request to fetch the repository list on load/reload, but due to the way that stats need to be fetched, we need to spend a second request initially.
I’m looking for a way to “cache” these stats at build time and keep them static for upcoming requests, this way, we could fire an update weekly and have decent update time, however, there’s no easy way ATM for this.
Will keep this open, I’m thinking on making the necessary changes for static first loads when Nuxt v3 is released.
Thanks for the heads up!
from uanl-repo-search.
I was looking for something simple to contribute 😅 , do you have something on your mind?
from uanl-repo-search.
I have some ideas locally. If you’re free tonight we could spin up a simple pair programming session to further discuss what I got in mind.
PS: Here are my thoughts:
- Extract main logic into hooks.
- Make use of Nuxt’s Static helpers to generate data for first load.
- Read static data from components and setup hooks once rendered on client.
from uanl-repo-search.
This week I have tons of pending job, what about next week? 😄
from uanl-repo-search.
Sure thing, I’ll keep trying out, maybe push tonight a new branch with experimental changes
from uanl-repo-search.
Related Issues (2)
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 uanl-repo-search.