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

Make fast-json-stringify optional #83

Open
hoangvvo opened this issue Jun 8, 2020 · 1 comment
Open

Make fast-json-stringify optional #83

hoangvvo opened this issue Jun 8, 2020 · 1 comment

Comments

@hoangvvo
Copy link
Contributor

hoangvvo commented Jun 8, 2020

Thanks for the great project.

Is your feature request related to a problem? Please describe.

I'm experimenting with using graphql-jit in the browser. Currently graphql-jit is bundled with fast-json-stringify, which makes its size extremely big to be used in browser.

https://bundlephobia.com/result?p=graphql-jit

Removing fast-json-stringify would cut the size in half.

Describe the solution you'd like

Currently, we have the option compilerOptions.customJSONSerializer, which accepts a boolean value. However the option does not provide much use because it only switches between JSON.stringify and fastJSON, not really 'custom'.

My proposal is that we replace it with a user-supplied function that accepts CompilerContext and returns the stringify function.

@mcollina
Copy link

mcollina commented Jun 8, 2020

That would be ok for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants