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

[fix] load data through regular json request #7177

Merged
merged 4 commits into from
Oct 10, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
more idiomatic usage
  • Loading branch information
Rich-Harris committed Oct 10, 2022
commit a44d8659cf7f6bf870d69e0249c95d571438e9e1
4 changes: 2 additions & 2 deletions packages/kit/src/runtime/client/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { HttpError, Redirect } from '../control.js';
import { stores } from './singletons.js';
import { DATA_SUFFIX } from '../../constants.js';
import { unwrap_promises } from '../../utils/promises.js';
import { parse as devalue_parse } from 'devalue';
import * as devalue from 'devalue';
Copy link
Member Author

Choose a reason for hiding this comment

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

will tree shaking remove the other stuff correctly if we write the import like this?

Copy link
Member

Choose a reason for hiding this comment

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

Yep, Rollup doesn't care either way


const SCROLL_KEY = 'sveltekit:scroll';
const INDEX_KEY = 'sveltekit:index';
Expand Down Expand Up @@ -1507,7 +1507,7 @@ async function load_data(url, invalid) {
throw new Error(JSON.parse(server_data));
}

return devalue_parse(server_data);
return devalue.parse(server_data);
}

/**
Expand Down