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

Compact json download #820

Merged
merged 1 commit into from Oct 4, 2020
Merged

Compact json download #820

merged 1 commit into from Oct 4, 2020

Conversation

@ashu8912
Copy link
Member

@ashu8912 ashu8912 commented Oct 4, 2020

No description provided.

@ashu8912
Copy link
Member Author

@ashu8912 ashu8912 commented Oct 4, 2020

fixes #772

@@ -102,7 +102,7 @@ class ExportModal extends React.PureComponent<Props, State> {
content.config = mergeConfig({}, this.props.config, content.config);
}

const blob = new Blob([JSON.stringify(content, null, 2)], {
const blob = new Blob([JSON.stringify(content, null, 0)], {

This comment has been minimized.

@domoritz

domoritz Oct 4, 2020
Member

Please use json-stringify-pretty-compact instead.

This comment has been minimized.

@ashu8912

ashu8912 Oct 4, 2020
Author Member

aah nice we want best of both the worlds, i will add the fix

This comment has been minimized.

@ashu8912

ashu8912 Oct 4, 2020
Author Member

also @domoritz do we want that 0 indentation or the previous default 2 indentation

This comment has been minimized.

@domoritz

domoritz Oct 4, 2020
Member

We don't need any arguments anymore. Look at other uses of json-stringify-pretty-compact.

@ashu8912 ashu8912 force-pushed the ag/compact-stringify branch from 2c997d1 to 5ef7518 Oct 4, 2020
We right now use a whitespace of the factor 2 while stringifying the
json download, The whitespaces in the json increases the downloaded json
file size, we rather would want to make the json as compact as possible
thus reducing the space factor within the json to 0.
@ashu8912 ashu8912 force-pushed the ag/compact-stringify branch from 5ef7518 to 615e845 Oct 4, 2020
@ashu8912
Copy link
Member Author

@ashu8912 ashu8912 commented Oct 4, 2020

@domoritz fixed and tested as well

@domoritz domoritz changed the title Reduce download json compactness Compact json download Oct 4, 2020
@domoritz domoritz merged commit 452e9cc into master Oct 4, 2020
2 checks passed
2 checks passed
Lint and Build
Details
LGTM analysis: JavaScript No new or fixed alerts
Details
@domoritz domoritz deleted the ag/compact-stringify branch Oct 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.