Coder Social home page Coder Social logo

Implement caches maps about offline-plugin HOT 11 CLOSED

nekr avatar nekr commented on July 19, 2024 2
Implement caches maps

from offline-plugin.

Comments (11)

NekR avatar NekR commented on July 19, 2024 1

@nodkz so essentially it's just runtime-rewriter-function, right? Yeah, good idea 👍

from offline-plugin.

NekR avatar NekR commented on July 19, 2024 1

Is everyone here okay with this design for cache maps:

#117

Here was a code example, but I actually placed it to separate issue for clarity

/cc @MoOx @developit @KyleAMathews

from offline-plugin.

nodkz avatar nodkz commented on July 19, 2024

Nice feature!
But also will be great to have rewriteThunk in sw.js with your default fetch event in https://github.com/NekR/offline-plugin/blob/master/src/misc/sw-template.js#L241

This is right my case where I want replace custom routes to spa-shell-entry-html:

/job
/job/*
/company/*
...
// BUT NOT
/job/grapth

This can be done only via JS script, not mapper.

from offline-plugin.

nodkz avatar nodkz commented on July 19, 2024

Exactly.

Cause routing operation often is too complex. And maps does not give enough flexibility and fine tuning.

Other use cases using url rewriter:

  • due anon user or authorized
  • due localization setting
  • due time and date
  • due expirity period
  • may be tons other thing

from offline-plugin.

NekR avatar NekR commented on July 19, 2024

I see your point, it's good idea and I think I may do it even before mapping as originally described here.
But I am not 100% sure about it yet. The idea of plugin was to have completely decorative output, but runtime rewrites requires JavaScript, which ins't declarative of course.

With declarative output, we can for example emit JSON file and later feed it to native app/code to handle app's caching.

I'll think about it.

from offline-plugin.

oscar-b avatar oscar-b commented on July 19, 2024

@NekR Any new developments regarding this?

from offline-plugin.

NekR avatar NekR commented on July 19, 2024

The only status about this us that I remember about it. Once there will be updates, they will be written here.

Anyway, thanks for letting me know about your interest. This will help me prioritize.

from offline-plugin.

NekR avatar NekR commented on July 19, 2024

I moved the code example to separate issue for clarity.

from offline-plugin.

NekR avatar NekR commented on July 19, 2024

Done in v4 now :-)

from offline-plugin.

NekR avatar NekR commented on July 19, 2024

Didn't add to readme yet though, going to do that..

from offline-plugin.

NekR avatar NekR commented on July 19, 2024

Wrote some docs: https://github.com/NekR/offline-plugin/blob/master/docs/cache-maps.md

from offline-plugin.

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.