-
-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to solve tooling requirements for giving support to multiple parser-api versions #848
Comments
I see solution 4 is the most simplest and less invasive. In my opinion, solving that particular case of those tools should not affect the normal developer experience in the Parser-JS repository, nor producing side-effects like increasing the size of the installed package, etc. By having that isolated new package, those tools plus any other that could came up from other users will be able to easily instantiate a parser that produces a compatible version of the parsed AsyncAPI object. I expect those cases to be a minority or close to none. Regarding backporting critical bugfixes to previous versions, I suggest we use the compatibility matrix we have in the README.md file and either we add another column mentioning if that version is fully supported in terms of critical bufixes or not. In that way, we can help/force users to eventually update if they want to keep their tools to be up-to-date. |
I created a first version of that library I mentioned https://github.com/smoya/multi-parser-js |
My two centsBy looking at Generator releases, we can see that Generator hasn't gotten any new features recently. Actually, only 2 in the last year. And they were related to bumping dependencies and supporting a new spec version. A similar thing happens when it comes to bug fixes. Most of the patch versions are just dependency bumps. I'd say Generator is pretty stable. So I'd love you to consider the following option:
We move the maintenance burden to Generator, CLI, Server API, and Studio. The impact of the changes will be reduced since Parser is a dependency of all the tools. Another more radical approach would be to completely remove support for the old Parser API in Generator. We migrate all our templates and see who else complains. I've never seen anyone maintaining their own custom templates. They exist for sure but they may not be as many to justify so much complexity and flexibility. We offer them a good migration guide or they can stay with the older version. Since we don't have the data of how many users are going to be impacted, one way is to let them complain and then rollback to the previous plan, which wouldn't be a breaking change since it would be just a matter of supporting one more Parser API version (the old one). Anyway, just wanted you to consider this alternative. I'm fine with anything you folks decide 👍 |
1st version has been published to NPM: https://www.npmjs.com/package/@smoya/multi-parser |
First attempt to add
Today, knowing we will most certainly not release any 2.x spec minor but jump to 3.x:
so yeah 😄 I'm ok to drop |
one last thing regarding |
This issue has been automatically marked as stale because it has not had recent activity 😴 It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation. There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model. Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here. Thank you for your patience ❤️ |
I believe most of the use cases of this library are projects that need to parse their own AsyncAPI documents and extract info from them. The purpose doesn't matter for the topic we discuss here. Those, will use a particular version (if not latest) of the Parser-JS and, thanks to the [Parser-API](https://github.com/asyncapi/parser-api/), the API will be very stable between major versions of the spec.
However, there is a limited set of use cases where there is the need of parsing an AsyncAPI document and get a parsed object that contains a particular set of models and methods based on a given parser-api version. Examples are the [Generator](https://github.com/asyncapi/generator), and [Modelina](https://github.com/asyncapi/modelina).
In the case of the Generator, it requires an specific version of the parsed AsyncAPI object based on the parser-api version compatible with each template (specified in each template), otherwise the template could crash using methods that does not exist in that object.
That introduces the need for implementing a strategy pattern that, based on the found parser-api config on the template, to parse the document with one version of the Parser-JS or another (depending on which version supports that particular parser-api, which is defined in the compatibility matrix found in the README.md). That means the generator needs to install and manage several versions of the
@asyncapi/parser
package, among other stuff, to make that happen.This problem was raised to me few days ago by @jonas Lagoni in a private and informal chat and today we discussed about it in a more formal way so we could reach an idea of what are the alternatives or better approaches for handling that. We have come with the following strategies/alternatives so we can pick up one (or find a new one):
@asyncapi/parser
package.@asyncapi/parser
package per major parser-api version supported + one with support for all of them (like in previous point).@asyncapi/parser
package or several.@asyncapi/parser
package per major parser-api version supported as normal release cycle.@asyncapi/parser
cc @jonaslagoni @fmvilas @magicmatatjahu @derberg
The text was updated successfully, but these errors were encountered: