Pergunta

To those who may not be aware, Bootstrap is a HTML, CSS and JS framework that can be used as a foundation or starting point in building a website or web application.

I'm now in a position where I have an application in production that was designed with version 3 of the framework, but with additional styling that is consistent with other websites under the company's portfolio.

However, we are about to embark on some extensive additions to that web application, and I am wondering - should I update the version of bootstrap being used by the application?

I ask this for several reasons. The first is that version 4 of bootstrap is not exactly backwards compatible with version 3 - a number of the helper classes have changed, been replaced or been removed entirely, so it's a non-trivial amount of work to update (not excessive, but not a simple matter of updating a version number in package.json and rebuilding either).

Now, my understanding of bootstrap is that it was initially about getting your website / web application off the ground - a good starting point, so to speak (hence the name). But considering the application is way past that bootstrapping point, should I consider to invest the time to update the bootstrap framework?

I know that on the surface this seems like a question with an obvious answer - of course, you keep your stuff up to date!!!. But, if you think about Bootstrap as a means of getting started, then after you're up and running, why should you continue to update the framework itself? You have already customised parts for your application's needs - shouldn't you allow yourself to go in a different direction?

If Bootstrap as a framework is really about getting started (unlike a framework like Rails or Django where it is about ongoing productivity throughout the life of your app), at some point, shouldn't you divorce yourself from the starter framework?

(As an example, if you clone an Angular starter repo to begin building your application, would you then come back 4 or 5 months later and try to merge updates to that starter repo into your now active application?)

PS. This is my first time asking a question here - if this isn't an appropriate type of question for this forum, i apologize in advance.

Foi útil?

Solução

You can think about updating Bootstrap the same way you would think about any other dependency.

  1. Does it introduce breaking changes?
  2. What benefits do you get from upgrading?
  3. Do the benefits outweigh the risk or time investment?

In the context of a CSS (and potentially JS, if you use the helper scripts) dependency, these questions can be thought of this way:

  1. If the class names used in Bootstrap change or the styles are significantly different which would break the styling on your site, this is a breaking change.
  2. You might get access to better modularized code, a shinier grid, etc.
  3. Getting improved benefits depends strongly on how much custom work you've already laid on top of your previous Bootstrap installation. If you've done a lot of work that depends on overriding the expected styles, it might not be worth it.

Personally, I consider CSS boilerplates to be set in stone for a project once I've started. I'm never going to modify the actual Bootstrap code itself, and I'm generally targeting the styles I want to specifically override from Bootstrap. This means that if I upgrade Bootstrap, many things will probably break in subtle ways that are hard to track down - for me, it's not worth the hassle for minimal gain. I'd just save using a new version of Bootstrap for the next application or next page.

The only exceptions I might see to this are pulling in the newer grid or layout-related code, but again, it depends on how much bespoke work you've done to the old version of your CSS dependencies.

Licenciado em: CC-BY-SA com atribuição
scroll top