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

Remove spectral or fix underlying dependencies #857

Open
jonaslagoni opened this issue Sep 4, 2023 · 8 comments
Open

Remove spectral or fix underlying dependencies #857

jonaslagoni opened this issue Sep 4, 2023 · 8 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@jonaslagoni
Copy link
Member

jonaslagoni commented Sep 4, 2023

Reason/Context

There are way too many issues with webpack and jest configuration when we upgrade libraries to use the new parser versions and for dependent libraries to do the same for it to make sense to continue using it IMO. I have spend way to many hours fixing these problems and encountering new edge cases.

What it falls back to are https://github.com/P0lip/nimma (that spectral depend on) that simply don't work out the box with our setups and require workaround in every library that integrate the parser and who ever integrate with those. It's just a continuous requirement to fix it all the time.

That is why I am suggesting that we either pool some resources together to fix the underlying library or remove spectral completely and each user can decide to use it on their own terms.

By removing Spectral we are going to miss out on some convenient validation stuff, but nothing that will mean the library cant function as needed. And the user can still decide to use it on their own term before using the parser, for example in Studio.

And for fixing the underlying library, I simply have no idea how easy it is to achieve especially considering last time nimma was updated was 2 years ago.

Thats why I am more in favor of removing the library entirely for now.

@jonaslagoni jonaslagoni added the enhancement New feature or request label Sep 4, 2023
@char0n
Copy link
Contributor

char0n commented Sep 20, 2023

Hi @jonaslagoni,

I can concur. Took significant time to get around all the spectral issues and integrate https://github.com/asyncapi/parser-js/releases/tag/v3.0.0-next-major-spec.2 into bundles. Eventually managed to get it working but increased the bundle sizes significantly as the entire spectral toolchain now gets bundled.

I was immediately looking for a way how to remove spectral by the bundling process. I just need to parse the AsyncAPI document and pass the parsed document to the asyncapi-react renderer. I don't need any validation at all. Either the parser should parse the document and provide it or fails (with reason).

IMHO integrating the major linting library (that's difficult to bundle) into the parser without opting out from it is not the best situation.

Would it be possible to create a new entry point inside the npm package that would just do the pure parsing without spectral?

@jonaslagoni
Copy link
Member Author

Its a great question @char0n, maybe is the short answer 😅 Problem is its currently tied to reference resolvement as well, so might need a little re-engeering, feel free to propose it 👍

But yea, definitely need to be addressed at some point...

@derberg
Copy link
Member

derberg commented Oct 25, 2023

Because of #761 for me Spectral should go away. Before we had custom validation code for some extra spec stuff (that ajv could not cover) and it was working. Code was not the best but at least you could control it.

Maybe now as Stoplight is part of SmartBear the development experience with Spectral will increase @char0n 😉 😄

@char0n
Copy link
Contributor

char0n commented Oct 26, 2023

@derberg, well bad timing on my side ;]

But anyway I've just bump into #761 as well on top of issues I've described above. We maintain custom layer on top of @apidevtools/json-schema-ref-parser which v1 of parser-js allowed to customize.

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 Feb 24, 2024
@smoya smoya removed the stale label Mar 11, 2024
@smoya
Copy link
Member

smoya commented Mar 11, 2024

I have faced this issue as well (nimma within the ref resolver) when trying to use our parser in a Deno env through Netlify's Edge functions.

@smoya smoya added the help wanted Extra attention is needed label Mar 11, 2024
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 Jul 10, 2024
@ValeryG
Copy link

ValeryG commented Aug 22, 2024

ld it be possible to create a new entry point inside the npm package that would just do the pure parsing without spectral?

This will also make parser to work in cloudflare workers. it looks like today it doesn't as spectral is using ajv and ajv is using code from string via new Function and this is prohibited on coworkers. I was wondering if @char0n suggestion to bypass or op-out from spectral is doable?

@github-actions github-actions bot removed the stale label Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants