Giter VIP home page Giter VIP logo

hapi-cache-buster's People

Contributors

poeticninja avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

noahcollins

hapi-cache-buster's Issues

Cannot read property 'version' of undefined

Sometimes Iโ€™m getting this error:

TypeError: Uncaught error: Cannot read property 'version' of undefined
    at /Users/me/project/node_modules/hapi-cache-buster/index.js:24:53

context is undefined in that case.

Custom cache version cannot be a number

Because lodash's isEmpty returns true for numbers (as they don't have a length property) if you pass a number as the options it will use the package version instead. Right now options must be a string. That's fine, except the documentation uses the word number. This should either:

  • Change docs to clarify a string, or...
  • Allow numbers.

Thanks for the plugin, Saul.

Hapi v17 Support

Overview

If you are not aware yet, Hapi v17 is making the transition from callbacks to async/await, as well as deprecating some other rarely used functionality. This is a breaking change that may make your plugin no longer compatible with the Hapi API.

Changelog

Draft release notes can be found here: hapijs/hapi#3658

Target Release

The target release date for v17 is the beginning of November.

Tasks

  • Reply to this to acknowledge that you are actively maintaining this module and are willing to update it
  • Update plugin to be fully async/await compatible using the v17 branch from Hapi for testing

    Possible dev flow for updating

    • Clone Hapi
    • npm link within the Hapi repo
    • npm link hapi within your plugin repo
    • Your plugin will now be using v17 of Hapi branch for tests
  • Release new major version of your plugin on npm. Please use a major version increment as this will be a breaking change and it would be terrible for it to sneak into current versions of Hapi.

Notes

  • Support is being dropped for all versions of Node <8.0.0.
  • Hapi v16 will continue to be supported for as long as there exists a Node LTS actively being supported that is not compatible with v17.
  • Targeted release date is November 1st, 2017. Please try to have your plugin updated before then.
  • This issue is being opened because your plugin is listed on the official hapi website

onPreResponse

server.ext('onPreResponse', (req, res) => {
    if(req.response.isBoom){
        const err = req.response;
        const errName = err.output.payload.error;
        const statusCode = err.output.payload.statusCode;

        res.view('error', {
            title: `${statusCode} ${errName}`,
            env: process.env.NODE_ENV,
            err: err,
            errName: errName,
            statusCode: statusCode
        }).code(statusCode);
    }
    else {
        res.continue();
    }
});

In this case the version.cache is undefined. Is it possible to pass the version.cache from hapi-cache-buster to the onPreResponse "event"?

Issue with Global Installation

I downloaded your 'https://github.com/poeticninja/hapi-ninja' and started installing required backages & tried to run the app but it was failing.

It gives me,

D:\Projects\NodeExamples\HapiEx1>node server
module.js:333
throw err;
^
Error: Cannot find module 'c:\Users----\AppData\Roaming\npm/package.jso
n'
at Function.Module._resolveFilename (module.js:331:15)
at Function.Module._load (module.js:273:25)
at Module.require (module.js:357:17)
at require (module.js:373:17)
at exports.register (C:\Users----\AppData\Roaming\npm\node_modules
hapi-cache-buster\index.js:8:36)
at internals.Pack._plugin (C:\Users-----------\AppData\Roaming\npm\node_mo
dules\hapi\lib\pack.js:447:21)
at C:\Users-----------\AppData\Roaming\npm\node_modules\hapi\lib\pack.js:2
60:14
at iterate (C:\Users-------------\AppData\Roaming\npm\node_modules\hapi\node
_modules\items\lib\index.js:35:13)
at done (C:\Users-------------\AppData\Roaming\npm\node_modules\hapi\node_mo
dules\items\lib\index.js:27:25)
at exports.register (C:\Users---------\AppData\Roaming\npm\node_modules
hapi-named-routes\index.js:53:12)

But when i tried to install the hapi-cache-buster locally, the app was successfully launched.

Issue with Global Installation

I downloaded your 'https://github.com/poeticninja/hapi-ninja' and started installing required backages & tried to run the app but it was failing.

It gives me,

D:\Projects\NodeExamples\HapiEx1>node server
module.js:333
throw err;
^
Error: Cannot find module 'c:\Users----\AppData\Roaming\npm/package.jso
n'
at Function.Module._resolveFilename (module.js:331:15)
at Function.Module._load (module.js:273:25)
at Module.require (module.js:357:17)
at require (module.js:373:17)
at exports.register (C:\Users----\AppData\Roaming\npm\node_modules
hapi-cache-buster\index.js:8:36)
at internals.Pack._plugin (C:\Users-----------\AppData\Roaming\npm\node_mo
dules\hapi\lib\pack.js:447:21)
at C:\Users-----------\AppData\Roaming\npm\node_modules\hapi\lib\pack.js:2
60:14
at iterate (C:\Users-------------\AppData\Roaming\npm\node_modules\hapi\node
_modules\items\lib\index.js:35:13)
at done (C:\Users-------------\AppData\Roaming\npm\node_modules\hapi\node_mo
dules\items\lib\index.js:27:25)
at exports.register (C:\Users---------\AppData\Roaming\npm\node_modules
hapi-named-routes\index.js:53:12)

But when i tried to install the hapi-cache-buster locally, the app was successfully launched.

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.