GithubHelp home page GithubHelp logo

New api version about addon-list HOT 11 CLOSED

webthingsio avatar webthingsio commented on August 15, 2024
New api version

from addon-list.

Comments (11)

mrstegeman avatar mrstegeman commented on August 15, 2024

Nope. We haven’t broken compatibility with any existing add-ons, just added new APIs. You can feature detect the new APIs at runtime.

from addon-list.

tim-hellhake avatar tim-hellhake commented on August 15, 2024

But name was replaced by title.
Will the gateway still work if an addon sends name?
What would be a breaking change then?

Is there an api which indicates which features are available?
Wouldn't make it make sense to filter out addons which use features which are not available in the current gateway version?

from addon-list.

mrstegeman avatar mrstegeman commented on August 15, 2024

I kept backwards compatibility in place for the title change, so that didn’t break. A breaking change would be something that would cause existing add-one to no longer function.

You can use a try/catch require for the new modules, that’s what I’ve done in other places.

from addon-list.

tim-hellhake avatar tim-hellhake commented on August 15, 2024

You can use a try/catch require for the new modules, that’s what I’ve done in other places.

Sounds a bit messy.
Nobody would expect imports to fail.

from addon-list.

mrstegeman avatar mrstegeman commented on August 15, 2024

For new add-ons, they won’t fail, given that authors will be starting with 0.9.

For existing add-ons, the authors should expect them to fail on pre-0.9, given that those APIs were not available when they created the add-on.

from addon-list.

tim-hellhake avatar tim-hellhake commented on August 15, 2024

But why not simply increase the version number?
You could immediately update all max versions to 3.
The addons which use the new features can increase the min version to 3.
That's much cleaner and simpler than adding extra code for every new feature.

from addon-list.

mrstegeman avatar mrstegeman commented on August 15, 2024

We really try not to bump the API version because every single add-on would need to be updated in order to run on the new gateway version. The gateway simply will not load an add-on if support for that API version is not declared.

Would it help to provide a method in the gateway-addon packages that at least tells you the current API and package versions, and maybe even the gateway version?

from addon-list.

tim-hellhake avatar tim-hellhake commented on August 15, 2024

We really try not to bump the API version because every single add-on would need to be updated in order to run on the new gateway version.

Damn, I forgot that the API version is also present in the package.json.

It looks like the current concept of the API version is broken.
It's hard to update the API version now, and it gets even harder the more users and addons you get.
At some point, the impact will be huge.
What's a versioning worth that you can't use?

I see three options:

  • Pay the price once and get rid of the max versions in all addons before it's too late. If someone really needs an upper bound, he can set it in an update.
  • Deprecate min/max versions and add a new property for the api version. I could also imagine a since property, which specifies the minimal version of the gateway you need.
  • Freeze the current addon list and create a new one for future gateway versions.

What do you think?
If I can be of any help, please tell me.

from addon-list.

mrstegeman avatar mrstegeman commented on August 15, 2024

We're getting ready to rework the add-ons system quite a bit, since we're now adding different types of add-ons (notifiers, extensions (soon), services (soon)), and with that, we'll be bringing in a new manifest format based on the manifest.json format from WebExtensions. That would be a great opportunity to rework all of this.

We'll be asking for feedback through that process, so please weigh in once we start!

from addon-list.

tim-hellhake avatar tim-hellhake commented on August 15, 2024

That sounds even better!

from addon-list.

mrstegeman avatar mrstegeman commented on August 15, 2024

This should help a tiny bit: WebThingsIO/gateway-addon-node#43

from addon-list.

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.