350 open graph react #360
No reviewers
Labels
No labels
area: devops
area: discovery
area: docs
area: livestream
area: proposal
consider soon
dependencies
Epic
good first issue
hacktoberfest
help wanted
icebox
level: 1
level: 2
level: 3
level: 4
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
on hold
Osprey
priority: blocker
priority: high
priority: low
priority: medium
protocol dependent
resilience
Tom's Wishlist
type: bug
type: discussion
type: error handling
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/spee.ch#360
Loading…
Reference in a new issue
No description provided.
Delete branch "350-open-graph-react"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
react-helmet
to handle meta tagsLooking good.
Main things to fix are moving the title/meta tag utilities into the
SEO
component to avoid unneeded duplication. And removing some of the extra console logs/old commented code.My webpack comments are nice to have, but not super important for now
I think you can delete this?
Probably don't need these
console.log
s here.I'm probably missing something here, but wherever this is rendered, don't you already have the asset? You could just directly pass it in (or just pass some identifier to easily find it in state). Then you wouldn't need the
show
reducer here, which I don't really think needs to exist (in the future).Then you wouldn't have to worry about the
show
reducer being populated and could use these tags for other pages (not sure if you would ever need to do that though)@ -15,24 +16,25 @@ class PublishPage extends React.Component {
render () {
You can move all of these utility functions into the
SEO
component. Just pass in the minimum values needed and create the actual title/link/tags inside the component.Then you don't need to add the same three lines to every page component.
<SEO title="Login" link="login" />
or
<SEO title="Channel" link="channel" channel={channel} />
Then in the component you can check if
channel
orasset
was passed in and build the meta tags accordingly.I would recommend creating separate webpack configs for dev/prod. Before we did our big restructure changes the apps webpack setup had three files:
A base config: contains the generic stuff like babel, entry/output points, css loader, etc.
A dev config which extends the base config: contains stuff like
watch: true
(not needed in prod) and source mapsA prod config which extends the base config: contains stuff like minification (that's the main thing)
webpack-merge
is a great tool for thishttps://github.com/survivejs/webpack-merge
ah, yes. This component should actually be deleted. I made it before moving everything into the
<SEO />
component.