Skip to content

Commit

Permalink
Merge pull request #200 from estuary/jshearer/perf_updates_2
Browse files Browse the repository at this point in the history
Fix ref error, reduce unused queries, reduce CLS drastically on homepage
  • Loading branch information
jshearer authored Feb 21, 2024
2 parents 389a284 + 1a5708f commit 865323e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 48 deletions.
2 changes: 1 addition & 1 deletion gatsby-ssr.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ exports.onRenderBody = ({ setHtmlAttributes, setHeadComponents }) => {
gtag('config', '${GA_MEASUREMENT_ID}', { send_page_view: false })`
}}
/>,
<script key="osano-1" type="text/partytown" src="https://cmp.osano.com/16CPXbTOi1sXx4D3/1e6b223c-ed10-4c4b-a442-48fea69f76af/osano.js"></script>,
// <script key="osano-1" type="text/partytown" src="https://cmp.osano.com/16CPXbTOi1sXx4D3/1e6b223c-ed10-4c4b-a442-48fea69f76af/osano.js"></script>,
])
}
3 changes: 2 additions & 1 deletion src/components/ContextTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const HtmlTooltip = styled(({ className, ...props }: TooltipProps) => (
},
}))

export const ContextToolTip = React.forwardRef((props: TooltipProps) => {
export const ContextToolTip = React.forwardRef((props: TooltipProps, ref) => {
const [open, setOpen] = useState(false)

const handleTooltipClose = () => {
Expand All @@ -39,6 +39,7 @@ export const ContextToolTip = React.forwardRef((props: TooltipProps) => {
onClick={handleTooltipOpen}
onClose={handleTooltipClose}
arrow
ref={ref}
{...props}
/>
)
Expand Down
8 changes: 1 addition & 7 deletions src/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -3330,12 +3330,7 @@ table th {
}

.section-one-right {
position: relative;
top: -2.5em;
margin-bottom: -3em;
margin-left: auto;
justify-content: flex-end;
max-width: unset;
display: none;
}

.section-one-right-image {
Expand Down Expand Up @@ -6802,7 +6797,6 @@ table th {
padding-bottom: 20px;
display: flex;
@media (max-width: 810px){
margin-top: 100px;
padding-right: 16px;
height: 120px;
padding-bottom: 20px;
Expand Down
40 changes: 1 addition & 39 deletions src/templates/blog-post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { RenderToc } from "../components/BlogPostToc"

dayjs.extend(reltime)

const BlogPostTemplate = ({ data: { previous, next, post }, pageContext }) => {
const BlogPostTemplate = ({ data: { post }, pageContext }) => {
const postTags = post.tags.filter(tag => tag.type === "tag")
const [windowWidth, setWindowWidth] = useState(
typeof window === "undefined" ? 1500 : window.innerWidth
Expand Down Expand Up @@ -196,8 +196,6 @@ export default BlogPostTemplate
export const pageQuery = graphql`
query BlogPostBySlug(
$id: String!
$previousPostId: String
$nextPostId: String
) {
site {
siteMetadata {
Expand Down Expand Up @@ -258,41 +256,5 @@ export const pageQuery = graphql`
type: Type
}
}
previous: strapiBlogPost(id: { eq: $previousPostId }) {
title: Title
slug: Slug
authors {
name: Name
picture: Picture {
localFile {
childImageSharp {
gatsbyImageData(
layout: CONSTRAINED
placeholder: BLURRED
)
}
}
}
link: Link
}
}
next: strapiBlogPost(id: { eq: $nextPostId }) {
title: Title
slug: Slug
authors {
name: Name
picture: Picture {
localFile {
childImageSharp {
gatsbyImageData(
layout: CONSTRAINED
placeholder: BLURRED
)
}
}
}
link: Link
}
}
}
`

0 comments on commit 865323e

Please sign in to comment.