lbovet / docson

Documentation for your JSON types
Apache License 2.0
491 stars 97 forks source link

Latest Version locks up in our browser #69

Closed odscjames closed 6 years ago

odscjames commented 6 years ago

Here is the JSON that causes it: http://standard.open-contracting.org/schema/1__1__3/release-schema.json

In case it matters, it's a simple test page of:

<!DOCTYPE html>
<html>
<head>
    <title>Docson Example</title>
    <meta charset="utf-8">
    <link rel="stylesheet" href="../css/docson.css">
<body>

    <script src="/widget.js"  data-schema="/release-schema.json">
    </script>

</body>
</html>

The Lockup has been seen in several browser on 2 computers.

I did some quick narrowing down and a3b582dee1458bde6b2bf906f2a6148db1ec2aa8 works. b5f888eae539c2020f5c1471590f3c37b3edb7bd Doesn't.

That means that something in #49 / #41 might have changed something?

I don't have time to look more now, but I wanted to report it for informations sake. I will try and look more later, but I don't know when that will be.

yanick commented 6 years ago

Yikes. I'll try to have a look at it over the weekend.

odscjames commented 6 years ago

Thank you 😄

yanick commented 6 years ago

Was able to reproduce the problem. Now looking at what might cause it.

yanick commented 6 years ago

I think I got the root cause and the fix. Basically, the new version was calling renderBox each time a piece of the schema was loaded/reloaded. For release-schema, that that a lot of reload that was drowning the poor browser.

Throttling the re-rendering seems to fix the problem. Patch and new release forthcoming.

yanick commented 6 years ago

@odscjames Can you checkout the branch npm-migration and see if it's working for you?

Fair warning: I'm prepping to make docson more npm-friendly, so widget.js moved to public/js/widjet.js.

odscjames commented 6 years ago

@yanick Hello! Sorry, didn't notice last message for some reason.

Yes, that branch now works fine with the same example in 2 of the same web-browsers that were causing problems before.

Thank you!

yanick commented 6 years ago

Excellent. Merging into master and tagging a new release!