Giter VIP home page Giter VIP logo

Comments (6)

iksaku avatar iksaku commented on June 24, 2024 1

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 the target: '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 and target: '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 and target: '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.

So, we are already expecting target: 'static', now the thing is to configure ssr: true and expect full static payloads 🎉.

from uanl-repo-search.

iksaku avatar iksaku commented on June 24, 2024

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.

pepetorres1998 avatar pepetorres1998 commented on June 24, 2024

I was looking for something simple to contribute 😅 , do you have something on your mind?

from uanl-repo-search.

iksaku avatar iksaku commented on June 24, 2024

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.

pepetorres1998 avatar pepetorres1998 commented on June 24, 2024

This week I have tons of pending job, what about next week? 😄

from uanl-repo-search.

iksaku avatar iksaku commented on June 24, 2024

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 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.