GithubHelp home page GithubHelp logo

Comments (7)

muratgozel avatar muratgozel commented on June 2, 2024 1

Do you call .dump() in browser environment? I'm just trying to find the most sensible solution. The .dump() is for server side rendering and we may actually could just do:

    dump(): string {
        if (this.isDomAvailable) return ''

        const data = this.memory.join('\n')

        return data
    }

from metapatcher.

indifferentghost avatar indifferentghost commented on June 2, 2024

Current workaround is using memory directly: metapatcher.memory.join('\n').

from metapatcher.

muratgozel avatar muratgozel commented on June 2, 2024

There should certainly be a check for dom while calling dump. Thank you for the PR @indifferentghost I will merge it shortly.

from metapatcher.

muratgozel avatar muratgozel commented on June 2, 2024

@indifferentghost I understand you use .dump() server-side as it should be but what problem do you have with its clearing cache? Server renders happen once per request and so it just dumps once and clears itself. Can you elaborate the problem here?

The way i use it is simply:

import.meta.env.SSR ? metapatcher.dump() : ''

from metapatcher.

indifferentghost avatar indifferentghost commented on June 2, 2024

Hey, I'm using it as middleware for keeping head state across endpoints, many of these use the same head, but a few of them are different. It's useful for me to keep state rather than a finished dump.

from metapatcher.

indifferentghost avatar indifferentghost commented on June 2, 2024

I don't see why it shouldn't though. I don't, nor do I foresee using it in the browser.

from metapatcher.

muratgozel avatar muratgozel commented on June 2, 2024

It's just because it's meant to be used in server side, i mean the dump method. we are able to use html dom like a memory in browsers so i would like to keep it as much as possible. anyway, i released the new version, it should be fixed now. thank you for the collaboration @indifferentghost

from metapatcher.

Related Issues (3)

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.