Comments (15)
forEach
on NodeList
too. Let's keep as is until somebody will request ie support.
from react-head.
Awesome, great work @TrySound -- will cut a release as soon as I get a moment
from react-head.
Should we provide default prop for headTags with empty array?
This makes sense, however it should warn/throw an error on the server if the prop is not provided in those cases since this means misconfigured server rendering. Maybe can do a typeof window
check and default to empty array on client and throw when on the server?
Should we enforce having HeadProvider in the tree by throwing an error if context value is null?
The only valid use case for not having HeadProvider
in the tree is for cases when a user doesn't care about the cascade, right? Which we can treat as a misconfiguration and then throwing an error would make sense. Any other alternatives? Would a console.error
not be enough you think?
Should we throw and error in
componentDidUpdate
if tag prop is changed or just removeHeadTag
from public api and provide more aliases?
What are the cases where the tag
prop would change? Are there any valid uses cases for this? Since we already provide all of the W3C-compliant head attributes it may make sense to either remove the HeadTag
from the public api or at least not publicize it in the documentation as much.
from react-head.
@tizmagik Do we care about ie11 support? We use .remove()
method which is not supported there.
from react-head.
Hmm yea good point, I personally don’t care about IE11 support, but if that’s the only thing that’s breaking support maybe we could address it? What do you think @TrySound ?
from react-head.
@tizmagik I think we are ready for release.
from react-head.
Just a quick update here, a couple more things I want to get done before a 3.0 release
- Update example app to support new API
- Some sort of migration guide (maybe can be included with the release notes)
Will try and get to these ASAP, unless someone else wants to (feel free).
from react-head.
I was working through upgrading the example app and it struck me that <HeadProvider />
really feels like an implementation detail.
What do you think about renaming it to <ReactHead />
and making it the default export (as part of 3.0 release), e.g.
/* client.js */
import React from 'react';
import ReactHead, { Title, Link, Meta } from 'react-head';
const App = () => (
<ReactHead>
<div className="Home">
<Title>Title of page</Title>
<Link rel="canonical" content="http://jeremygayed.com/" />
<Meta name="example" content="whatever" />
// ...
</div>
</ReactHead>
);
from react-head.
Nope.
- default exports makes distribution trickier. cjs output will have
default
export which should be handled by tools. And for example webpack is not able to bundle well cjs which imports esm with default export. In any case I also think default exports is a wrong part of the spec and makes module system too complex. Provider
name is like a pattern. It's used in redux for years and used by react itself in context api. It's better to keep descriptive nameHeadProvider
.React
in components names is overnaming. All exported components are react.
from react-head.
The necessity of HeadProvider is defined by invariant. It should not be a problem for user.
from react-head.
Ok that makes sense, you convinced me to keep the name as-is 😁
I'm having a bit of trouble upgrading the example app but should hopefully get it going soon. I can cut another pre-release if you're itching to use the latest though. Lmk
from react-head.
Ok example app updated. I think there's issues with react-router and the new React Context API or something, so I opted for @reach/router
; #60
from react-head.
Yes, this is known problem. Old context providers cannot be inside the new api provider.
from react-head.
Hm, should be fixed in 16.4.
facebook/react#12551 (comment)
from react-head.
from react-head.
Related Issues (20)
- Link canonical cascade HOT 1
- Expose HeadTag? HOT 2
- Question: Does it work without ssr for SEO, on fb and twitter ? HOT 1
- Children prop type missing in HeadProvider HOT 7
- Is this library still maintained? HOT 1
- Suggestion: use renderToStaticMarkup instead of renderToString HOT 4
- Some tags not collected HOT 4
- Invariant failed in HeadTags HOT 9
- Development server not working HOT 2
- does not support ie9? HOT 2
- Proposal: headTagsToElement(headTags) HOT 1
- Element.remove() not supported in IE HOT 3
- Document usage with SSR streaming HOT 3
- TypeScript support HOT 3
- react-head supports meta update on lazy load HOT 3
- itemProp support on <Meta /> HOT 1
- canonical link is repeated HOT 1
- Title component doesn't override default <title> tag provided via HTML template HOT 10
- Entities in computed attribute values? Suggested approach? HOT 5
- RFC: Managing tags without extra markup HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-head.