Allow passing a separate data file into the main template #21
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.