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

Allow passing a separate data file into the main template #21

Merged
merged 1 commit into from
May 7, 2020

Conversation

goto-bus-stop
Copy link
Contributor

The JSON data will be placed in a separate <script type="application/json">, and the Clinic.js visualizers can parse the data from there.
The main motivation is that the massive JSON blobs that are embedded in the visualizer JS can make it hard to navigate, especially if there are minifier bugs like in clinicjs/node-clinic#226. That one caused vim to hang for a while because there was 40MB of JSON on the line I was looking at :)

This would be good for runtime performance reasons, too, because the
browser can parse the sometimes 10s of megabytes of data as JSON instead
of as JS, which is much faster.

This would also allow us to avoid re-bundling the visualizer on every
profile later. We could instead bundle it once when we publish
Clinic.js packages. Bundling is not the biggest timesink but if we can
avoid that work it will still help a little.

This would be good for performance reasons, because the browser can pass
the sometimes 10s of megabytes of data as JSON instead of as JS, which
is much faster.

This would also allow us to avoid re-bundling the visualizer on every
profile later. We could instead bundle it once when we publish
Clinic.js packages. Bundling is not the biggest timesink but if we can
avoid that work it will still help a little.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant