E526 Sy 305/bootstrap extract by bartek-sek · Pull Request #18752 · Sylius/Sylius · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@bartek-sek
Copy link
Contributor
@bartek-sek bartek-sek commented Jan 27, 2026
Q A
Branch? 2.2
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Related tickets fixes #X, partially #Y, mentioned in #Z
License MIT

Summary by CodeRabbit

  • New Features

    • Bootstrap is now packaged as a separate, optional module that can be disabled in webpack configuration.
    • Introduced responsive breakpoint utilities for media query-based styling.
    • Enhanced CSS variable system for button state customization.
    • Added new color variables to the styling palette.
  • Documentation

    • Added configuration guidance for disabling Bootstrap.
    • Documented handling of potential asset double-loading scenarios.

✏️ Tip: You can customize this high-level summary in your review settings.

@bartek-sek bartek-sek requested review from a team as code owners January 27, 2026 12:09
@probot-autolabeler probot-autolabeler bot added Maintenance CI configurations, READMEs, releases, etc. Shop ShopBundle related issues and PRs. labels Jan 27, 2026
@coderabbitai
Copy link
coderabbitai bot commented Jan 27, 2026
📝 Walkthrough

Walkthrough

This pull request introduces a "Shop Bootstrap separation" feature that extracts Bootstrap into a dedicated webpack entry point, allowing users to disable Bootstrap entirely via the includeBootstrap: false webpack configuration option. The changes also add breakpoint utility SCSS mixins and refactor button styles to use CSS variables.

Changes

Cohort / File(s) Change Summary
Bootstrap Separation & Documentation
UPGRADE-2.2.md, src/Sylius/Bundle/ShopBundle/index.js
Documents the new bootstrap separation feature with remediation guidance for potential double-loading; updates webpack config to conditionally include bootstrap-entry based on includeBootstrap option (default: true).
Bootstrap Assets & Entry Points
src/Sylius/Bundle/ShopBundle/Resources/assets/bootstrap-entry.js, src/Sylius/Bundle/ShopBundle/Resources/assets/styles/bootstrap.scss
New bootstrap entry point file and dedicated SCSS file that imports variables and the Bootstrap SCSS bundle.
Asset Reorganization
src/Sylius/Bundle/ShopBundle/Resources/assets/entrypoint.js, src/Sylius/Bundle/ShopBundle/Resources/assets/styles/main.scss
Removes bootstrap import from entrypoint.js and main.scss; adds breakpoints mixin import to main.scss to decouple Bootstrap from primary stylesheet.
Styling System Enhancements
src/Sylius/Bundle/ShopBundle/Resources/assets/styles/_variables.scss, src/Sylius/Bundle/ShopBundle/Resources/assets/styles/_buttons.scss, src/Sylius/Bundle/ShopBundle/Resources/assets/styles/mixins/_breakpoints.scss
Adds new color variables ($danger, $link-hover-color); refactors button styles to use CSS custom properties; introduces comprehensive breakpoint utility module with min/max helper functions and responsive mixins.
Twig Integration
src/Sylius/Bundle/ShopBundle/Resources/config/app/twig_hooks/base.yaml, src/Sylius/Bundle/ShopBundle/templates/shared/layout/base/styles/bootstrap.html.twig, src/Sylius/Bundle/ShopBundle/templates/shared/layout/base/scripts/bootstrap.html.twig
Registers bootstrap hooks with priority 100 for stylesheets and javascripts; adds corresponding Twig templates to enqueue bootstrap assets via Webpack Encore.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • mpysiak
  • GSadee
  • Rafikooo

Poem

🐰 Bootstrap hops to its own entry point,
CSS custom properties make buttons paint,
Breakpoints mixin helpers dance and play,
Separation of concerns wins the day! 🎉

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'Sy 305/bootstrap extract' is a concise reference to the Jira ticket and primary objective of extracting Bootstrap to a separate entry point, which aligns with the actual changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
github-actions bot commented Jan 27, 2026

❗ Preview Environment deployment failed on Bunnyshell

See: Environment Details | Pipeline Logs

Check https://github.com/Sylius/Sylius/actions/runs/21396728660 for details.

Available commands:

  • 🚀 /bns:deploy to redeploy the environment
  • /bns:delete to remove the environment

@bartek-sek bartek-sek force-pushed the SY-305/bootstrap-extract branch from bd5fe47 to 35dd531 Compare January 27, 2026 12:12
Copy link
@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@UPGRADE-2.2.md`:
- Around line 68-79: Update the upgrade note to explicitly instruct disabling
the Twig `bootstrap` hook when `includeBootstrap: false` is used in Webpack;
mention the exact hook identifiers `sylius_shop.base#stylesheets` and
`sylius_shop.base#javascripts` and the `bootstrap` hook name so users know to
set that hook's `enabled` to false (or remove the bootstrap template) to avoid
rendering missing entries when `includeBootstrap` is false in the
`SyliusShop.getBaseWebpackConfig` call.

Comment on lines +68 to +79
This allows disabling Bootstrap entirely if you want to use a different CSS framework.

**If you have overridden the `styles` hook** in `sylius_shop.base#stylesheets` and included Bootstrap there, it may now load twice. To fix this, either:
- Remove Bootstrap from your custom `styles` hook, or
- Disable the new `bootstrap` hook by setting `enabled: false`

**To disable Bootstrap in webpack**, pass `includeBootstrap: false` to the config:

```js
const shopConfig = SyliusShop.getBaseWebpackConfig(path.resolve(__dirname), {
includeBootstrap: false
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Document the required hook disable when includeBootstrap=false.

As written, users may follow the webpack snippet but still render the bootstrap hook, which will try to load a missing entry and fail at runtime. Please add an explicit note to disable the bootstrap hook when includeBootstrap is false.

✏️ Suggested doc tweak
 **To disable Bootstrap in webpack**, pass `includeBootstrap: false` to the config:
 
 ```js
 const shopConfig = SyliusShop.getBaseWebpackConfig(path.resolve(__dirname), {
     includeBootstrap: false
 });

+Also disable the bootstrap Twig hook (or remove the bootstrap template) to avoid rendering the missing entry:
+```yaml
+sylius_twig_hooks:

  • hooks:
  •    'sylius_shop.base#stylesheets':
    
  •        bootstrap:
    
  •            enabled: false
    
  •    'sylius_shop.base#javascripts':
    
  •        bootstrap:
    
  •            enabled: false
    

+```

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

In @UPGRADE-2.2.md around lines 68 - 79, Update the upgrade note to explicitly
instruct disabling the Twig bootstrap hook when includeBootstrap: false is
used in Webpack; mention the exact hook identifiers
sylius_shop.base#stylesheets and sylius_shop.base#javascripts and the
bootstrap hook name so users know to set that hook's enabled to false (or
remove the bootstrap template) to avoid rendering missing entries when
includeBootstrap is false in the SyliusShop.getBaseWebpackConfig call.


</details>

<!-- fingerprinting:phantom:poseidon:eagle -->

<!-- This is an auto-generated comment by CodeRabbit -->

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Maintenance CI configurations, READMEs, releases, etc. Shop ShopBundle related issues and PRs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0