Skip to content

Add Bootstrap 6 support (v6.0.0.alpha1, tracking v6-dev)#302

Draft
pardeyke wants to merge 5 commits into
twbs:mainfrom
pardeyke:bootstrap-6
Draft

Add Bootstrap 6 support (v6.0.0.alpha1, tracking v6-dev)#302
pardeyke wants to merge 5 commits into
twbs:mainfrom
pardeyke:bootstrap-6

Conversation

@pardeyke

@pardeyke pardeyke commented Jul 2, 2026

Copy link
Copy Markdown

Updates the gem to Bootstrap 6 (v6.0.0.alpha1), tracking
twbs/bootstrap@v6-dev.
Upstream's move to the Sass module system and ES-module-only JavaScript changes
how the gem's assets are consumed:

  • Stylesheets: consumers use @use "bootstrap" (with ... with (...) for
    variable overrides) instead of @import. Compiling requires a Dart Sass
    engine; sassc-rails stays a listed engine fallback but libsass cannot
    compile the v6 stylesheets.
  • JavaScript: ESM-only (no UMD / window.bootstrap), loaded via
    importmaps; the bootstrap-sprockets manifest is removed. Popper is replaced
    by a vendored @floating-ui/dom, dropping the popper_js dependency — the
    gem now has no runtime dependencies. Ships the self-contained
    bootstrap.bundle.{js,min.js} plus individual component modules.
  • Updater: rake update handles the v6-dev layout (exact-ref resolution,
    ES-module import graph, dist bundles, vendored Floating UI). A daily GitHub
    Actions workflow keeps the assets in lockstep with upstream while v6 is in
    alpha (can be dropped if unwanted).

Backward compatibility

required_ruby_version and dependency floors are unchanged (only popper_js
removed, webrick dev dep added). The full CI matrix and all test gemfiles are
kept; on engines that cannot compile v6 stylesheets (libsass, older Dart Sass
on Ruby < 3.1) the stylesheet tests skip via an engine-capability probe.

Testing

New headless-browser smoke test covers the ESM bundle and importmap paths.
Full 39-job CI matrix is green:
https://github.com/pardeyke/bootstrap-rubygem/actions/runs/28580125070

pardeyke and others added 5 commits July 1, 2026 08:43
Tracks the upstream twbs/bootstrap `v6-dev` branch.

- SCSS: Bootstrap 6 uses the Sass module system, so consumers now use
  `@use "bootstrap"` (with `... with (...)` for overrides). Requires a
  Dart Sass engine; sassc-rails stays a listed engine option but cannot
  compile the v6 stylesheets.
- JS: ES-module only (no UMD / no `window.bootstrap` global), loaded via
  importmaps. Ships the self-contained `bootstrap.bundle.{js,min.js}`
  (inlines Floating UI + vanilla-calendar-pro) plus the individual modules,
  and vendors a self-contained `@floating-ui/dom` build (`floating-ui.js`).
  Dropped the popper_js runtime dependency.
- Updater: fixed exact-branch ls-remote resolution, follows only relative
  ES-module imports, ships the dist bundles, vendors Floating UI, and adds
  a `rake update_scss` (skip-JS) task.
- Added a headless-browser JavaScript smoke test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Re-import the latest v6-dev dist files.
Adds a scheduled GitHub Action that re-imports the latest dist from the
tracked upstream branch (default v6-dev) each day, syncs the gem version to
upstream's package.json, verifies the stylesheets compile, and commits any
changes. Adds a `rake sync_version` task it relies on.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…pdate outputs

The scheduled job's `git add -A` swept up test/gemfiles/.bundle/config
(created by CI's bundle install) because .gitignore only ignored the root
/.bundle. Ignore .bundle/ anywhere and limit the auto-commit to assets and
version.rb.
Bootstrap 6 stylesheets use the Sass module system and the CSS
if()/sass() syntax (see _functions.scss contrast-ratio), which only a
recent Dart Sass can compile. On the older-version CI jobs — every
sassc-rails gemfile, plus the dartsass gemfile on Ruby < 3.1 where an
older sass-embedded resolves — test_precompile and test_visit_root
failed with SassC::SyntaxError.

Add a small engine-capability probe that compiles a snippet of the same
syntax (not Bootstrap itself, so real Bootstrap regressions on capable
engines still fail) and skip the two stylesheet tests when the engine
cannot handle it. The JavaScript ESM smoke tests are engine-independent
and keep running everywhere.

Also raise the Ferrum process_timeout to 60s to match the cuprite
driver config: Chrome intermittently takes over 30s to start on loaded
CI runners (seen as Ferrum::ProcessTimeoutError).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant