Skip to content
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

Split package to parser and parser-api packages #267

Closed
magicmatatjahu opened this issue Mar 29, 2021 · 10 comments
Closed

Split package to parser and parser-api packages #267

magicmatatjahu opened this issue Mar 29, 2021 · 10 comments
Labels
enhancement New feature or request

Comments

@magicmatatjahu
Copy link
Member

magicmatatjahu commented Mar 29, 2021

At the moment parser in source code has two main parts: validation/parsing and corresponding models which share the API for parsed schema: AsyncAPIDocument, Schema, Operation etc models.

My suggestion is split package to two separate ones:

  • @asyncapi/parser-api or @asyncapi/parser-models - package only with models (and with API),
  • @asyncapi/parser - package for validation and parsing which will use above package with API.

Why this is needed?

  • you can parse schema in server-side and send parsed schema to front-end part and use API by @asyncapi/parser-api package - you don't need include dependencies for parser in both sides, in server and client side. For client side this is very important, the smaller the application the better - example: [DRAFT] feat: integrate react-component studio#17 and feat: switch to react-component html-template#166
  • if we go with another parser like for go language, we can reuse API from this parser like in above situation - parse by go schema and send to front-end app, so we can have few parsers but only one API for JS apps :)
  • we can significantly slim down our React component - now, after bundling, 90% of the code is a code related to parser and its dependencies. Of course in some situation user must use parser to use React component (when doesn't have a server for parsing), but we can allow passing parser instance as prop to React component and component will be independent to parser, not like currently.

As we can see I only have problems related to front-end apps, but maybe someone has another use cases. Feel free to comment!

Related issue:
Stringify parsed schema - #266

@magicmatatjahu magicmatatjahu added the enhancement New feature or request label Mar 29, 2021
@magicmatatjahu magicmatatjahu changed the title Split package to parser and parser-models packages Split package to parser and parser-api packages Mar 29, 2021
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 60 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation.
Thank you for your contributions ❤️

@github-actions github-actions bot added the stale label May 29, 2021
@magicmatatjahu
Copy link
Member Author

We split the models domain so that webpack can treeshakable module, but an issue is still opened for the second variant - using the package for other parsers.

@github-actions
Copy link

github-actions bot commented Aug 7, 2021

This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 60 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation.
Thank you for your contributions ❤️

@magicmatatjahu
Copy link
Member Author

We can also rewrite package to the ESM to be full treeshakable.

@github-actions
Copy link

github-actions bot commented Dec 8, 2021

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 ❤️

@github-actions github-actions bot added the stale label Dec 8, 2021
@derberg
Copy link
Member

derberg commented Dec 13, 2021

@magicmatatjahu is it still valid?

@github-actions github-actions bot removed the stale label Dec 14, 2021
@github-actions
Copy link

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 ❤️

@github-actions github-actions bot added the stale label Apr 14, 2022
@derberg derberg removed the stale label Apr 20, 2022
@derberg
Copy link
Member

derberg commented Apr 20, 2022

ping pong @magicmatatjahu 😄

@github-actions
Copy link

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 ❤️

@github-actions github-actions bot added stale and removed stale labels Aug 19, 2022
@magicmatatjahu
Copy link
Member Author

We introduced needed changes by splitting models and model-helpers to separate CJS modules to enable tree-shaking. I am closing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants