Skip to content

Accept JsonSlabs files in publish endpoint#696

Open
mstange wants to merge 3 commits into
firefox-devtools:masterfrom
mstange:allow-jslb
Open

Accept JsonSlabs files in publish endpoint#696
mstange wants to merge 3 commits into
firefox-devtools:masterfrom
mstange:allow-jslb

Conversation

@mstange

@mstange mstange commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

In the profiler front-end we want to start uploading profiles in the JsonSlabs (JSLB) binary container format, so that we don't have to spend time encoding long arrays of numbers to JSON strings.

The server currently rejects such files because it scans for an opening curly brace. This PR adapts the validation code to allow JSLB files.

@canova canova left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me! I have 1 small question regarding very short jsons, but happy to go either way. Let me know what you think!

Comment thread src/utils/streams.ts
Comment thread test/unit/streams.test.ts Outdated
Comment thread test/unit/streams.test.ts Outdated
@mstange mstange force-pushed the allow-jslb branch 2 times, most recently from fcbbb93 to ccc4f4c Compare July 10, 2026 18:16
@mstange mstange requested review from canova and removed request for fatadel July 10, 2026 18:17
mstange added 3 commits July 10, 2026 14:17
The next commit will add a dependency to json-slabs, which is an ESM-only
module and needs to be added to transformIgnorePatterns so that Jest can
handle it.

Without this change, transformIgnorePatterns would not apply to anything under
node_modules (because .babelrc stops applying in any directory that has a
package.json). Using the name babel.config.json turns it into a "project-wide"
configuration: https://babeljs.io/docs/config-files#project-wide-configuration
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.

2 participants