-
Notifications
You must be signed in to change notification settings - Fork 2k
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: style isolation failed if app name contains some character #842
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -190,7 +190,7 @@ const process = (appWrapper: HTMLElement, stylesheetElement: HTMLStyleElement | | |||
const tag = (mountDOM.tagName || '').toLowerCase(); | |||
|
|||
if (tag && stylesheetElement.tagName === 'STYLE') { | |||
const prefix = `${tag}[${QiankunCSSRewriteAttr}=${appName}]`; | |||
const prefix = `${tag}[${QiankunCSSRewriteAttr}="${appName}"]`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
咦,这个 "appName" 看起来和上面的 expectValue 结构并不匹配?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
看了下 expectValue
是自己传的 prefix
给 processor
,不走这个逻辑
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
所以,这里的实际 转译过后的结果是:
div[data-qiankun="react15"] ... 么
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是的,如果走 process
而不是 processor
,那么实际结果就是带引号的;我把 case 全部更新一遍吧,这样内外一致
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
有一个问题?
Checklist
npm test
passesDescription of change
So the quotes of attribute selector is required for a framework, reference: https://mathiasbynens.be/notes/unquoted-attribute-values