Skip to content

Instantly share code, notes, and snippets.

View dhilipkmr's full-sized avatar
🎯
Focusing

Dhilip kumar Velusamy dhilipkmr

🎯
Focusing
View GitHub Profile
Metric Old Version New Version Diff
1 JS Vendor Size 144KB 16KB ~85% Reduction
2 JS Main Bundle Size 60.4KB 19.5KB ~67% Reduction
3 CSS Size 50.1KB 11KB ~78% Reduction
4 LightHouse Score 64 94 ^30 Points
5 Page DropOffs 8.8% 3.3% ~62% reduction
File Name gzip brotli
1 vendor.js 17.7KB 15.7KB
2 forgotPassword.js 14.3KB 12.3KB
total 32KB 28KB
Property Purpose
1 files js/css/html files to consider in my repository
2 cssPath The giant file with all CSS rules
3 downloadCssPath If the cssPath file is in the remote server, then downloadCssPath is where it will get downloaded.
4 outputCssPath It is the location of the final output CSS file which takes the CSS rules from cssPath file for the classes mentioned in files provided under files
   plugins: [
        new OptimizeCssPlugin(
          [
            {
              files: ['./src/*/*.js', './src/*/*/*.js', './server/*.js', './server/*/*.js', './server/*/*/*.js', './plain_js/*.js'],
              cssPath: `https://goibibo.ibcdn.com/styleguide/css/newtrains/trainCombined.${Math.ceil(Math.random()*1000)}.css`,
              downloadCssPath: `./static/trains-static/styles/combinedStyles.css`,
              outputCssPath: `./static/trains-static/styles/purified.css`
 }
{
"dependencies": {
"preact": "10.0.0",
"react-foco": "^1.3.1",
"siema": "1.5.1"
}
}
Metrics preact svelte
1 Size ~4.5KB (with Hooks) Although it compiles the code to plain js, it adds a small amount of Svelte framework specific code (~2KB)
2 Community Better than Svelte Relatively new and Growing
3 Package Availability All react and preact Frameworks are supported in preact Not much option in terms of package availability
4 Skillset of Developers Abundance Need time to get into Svelte Ecosystem
5 BoilerPlate Comparatively More Boilerplate Lesser Boiler Plate with the help of 2 way Binding
File Name Size Compression
1 combinedStyles.css 22.8KB gZip
2 other Css Files 27.3KB gZip
total 50.1KB
File Name Size Compression
1 vendor.js 144KB Brotli
2 bundle.js 46KB Brotli
3 review.js 14.4KB Brotli
total 204.4KB
Page Name Purpose
1 Home To feed in Source, destination and date for travel
2 Results To see the available trains List
3 Review To avail offers and provide traveller details
const input = {a: [1,2,'444', true], "b": 4, c:"c"};
JSON.superStringify(input); // "{"a":[1,2,"444","true"],"b":4,"c"}"