Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Merge requests
  • !7651

Drop the sizzle dependency to allow smaller builds targeting mobile devices

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/mgcrea/patch-jqlite into master Apr 21, 2013
  • Overview 0
  • Commits 720
  • Pipelines 0
  • Changes 253

Created by: mgcrea

It would be great if on the javascript side, for the 3.0 release, bootstrap could drop the sizzle dependency. We can now easily get custom smaller jQuery builds. It would make sense with being "mobile first" where KBs matter a lot.

I'm currently reviewing a custom jquery2+bootstrap build for AngularStrap to pave the way for mobile apps there. Looks like most of bootstrap's javascript works with this custom build:

grunt custom:-ajax,-deprecated,-effects,-sizzle

This gives a 17KB file (min+gz) vs. 29KB, thus -42%. That's great and the jquery modularization/cleanup is only beginning.


If we take a look at the current bootstrap-tab.js, that this PR highlights, implementation for the v2.3.1 release, to make it work with a sizzle-free build, we have to:

  1. replace > .class with children():

bootstrap-tab.js l.82

.find('> .dropdown-menu > .active') // unsupported

could be replace with:

.children('.dropdown-menu').children('.active')
  1. find a sizzle-free alternative to some positional selectors, :first & :last (that do not behave like the css3 :first-child, etc.).

bootstrap-tab.js l.52

previous = $ul.find('.active:last a')[0]

could become:

previous = $($ul.find('.active:last').get(-1)).find('a')[0]
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/mgcrea/patch-jqlite