Skip to content

Accept JsonSlabs files in publish endpoint - #696

Merged
mstange merged 3 commits into
firefox-devtools:masterfrom
mstange:allow-jslb
Aug 13, 2026
Merged

Accept JsonSlabs files in publish endpoint#696
mstange merged 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

@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 good to me, thanks!

It's been a while since we did a deploy for the profiler-server though. It might make sense to do a deployment before this so we make sure that we don't regress anything in the meantime. I'll try to deploy today or tomorrow.

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
@mstange
mstange merged commit 1c4f8f7 into firefox-devtools:master Aug 13, 2026
9 checks passed
@canova canova mentioned this pull request Aug 13, 2026
canova added a commit that referenced this pull request Aug 13, 2026
Changes:
- Accept JsonSlabs files in publish endpoint (#696)
- Dependency updates
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