[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
+2
View File
@@ -5,3 +5,5 @@ export { default as oncePerFrame } from "./oncePerFrame";
export { default as isBeforeDate } from "./isBeforeDate";
export { default as ensureEndSlash } from "./ensureEndSlash";
export { default as ensureNoEndSlash } from "./ensureNoEndSlash";
export { default as parseQuery } from "./parseQuery";
export { default as stringifyQuery } from "./stringifyQuery";
+8
View File
@@ -0,0 +1,8 @@
/**
* From the `querystringify` project:
* The parse method transforms a given query string in to an object.
* Parameters without values are set to empty strings.
* It does not care if your query string is prefixed with a ? or not.
* It just extracts the parts between the = and &:
*/
export { parse as default } from "querystringify";
+24
View File
@@ -0,0 +1,24 @@
import qs from "querystringify";
/**
* From the `querystringify` project:
* This transforms a given object in to a query string.
* By default we return the query string without a ? prefix.
* If you want to prefix it by default simply supply true as second argument.
* If it should be prefixed by something else simply supply a string with the
* prefix value as second argument.
*
* In addition keys that have an undefined value are removed from the query.
*/
export default function stringifyQuery(
obj: object,
prefix?: string | boolean
): string {
const copy: any = { ...obj };
Object.keys(copy).forEach(key => {
if (copy[key] === undefined) {
delete copy[key];
}
});
return qs.stringify(copy, prefix);
}