v1.2.0 | SSR Refactoring for Improved Search Indexing
Summary
During environment sync and local Python dependency setup, initial refactoring inadvertently introduced SSR code duplication. Subsequent focus on troubleshooting CI/CD Bitbucket key permissions caused this issue to be overlooked. The problem was later identified during QA branch testing, allowing us to quickly apply the same fix to production.
Issue Identified
- Google Search Console showing incorrect/missing content in search results
- Server-side rendering (SSR) not executing properly for crawlers
- Empty <div id="app"></div> visible in page source instead of rendered HTML
Root Cause
- SSR code duplicated across server/index.js and imports/startup/server/index.js
- onPageLoad callback not firing reliably due to import chain
- Same architectural issue discovered during QA branch testing
Solution Applied
Leveraged QA branch learnings to production:
- Consolidated all SSR logic into server/index.js
- Removed duplication from imports/startup/server/index.js
- Added proper error handling with try-catch-finally blocks
- Integrated styled-components sheet collection
- Added prerenderReady signal for prerender.io
Technical Changes
- ✅ SSR rendering now executes directly in main server entry point
- ✅ React Helmet meta tags properly injected into <head>
- ✅ Styled-components styles correctly generated server-side
- ✅ Full HTML content now visible in page source
- ✅ Fixed Meteor.userId() bug in userList publication
Immediate Impact
- Crawlers: Now receive fully rendered HTML on first request
- SEO: Meta descriptions, titles, and Open Graph tags properly displayed
- Social Sharing: Preview cards now show correct content
- Search Results: Resubmitted sitemap to Google Search Console
Next Steps
- Monitor Google Search Console for re-indexing
- Verify rich results in Google's Rich Results Test
- Track improvements in search result accuracy over next 7-14 days
Key Takeaway
Code quality improvements on QA branch directly translated to rapid production fix, enabling same-day resolution and sitemap resubmission.