-
-
Notifications
You must be signed in to change notification settings - Fork 92
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
check whether style needs a suffix with a set and remove debug casting #286
Conversation
🦋 Changeset detectedLatest commit: 3f21e88 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@@ -145,15 +145,6 @@ function _renderToString(vnode, context, isSvgMode, selectValue, parent) { | |||
rendered = | |||
rendered + | |||
_renderToString(child, context, isSvgMode, selectValue, parent); | |||
|
|||
if ( |
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.
We fixed this in 10.13.0, I honestly think we shouldn't put a preact/debug fix in our hot path
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.
I'm a bit out of the loop. Which issue in preact/debug
did this section work around?
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.
This one #257 this was fixed in Preact itself with preactjs/preact#3801
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.
Ohh right!
@@ -338,6 +329,8 @@ function _renderToString(vnode, context, isSvgMode, selectValue, parent) { | |||
} | |||
|
|||
if (UNSAFE_NAME.test(type)) { | |||
// this seems to performs a lot better than throwing | |||
// return '<!-- -->'; |
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.
This could give us an additional 5% boost
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.
I really like that idea!
@@ -1313,7 +1313,7 @@ describe('render', () => { | |||
); | |||
} | |||
|
|||
expect(render(<App />)).to.equal('<div><p>P481</p><p>P476951</p></div>'); | |||
expect(render(<App />)).to.equal('<div><p>P0-0</p><p>P0-1</p></div>'); |
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.
use-id handling seems to be different in Preact 10.13
b5a749e
to
fb3a5e9
Compare
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.
Great work as always!
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.
🎉 Super stoked by all this perf work on RTS!
if ( | ||
typeof val === 'number' && | ||
// Exclude custom-attributes | ||
!name.startsWith('--') && |
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.
Is this check doing the same thing as line 98, i.e. are they both trying to check for custom properties? Do we get any perf benefit by consolidating them?
In Preact >= 10.13.0 we fixed the debug casting, this removes this check as we're doing a major either way.
This also optimises style casting by using a Set, removing the need for the cache and thus saving some memory