Skip to content
GitLab
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    • Menu
    Projects Groups Snippets
  • Get a free trial
  • Sign up
  • Login
  • Sign in / Register
  • S sidecar
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 17
    • Issues 17
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gitter
  • sidecar
  • Issues
  • #75
Closed
Open
Created Nov 07, 2019 by Andrey Sitnik@asitnik

Reduce sidecar.v1.js size

In the current word of 1MB+ web apps, you can think that I am crazy, but I (as an author of 139 bytes library and Size Limit) think that 17 KB is too big for sidecar.v1.js 😄.

I am currently having 10 KB website and adding 17 KB of Sidecar is painful for me (but Gitter so nice, Sidecar UX is great and I love this project so much).

I investigated sidecar.v1.js and found a few simple steps to reduce the size. I think we can reach 10 KB.

  1. Removing object-assign polyfill. Any way it is used only in few simple places.

  2. Removing Array.from polyfill, because it takes a lot of checks in error messages like:

    if(null===t||"undefined"==typeof t)throw new TypeError("`Array.from` requires an array-like object, not `null` or `undefined`");var i,a,u=n.ToObject(t);if("undefined"!=typeof arguments[1]){if(i=arguments[1],!n.IsCallable(i))throw new TypeError("When provided, the second argument to `Array.from` must be a function");
  3. Use Rollup to trim webpack’s boilerplate and Object.defineProperty(e,"__esModule",{value:!0}) calls.

  4. Remove Node.js process polyfill (it could accidetly be added by wrong usage of process.env).

What do you think of these steps? I can try to find more steps to reduce size and send pull requests.

Edited Nov 07, 2019 by Andrey Sitnik
Assignee
Assign to
Time tracking