[next] Embed: Defer login/logout until ready (#2123)

* feat: Embed defer login/-out until ready

* fix: make remove work with lazy render

* fix: typo

* fix: another typo

* fix: test

* chore: replace query-string for querystringify

* fix: types

* chore: small refactor

* feat: added webpack analzyer

* chore: rename compile -> generate

* fix: fix scripts and improve bundle size

* fix: lodash webpack plugin
This commit is contained in:
Kiwi
2018-12-15 00:07:09 +00:00
committed by Wyatt Johnson
parent 6f538d3235
commit 097294909b
42 changed files with 531 additions and 280 deletions
@@ -1,11 +1,11 @@
import qs from "query-string";
import { parseQuery, stringifyQuery } from "talk-common/utils";
import buildURL from "./buildURL";
import parseURL from "./parseURL";
export default function modifyQuery(url: string, params: {}) {
const parsed = parseURL(url);
const query = qs.parse(parsed.search);
parsed.search = qs.stringify({ ...query, ...params });
const query = parseQuery(parsed.search);
parsed.search = stringifyQuery({ ...query, ...params });
return buildURL(parsed);
}
@@ -1,5 +1,9 @@
import qs from "query-string";
import { parseQuery } from "talk-common/utils";
export default function parseQueryHash(hash: string): Record<string, string> {
return qs.parse(hash);
let normalized = hash;
if (normalized[0] === "#") {
normalized = normalized.substr(1);
}
return parseQuery(normalized);
}