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

offline mode support #70

Open
matankila opened this issue Oct 16, 2023 · 7 comments
Open

offline mode support #70

matankila opened this issue Oct 16, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@matankila
Copy link

matankila commented Oct 16, 2023

hey,

i am trying to implement your product in internal private network with no access to outer world.

I talked to @daveshanley on the discord channel and he told me that the product main purpose is to work offline. but it still seems to want to go to the cdn. He also said that the ui model should be replaced to be like in wiretap.

when looking into the bundlejs (/ui/build/static/bundle.js) it contains a reference of the cdn

https://raw.githubusercontent.com/pb33f/openapi-changes/03c1ddd51a4ea6d6dfc8045a294a30d119a30d29/html-report/ui/build/static/bundle.js

@eyals24
Copy link

eyals24 commented Oct 19, 2023

I faced the same issue. Any solution or workaround ?

@daveshanley
Copy link
Member

this is a bug and should not be loading it remotely.

@daveshanley daveshanley added the bug Something isn't working label Oct 19, 2023
@daveshanley
Copy link
Member

daveshanley commented Oct 19, 2023

Hi Folks,

I have investigated this and I am struggling to re-create the issue using the latest (v0.0.43) of openapi-changes

from the sample-specs folder, running the command openapi-changes html-report petstorev3-original.json petstorev3.json produces a report that makes no network requests for JS. The report file is large (2.7mb)

Here is what I see.

Screenshot 2023-10-19 at 12 34 03 PM

This is the expected behavior, the JS is inlined inside the report HTML.

To enable the CDN mode, use the -c flag like so: openapi-changes html-report petstorev3-original.json petstorev3.json -c

And the generated report will be much, much smaller at 143kb.

When loaded in a browser:

Screenshot 2023-10-19 at 12 38 51 PM

As expected, the CSS and JS are loaded remotely from github pages.

Can you help me re-create this issue? Behavior is as I expect.

@matankila
Copy link
Author

Hey @daveshanley,

It does make outer request even on the first example when you go ‘explore tree’ and then explore one of the diffs.. (and then of course the diff itself won’t load).

Thanks 💪🏻

@daveshanley
Copy link
Member

I see what you see now, this is absolutely a bug, none of that should be pulled in remotely.

@matankila
Copy link
Author

matankila commented Oct 22, 2023

I see what you see now, this is absolutely a bug, none of that should be pulled in remotely.

Is there any expectation to what time the fix will
Be available @daveshanley

@matankila matankila reopened this Oct 22, 2023
@daveshanley
Copy link
Member

I spent a little while trying to get webpack to inline the JS, it was not having it. This is a more complex fix than I would like it to be, because in order to make this work correctly, there needs to be more jiggling with webpack to get it to behave correctly, or a rebuild / replacement of monaco or webpack.

I am working on the core libopenapi library at the moment, I won't. have any bandwidth to look into this for a few weeks at least.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants