Skip to content

Conversation

gnoff
Copy link
Collaborator

@gnoff gnoff commented Oct 18, 2022

adds title as a singleton type.
treats singletons as containers for purposes of removal
modifies the removal pathway to guard against already removed children when removing from a container

todo:
support out of position hydration
relax validation to support out of position rendering

);
}
// This will initialize a title element if it didn't already exist
ownerDocument.title = ownerDocument.title;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this may be too cute and also, mutates more than necessary. not sure if browsers are smart and noop when not changed. either way I could rewrite to be more conventional about constructing a title if missing. unlike the other singletons we cannot expect the document to always contain one

@sizebot
Copy link

sizebot commented Oct 18, 2022

Comparing: 9cdf8a9...71d1960

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.min.js +0.04% 135.99 kB 136.04 kB +0.03% 43.54 kB 43.55 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js +0.14% 151.46 kB 151.67 kB +0.12% 48.23 kB 48.29 kB
facebook-www/ReactDOM-prod.classic.js +0.03% 493.51 kB 493.67 kB +0.02% 87.83 kB 87.84 kB
facebook-www/ReactDOM-prod.modern.js +0.03% 478.77 kB 478.93 kB +0.02% 85.64 kB 85.66 kB
facebook-www/ReactDOMForked-prod.classic.js +0.03% 493.51 kB 493.67 kB +0.02% 87.83 kB 87.84 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 71d1960

@gnoff
Copy link
Collaborator Author

gnoff commented Oct 19, 2022

liking the resource approach better... #25508

@gnoff gnoff closed this Oct 19, 2022
@gnoff gnoff deleted the singletons-title branch January 11, 2023 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants