Skip to content

Commit c6cebdc

Browse files
nimrodkraclaude
andauthored
feat: optimize core web vitals and fix Playwright tests (#473)
- Add webpack source maps plugin for production debugging - Fix React hydration errors by adding client-side checks - Wrap homepage components with ErrorBoundary for better error handling - Update Playwright tests to use specific selectors avoiding strict mode violations - Add proper wait states and loading checks in tests - Install missing Playwright browsers for full test coverage - Format code with Prettier for consistency - Remove unused files and scripts 🤖 Generated with [Claude Code](https://claude.ai/code) --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent e1e2f25 commit c6cebdc

26 files changed

Lines changed: 609 additions & 1622 deletions

DOCUSAURUS_ENHANCEMENT_OPPORTUNITIES.md

Lines changed: 0 additions & 466 deletions
This file was deleted.

docusaurus.config.js

Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,73 @@ const config = {
104104
],
105105
],
106106

107-
// Performance optimizations removed to fix deployment issues
108-
109107
// Bundle analyzer for optimization monitoring
110108

111109
plugins: [
110+
// Custom webpack plugin for source maps and performance
111+
function webpackOptimizationPlugin() {
112+
return {
113+
name: 'webpack-optimization-plugin',
114+
configureWebpack(config, isServer) {
115+
if (!isServer) {
116+
return {
117+
devtool: 'source-map',
118+
optimization: {
119+
splitChunks: {
120+
chunks: 'all',
121+
cacheGroups: {
122+
vendor: {
123+
test: /[\\/]node_modules[\\/]/,
124+
name: 'vendors',
125+
chunks: 'all',
126+
priority: 10,
127+
},
128+
common: {
129+
name: 'common',
130+
minChunks: 2,
131+
chunks: 'all',
132+
priority: 5,
133+
reuseExistingChunk: true,
134+
},
135+
},
136+
},
137+
},
138+
};
139+
}
140+
},
141+
};
142+
},
143+
// Performance optimization plugin
144+
function performancePlugin() {
145+
return {
146+
name: 'performance-plugin',
147+
injectHtmlTags() {
148+
return {
149+
headTags: [
150+
{
151+
tagName: 'script',
152+
innerHTML: `
153+
(function() {
154+
var script = document.createElement('script');
155+
script.async = true;
156+
script.src = 'https://www.googletagmanager.com/gtag/js?id=UA-109059578-7';
157+
script.onload = function() {
158+
window.dataLayer = window.dataLayer || [];
159+
function gtag(){dataLayer.push(arguments);}
160+
gtag('js', new Date());
161+
gtag('config', 'UA-109059578-7', {anonymize_ip: true});
162+
};
163+
setTimeout(function() {
164+
document.head.appendChild(script);
165+
}, 3000);
166+
})();
167+
`,
168+
},
169+
],
170+
};
171+
},
172+
};
173+
},
112174
[
113175
'@docusaurus/plugin-ideal-image',
114176
{
@@ -243,6 +305,8 @@ const config = {
243305
logo: {
244306
alt: 'daily.dev Logo',
245307
src: 'img/logo.png',
308+
width: 32,
309+
height: 32,
246310
},
247311
items: [
248312
{

playwright-report/index.html

Lines changed: 77 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)