Giter VIP home page Giter VIP logo

Comments (6)

mbenedettini avatar mbenedettini commented on July 19, 2024 4

For those running into this issue, introduced in agenda v2 agenda/agenda@b9ecca9#diff-d24f116ac5cf860dd12424930aaffc40, work around is to stay in agenda v1.0.3

from agendash.

jskrzypek avatar jskrzypek commented on July 19, 2024 1

So I'm not that guy who just says "oh that's trivial" and walks away, I see two possibilities that could be straightforward for doing the version checking:

The first option that's not as easy would be to make a PR to agenda itself to add a version number to the exported package, then get them to release that. (this might be better in the long run but it has other complications).

The other way that could be implemented wholly within agendash is to make the dependency on agenda a peer dependency. Then the app could detect the installed version by doing this:

const semver = require('semver');
const agendaVersion = require('agenda/package.json').version;
const useLegacyAPI = semver.lt(agendaVersion, '2.0.0');
...

If we add a parsed option to /app.js where we pass the version to override the version we get from check agenda/package.json, then we can split the tests into two versions as well (or at least two sections), and devDependencies added in the package.json like this:

    "agenda-legacy": ">= 1.0.0 < 2.0.0",
    "agenda": ">= 2.x.x",

That way both the legacy and newer versions of agenda can be supported and have test coverage.

Oh, no, that won't work actually. But we could probably use npx to separate & test the legacy and non-legacy versions.

That was wrong too...

Boy do I feel dumb, this is what the build matrix is for 😂

from agendash.

jskrzypek avatar jskrzypek commented on July 19, 2024

Shouldn't this be a relatively easy fix? I'll be happy to submit a PR.

There's possibly a concern with backwards compatibility for projects sticking with agenda v1.0.3, but if that's an issue and the idea of doing that round a major version bump doesn't appeal to the maintainers, then checking the installed version of agenda and selecting which api to use shouldn't require too much coding.

from agendash.

jskrzypek avatar jskrzypek commented on July 19, 2024

Oh, now I see #72 ... so is the idea to move to consuming agenda-rest instead of the code in /lib/agendash.js & /lib/middleware?

from agendash.

jsardev avatar jsardev commented on July 19, 2024

Having the same issue. Unfortunately I don't have time right now to take a look at this 😢

from agendash.

koresar avatar koresar commented on July 19, 2024

This should be fixed in Agendash v2. Please try and report back if it's not working.
Closing this issue as stale.

from agendash.

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.