diff --git a/.changeset/curly-jars-punch.md b/.changeset/curly-jars-punch.md new file mode 100644 index 000000000..b6278b9f3 --- /dev/null +++ b/.changeset/curly-jars-punch.md @@ -0,0 +1,6 @@ +--- +'@emotion/serialize': patch +'@emotion/utils': patch +--- + +Minor performance improvement diff --git a/packages/serialize/src/index.ts b/packages/serialize/src/index.ts index 8e69a588b..dcae2895d 100644 --- a/packages/serialize/src/index.ts +++ b/packages/serialize/src/index.ts @@ -365,7 +365,7 @@ function createStringFromObject( return string } -let labelPattern = /label:\s*([^\s;\n{]+)\s*(;|$)/g +let labelPattern = /label:\s*([^\s;{]+)\s*(;|$)/g let sourceMapPattern: RegExp | undefined if (isDevelopment) { diff --git a/packages/utils/src/index.ts b/packages/utils/src/index.ts index 88dc29da9..b80551376 100644 --- a/packages/utils/src/index.ts +++ b/packages/utils/src/index.ts @@ -11,7 +11,7 @@ export function getRegisteredStyles( classNames.split(' ').forEach(className => { if (registered[className] !== undefined) { registeredStyles.push(`${registered[className]};`) - } else { + } else if (className) { rawClassName += `${className} ` } })