Code Monkey home page Code Monkey logo

Comments (9)

genetique-techno avatar genetique-techno commented on June 5, 2024 1

@handrews thanks for providing some background on the state of things--I totally understand Real Life. I'm going to try to make a new template with the draft-07, and I'll hit up the slack for any issues that come up. Thanks again and best of luck with Real Life.

from json-schema-tools.

rscreene avatar rscreene commented on June 5, 2024 1

Ah, I had assumed that the warnings were the reason that there was no CSS! I'll check back later.

Nice project by the way!

from json-schema-tools.

handrews avatar handrews commented on June 5, 2024

@rscreene I had an email notification that you maybe had an old version lying around- I don't see that comment here so I assume you checked and you do not?

I remember the "Context can't use RegExps with the 'g' or 'y' flags" warning but I was pretty sure that I'd fixed that. Hm....

The result is definitely very minimally styled. Per the doca workspace README:

For now, it simply displays the getting started text and the processed schemas. We will be gradually making this into a proper theme, but it can serve as a debuggging aid for anyone using the underlying tools or wishing to build their own theme from scratch.

And from the old doca repo's README:

The new @cloudflare/doca does not yet have a fully functioning theme, so this package is still the produciton-ready one. But we will be implementing feature requests on the new code, and moving most open issues to the new repo whenever it makes sense.

So.... yeah, basically it's just a debugging theme for now I'm afraid. We wanted to get the tools out there (there's at least one other tool, for OpenAPI, that is using @cloudflare/json-schema-walker already) rather than wait on getting a full UI designed and written.

from json-schema-tools.

rscreene avatar rscreene commented on June 5, 2024

I tried it on a machine that had never run doca before and I got the same results so I'm guessing its not due to any old versions.

When I said minimally styled I actually meant without any CSS! Sorry for any confusion.

I've been dragged onto other things for the time being. I'll try again when I get back to it.

from json-schema-tools.

genetique-techno avatar genetique-techno commented on June 5, 2024

I removed the -g option from the RegExps inclient/main.js. That made the warnings go away. From reading https://webpack.js.org/guides/dependency-management/#require-context it seems to me that the -g option isn't necessary.

from json-schema-tools.

handrews avatar handrews commented on June 5, 2024

I removed the -g option from the RegExps inclient/main.js. That made the warnings go away. From reading https://webpack.js.org/guides/dependency-management/#require-context it seems to me that the -g option isn't necessary.

Oh great- so it looks like as long as subdirectories is true it will do what the "g" was trying to do anyway. Would you be willing to open a PR for it?

Yeah, there's no CSS. Or there may be an empty file to make something not complain, I forget. That seemed the best way to make it clear that it's not intended for production use. Maybe I should have put a banner at the top. hmm....

from json-schema-tools.

genetique-techno avatar genetique-techno commented on June 5, 2024

I'll open a PR for that within a day. FYI, I'll be playing around with these tools a lot this week, so I might find some other things to address. Do you know why the doca-bootstrap-template is no longer supported? I was able to get it up and running, but it doesn't work with our draft-07 schemas of course. Is there any value in trying to PR against that repo for support with these tools or better to make a new template?

from json-schema-tools.

genetique-techno avatar genetique-techno commented on June 5, 2024

Or, if you know of specific issues in these tools that's blocking draft-07 support, I'd be happy to help out.

from json-schema-tools.

handrews avatar handrews commented on June 5, 2024

@genetique-techno it's a bit complicated- for personal reasons I'm taking some time away from the tech industry. So I no longer work at Cloudflare, although obviously I still care about this repo, and am still working on the next draft of the JSON Schema specification (which will mostly be core and validation stuff, probably with minimal Hyper-Schema changes since we're just staring to see draft-07 implemented).

So the simple reason there's no UI right now is that I'm dealing with Real Life Stuff and unable to put a lot of time into one myself, and I'm not sure what the plan is within Cloudflare.

@tomlikestorock are there any near-term plans for an open source new theme on top of this new back-end?

Of course, if you want to work on a UI that would be awesome and may be faster, and I'd be happy to answer questions, review code, discuss UI design options, etc. I've thought about this stuff a lot, I just don't have time to code it right now.

As for why the old doca-bootstrap-theme doesn't work, the old doca (on npm as doca) and this new doca (@cloudflare/doca) work with different data structures. The old json-schema-example-loader package changed the data structure around a lot in order to make the UI easier. However, that meant that the output was no longer a valid JSON Hyper-Schema (of any draft). In the long run, that caused more trouble than it was worth for a variety of reasons, not the least of which being that we couldn't use anyone else's schema tools on the output if we wanted to.

So in this repo, @cloudflare/json-schema-apidoc-loader (or, really, @cloudflare/json-schema-transform) still does most of what json-schema-example-loader used to, except the result is still a valid JSON Hyper-Schema of whatever draft it started out as. It just has extra fields which is something JSON Schema allows.

But that means no older doca theme will work with @cloudflare/doca. On the plus side, it should be easier to figure out how to build a theme since if you already know JSON Hyper-Schema, you know 99% of what comes out of the API doc loader as input to the UI. There's no conversion step to learn.

If you want to kick ideas around more, feel free to drop by the JSON Schema slack channel which might be a little better suited than GitHub issues for such things.

from json-schema-tools.

Related Issues (16)

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.