From b75f286e866387107c842976b8461a761ed37da1 Mon Sep 17 00:00:00 2001 From: Jarrett Lusso Date: Thu, 22 Feb 2024 02:12:27 -0500 Subject: [PATCH 01/26] Improve localization helpers (#842) * Improve localization helpers - Added support for relative translation keys (ex: `t('.foo')`). - Added support for automatically marking translation keys ending with `_html` as `html_safe`. - Renamed methods to `translate` and `localize` with aliases of `t` and `l`. - Added tests * Updated documentation * Fix rubocop errors * Fix some test wording --- .../lib/bridgetown-core/helpers.rb | 42 ++++++++++++-- .../test/source/src/_locales/en.yml | 8 +++ bridgetown-core/test/test_ruby_helpers.rb | 58 ++++++++++++++++++- .../src/_docs/internationalization.md | 41 ++++++++++++- 4 files changed, 141 insertions(+), 8 deletions(-) create mode 100644 bridgetown-core/test/source/src/_locales/en.yml diff --git a/bridgetown-core/lib/bridgetown-core/helpers.rb b/bridgetown-core/lib/bridgetown-core/helpers.rb index 542dc4d97..0dd93f89f 100644 --- a/bridgetown-core/lib/bridgetown-core/helpers.rb +++ b/bridgetown-core/lib/bridgetown-core/helpers.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require "active_support/html_safe_translation" + module Bridgetown class RubyTemplateView class Helpers @@ -128,21 +130,49 @@ def attributes_from_options(options) safe(segments.join(" ")) end - # Forward all arguments to I18n.t method + # Delegates to I18n#translate but also performs two additional + # functions. + # + # First, if the key starts with a period translate will scope + # the key by the current view. Calling translate(".foo") from + # the people/index.html.erb template is equivalent to calling + # translate("people.index.foo"). This makes it less + # repetitive to translate many keys within the same view and provides + # a convention to scope keys consistently. + # + # Second, the translation will be marked as html_safe if the key + # has the suffix "_html" or the last element of the key is "html". Calling + # translate("footer_html") or translate("footer.html") + # will return an HTML safe string that won't be escaped by other HTML + # helper methods. This naming convention helps to identify translations + # that include HTML tags so that you know what kind of output to expect + # when you call translate in a template and translators know which keys + # they can provide HTML values for. # # @return [String] the translated string # @see I18n - def t(*args, **kwargs) - I18n.send :t, *args, **kwargs + def translate(key, **options) # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity + return key.map { |k| translate(k, **options) } if key.is_a?(Array) + + key = key&.to_s + + if key&.start_with?(".") + view_path = view&.page&.relative_path&.to_s&.split(".")&.first + key = "#{view_path.tr("/", ".")}#{key}" if view_path.present? + end + + ActiveSupport::HtmlSafeTranslation.translate(key, **options) end + alias_method :t, :translate - # Forward all arguments to I18n.l method + # Delegates to I18n.localize with no additional functionality. # # @return [String] the localized string # @see I18n - def l(*args, **kwargs) - I18n.send :l, *args, **kwargs + def localize(...) + I18n.localize(...) end + alias_method :l, :localize # For template contexts where ActiveSupport's output safety is loaded, we # can ensure a string has been marked safe diff --git a/bridgetown-core/test/source/src/_locales/en.yml b/bridgetown-core/test/source/src/_locales/en.yml new file mode 100644 index 000000000..9b00003ec --- /dev/null +++ b/bridgetown-core/test/source/src/_locales/en.yml @@ -0,0 +1,8 @@ +en: + about: + foo: foo + bar: bar + foo_html: foo + contacts: + bar: + foo: foo diff --git a/bridgetown-core/test/test_ruby_helpers.rb b/bridgetown-core/test/test_ruby_helpers.rb index e5d0f1532..0973d2ff7 100644 --- a/bridgetown-core/test/test_ruby_helpers.rb +++ b/bridgetown-core/test/test_ruby_helpers.rb @@ -6,7 +6,12 @@ class TestRubyHelpers < BridgetownUnitTest def setup @site = fixture_site @site.read - @helpers = Bridgetown::RubyTemplateView::Helpers.new(self, @site) + @helpers = Bridgetown::RubyTemplateView::Helpers.new( + Bridgetown::ERBView.new( + @site.collections.pages.resources.find { |p| p.basename_without_ext == "about" } + ), + @site + ) end context "link_to" do @@ -77,4 +82,55 @@ def setup assert_includes "

yes_var == "yes", falsy: nil, "more-falsy" => "no" == "yes"}\">classes!

", "

" end end + + context "translate" do + should "return translation when given a string" do + assert_equal "foo", @helpers.translate("about.foo") + end + + should "return translations when given an array" do + assert_equal %w[foo bar], @helpers.translate(%w[about.foo about.bar]) + end + + should "return html safe string when key ends with _html" do + assert @helpers.translate("about.foo_html").html_safe? + end + + should "not return html safe string when key does not end with _html" do + refute @helpers.translate("about.foo").html_safe? + end + + should "return relative translation when key starts with period" do + assert_equal "foo", @helpers.translate(".foo") + end + + should "return relative translation when key starts with period and view is in a folder" do + helpers = Bridgetown::RubyTemplateView::Helpers.new( + Bridgetown::ERBView.new( + @site.collections.pages.resources.find { |p| p.basename_without_ext == "bar" } + ), + @site + ) + assert_equal "foo", helpers.translate(".foo") + end + + should "return translation missing if key doesn't exist" do + assert_equal "Translation missing: en.about.not_here", @helpers.translate(".not_here") + end + + should "have alias method t" do + assert_equal @helpers.method(:translate), @helpers.method(:t) + end + end + + context "localize" do + should "return same output as I18n.localize" do + time = Time.now + assert_equal I18n.localize(time), @helpers.localize(time) + end + + should "have alias method l" do + assert_equal @helpers.method(:localize), @helpers.method(:l) + end + end end diff --git a/bridgetown-website/src/_docs/internationalization.md b/bridgetown-website/src/_docs/internationalization.md index 7c71bed37..442c35f2e 100644 --- a/bridgetown-website/src/_docs/internationalization.md +++ b/bridgetown-website/src/_docs/internationalization.md @@ -76,7 +76,11 @@ and in ERB: <%= t("welcome.intro") %> ``` -The Ruby helper in particular also supports variable interpolation. If you store a translation like this: +The Ruby helper in particular also supports some additional functionality. + +#### Variable Interpolation + +If you store a translation like this: ```yml en: @@ -90,6 +94,41 @@ Then you can pass that variable to the `t` helper: <%= t("products.price", price: resource.data.price) %> ``` +#### Relative page keys + +If you start your translation key starts with a period, we'll automatically scope the key to the page. For example, if the page is `about.html`: + +```erb +<%= t(".foo") %> +``` + +Will retrieve the key from: + +```yml +en: + about: + foo: Foo +``` + +Or if the page is `contact/about.html`: + +```yml +en: + contact: + about: + foo: Foo +``` + +#### Automatic HTML key safety + +If your translation key ends with `_html` or is `html`, it will automatically be marked `html_safe`. + +```yml +en: + products: + tagline_html: The best product! +``` + There are many other useful features of the **i18n** gem, so feel free to peruse the [Rails Guide to Internationalization](https://guides.rubyonrails.org/i18n.html) for additional documentation. {%@ Note do %} From 10bfa89e6d70fa34617744d09d372f48eee16bf8 Mon Sep 17 00:00:00 2001 From: Jarrett Lusso Date: Thu, 22 Feb 2024 02:20:09 -0500 Subject: [PATCH 02/26] Improve Netlify bundled configuration (#839) - Add support for using `netlify dev`. This is important if you want to test redirects or use functions. - Removed Link headers. This was breaking stuff locally and Netlify doesn't have a way to apply headers conditionally without using scripts. Honestly, I'm not sure it's really that important anyway. I checked a bunch of sites including Google, Cloudflare, Netlify, Apple, Stripe, and more. None of them set these headers. This simplifies stuff to remove them. --- .../bridgetown-core/configurations/netlify.rb | 2 -- .../configurations/netlify/netlify.sh | 13 ----------- .../configurations/netlify/netlify.toml | 22 +++++++++++-------- 3 files changed, 13 insertions(+), 24 deletions(-) delete mode 100755 bridgetown-core/lib/bridgetown-core/configurations/netlify/netlify.sh diff --git a/bridgetown-core/lib/bridgetown-core/configurations/netlify.rb b/bridgetown-core/lib/bridgetown-core/configurations/netlify.rb index 68c9aaf10..d4b61d236 100644 --- a/bridgetown-core/lib/bridgetown-core/configurations/netlify.rb +++ b/bridgetown-core/lib/bridgetown-core/configurations/netlify.rb @@ -1,5 +1,3 @@ # frozen_string_literal: true copy_file in_templates_dir("netlify.toml"), "netlify.toml" -copy_file in_templates_dir("netlify.sh"), "bin/netlify.sh" -`chmod a+x ./bin/netlify.sh` diff --git a/bridgetown-core/lib/bridgetown-core/configurations/netlify/netlify.sh b/bridgetown-core/lib/bridgetown-core/configurations/netlify/netlify.sh deleted file mode 100755 index 229fa0367..000000000 --- a/bridgetown-core/lib/bridgetown-core/configurations/netlify/netlify.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash -# Taken from https://docs.netlify.com/configure-builds/file-based-configuration/#inject-environment-variable-values - -echo "Updating netlify.toml with references to our built files" - -CSS_PATH=`find output/_bridgetown/static/*.css -type f | sed -e 's,output\/,/,g'` -JS_PATH=`find output/_bridgetown/static/*.js -type f | sed -e 's,output\/,/,g'` - -echo "CSS Path: ${CSS_PATH}" -echo "JS Path: ${JS_PATH}" - -sed -i s,CSS_PATH,${CSS_PATH},g netlify.toml -sed -i s,JS_PATH,${JS_PATH},g netlify.toml diff --git a/bridgetown-core/lib/bridgetown-core/configurations/netlify/netlify.toml b/bridgetown-core/lib/bridgetown-core/configurations/netlify/netlify.toml index f83d157bc..cd28b679c 100644 --- a/bridgetown-core/lib/bridgetown-core/configurations/netlify/netlify.toml +++ b/bridgetown-core/lib/bridgetown-core/configurations/netlify/netlify.toml @@ -1,5 +1,17 @@ +[dev] + command = "bin/bridgetown dev" + targetPort = 4000 + port = 8888 + publish = "output" + autoLaunch = true + framework = "#custom" + +[context.dev.build.environment] + NODE_ENV = "development" + BRIDGETOWN_ENV = "development" + [build] - command = "bin/bridgetown deploy && bin/netlify.sh" + command = "bin/bridgetown deploy" publish = "output" [build.environment] @@ -19,14 +31,6 @@ Referrer-Policy = "no-referrer-when-downgrade" Cache-Control = "public, max-age=604800, s-max-age=604800" -[[headers]] - for = "/" - [headers.values] - Link = [ - "; rel=preload; as=style", - "; rel=preload; as=script" - ] - [[headers]] for = "/*.(png|jpg|js|css|svg|woff|ttf|eot|ico|woff2)" [headers.values] From 80c0f9ebd33d11ebebaf5563a289d48877e76349 Mon Sep 17 00:00:00 2001 From: Jared White Date: Thu, 22 Feb 2024 09:44:11 -0800 Subject: [PATCH 03/26] Road to Bridgetown blog post --- bridgetown-website/Gemfile.lock | 18 ++-- bridgetown-website/src/_pages/community.md | 12 +-- bridgetown-website/src/_partials/_footer.serb | 4 +- ...road-to-bridgetown-2.0-escaping-burnout.md | 88 +++++++++++++++++++ 4 files changed, 103 insertions(+), 19 deletions(-) create mode 100644 bridgetown-website/src/_posts/2024/2024-02-22-road-to-bridgetown-2.0-escaping-burnout.md diff --git a/bridgetown-website/Gemfile.lock b/bridgetown-website/Gemfile.lock index 160d3c69a..7d0766662 100644 --- a/bridgetown-website/Gemfile.lock +++ b/bridgetown-website/Gemfile.lock @@ -1,13 +1,13 @@ PATH remote: ../bridgetown-builder specs: - bridgetown-builder (1.3.1) - bridgetown-core (= 1.3.1) + bridgetown-builder (1.3.2) + bridgetown-core (= 1.3.2) PATH remote: ../bridgetown-core specs: - bridgetown-core (1.3.1) + bridgetown-core (1.3.2) activemodel (>= 6.0, < 8.0) activesupport (>= 6.0, < 8.0) addressable (~> 2.4) @@ -34,16 +34,16 @@ PATH PATH remote: ../bridgetown-paginate specs: - bridgetown-paginate (1.3.1) - bridgetown-core (= 1.3.1) + bridgetown-paginate (1.3.2) + bridgetown-core (= 1.3.2) PATH remote: ../bridgetown specs: - bridgetown (1.3.1) - bridgetown-builder (= 1.3.1) - bridgetown-core (= 1.3.1) - bridgetown-paginate (= 1.3.1) + bridgetown (1.3.2) + bridgetown-builder (= 1.3.2) + bridgetown-core (= 1.3.2) + bridgetown-paginate (= 1.3.2) GEM remote: https://rubygems.org/ diff --git a/bridgetown-website/src/_pages/community.md b/bridgetown-website/src/_pages/community.md index 325a5cc4c..1af537830 100644 --- a/bridgetown-website/src/_pages/community.md +++ b/bridgetown-website/src/_pages/community.md @@ -9,15 +9,11 @@ title: Community ### Official Channels * Start by reading the [Bridgetown Documentation](/docs/). -* Kick off a discussion on the [Discussions Board on GitHub](https://github.com/bridgetownrb/bridgetown/discussions). -* Or chat with Bridgetowners live on our [Discord server](https://discord.gg/4E6hktQGz4). +* Kick off a discussion, browse useful tips, and share code & ideas in the [Bridgetown Community](https://community.bridgetown.pub) website. +* Or chat with Bridgetowners on our [Discord server](https://discord.gg/4E6hktQGz4). There are a bunch of helpful core team and community members available that should be able to point you in the right direction. -### Bridgetown Cards: Share what you know. Build what you learn. - -[Bridgetown Cards](https://bridgetown.cards) is a community site, for Bridgetowners, by Bridgetowners. Browse through a selection of tips & tricks, with accompanying code snippets, to help you get a leg up on your site build. Then when you come up with a cool new technique or pull in a sweet Ruby gem or neat-o NPM package, and want to share that know-how with others, [this is the place to do it](https://github.com/bridgetownrb/bridgetown-cards). Have fun! 😃 - ### Commercial Support There's also a growing number of companies which provide commercial support for advanced Bridgetown site builds. These include: @@ -50,7 +46,7 @@ There's also a growing number of companies which provide commercial support for [@jaredcwhite](https://github.com/jaredcwhite) • -[@ParamagicDev](https://github.com/ParamagicDev) • +[@KonnorRogers](https://github.com/KonnorRogers) • [@ayushn21](https://github.com/ayushn21) • [@adrianvalenz](https://github.com/adrianvalenz) {:style="text-align:center"} @@ -91,7 +87,7 @@ Whether you're a developer, designer, or overall Bridgetown enthusiast, there ar * Comment on some of the project's [open issues](https://github.com/{{ site.metadata.github }}/issues). Have you experienced the same problem? Know a work around? Do you have a suggestion for how the feature could be better? * Read through the [documentation](/docs/) and file a PR by forking the [Bridgetown repo on GitHub](https://github.com/{{ site.metadata.github }}/fork) and adding your changes or suggestions for something that could be improved. -* Browse through the latest [chat room activity](https://discord.gg/4E6hktQGz4) and lend a hand answering questions or proposing awesome new features. There's a good chance other folks are in the same boat as you. +* Browse through the latest [Community site posts](https://community.bridgetown.pub) or [chat activity](https://discord.gg/4E6hktQGz4) and lend a hand answering questions or proposing awesome new features. There's a good chance other folks are in the same boat as you. * Help evaluate [open pull requests](https://github.com/{{ site.metadata.github }}/pulls) by testing the changes locally and reviewing what's proposed. Or if you [have a PR you'd like to submit](https://github.com/bridgetownrb/bridgetown/blob/main/CONTRIBUTING.md) for a new feature or a bugfix, we'd be thrilled to evaluate it and guide it through the release cycle if it adheres to our [project goals](/docs/philosophy/). {%@ Note type: "warning" do %} diff --git a/bridgetown-website/src/_partials/_footer.serb b/bridgetown-website/src/_partials/_footer.serb index 4215d3142..27b0ac71e 100644 --- a/bridgetown-website/src/_partials/_footer.serb +++ b/bridgetown-website/src/_partials/_footer.serb @@ -23,7 +23,7 @@

- Contribute on GitHub + Contribute & Participate

@@ -34,7 +34,7 @@

- Discussions on GitHub
+ Community Site Discussions
Discord Chat

diff --git a/bridgetown-website/src/_posts/2024/2024-02-22-road-to-bridgetown-2.0-escaping-burnout.md b/bridgetown-website/src/_posts/2024/2024-02-22-road-to-bridgetown-2.0-escaping-burnout.md new file mode 100644 index 000000000..1593ebac7 --- /dev/null +++ b/bridgetown-website/src/_posts/2024/2024-02-22-road-to-bridgetown-2.0-escaping-burnout.md @@ -0,0 +1,88 @@ +--- +date: Thu, 22 Feb 2024 09:20:27 -0800 +title: Road to Bridgetown 2.0, Part 1 (Stuck in Burnout Marsh) +subtitle: In 2023 I very nearly walked away from Ruby. But after time to think and reflect, I arrived at a plan to make working on Bridgetown “fun” again. Now a new day dawns, and the ecosystem is poised to enter the next stage of this journey. +author: jared +category: future +--- + +**TL;DR:** Bridgetown 2.0 is now under active development! We have a new [Community discussion site](https://community.bridgetown.pub), based on Lemmy! Stay tuned for additional announcements coming soon of what’s next for the ecosystem! And now, on with the post
 + +---- + +A little known area of Bridgetown, upriver from where the tourists typically spend their time on vacation, is a treacherous stretch of water known as Burnout Marsh. My boat got mired there during the back half of 2023, and I barely escaped with my life. + +All right, enough of that clumsy metaphor. 😄 I didn’t want to have to write this post, believe me. I’d much rather just get on to all the juicy technical stuff that’s fun to talk about. Blog posts about “maintainer burnout” are as exciting to read as watching paint dry. It’s a bit akin to the celebrity complaining about how they have to hire security because they’re just so gosh darn famous. Like, dude, you’re famous OK? Quit yer whining before you look like an asshole. + +But the fact remains that maintainer burnout _is_ a thing, and it affects a lot of open source software projects. Everyone’s burnout looks a little different, and mine was no different in that way. A little bit of this (weird, weird time in the tech industry), a little bit of that (too many other irons in the fire), but mostly a particular thing (to be revealed momentarily) which affected the worst possible facet of my role as a maintainer of Ruby-based software: _my love of Ruby_. đŸ˜± + +Truth be told, **I nearly walked away.** 😞 + +And the reason is both complex and simple. Here’s the simple version: the social degradation of 37signals in general and David Heinemeier Hansson (DHH) in particular nearly robbed me of all the joy I felt programming in Ruby. 😬 + +Now nearly as distasteful to me as wallowing in “maintainer burnout” territory is wallowing in “framework authors taking potshots” territory. So you can imagine I’m _doubly_ not feeling great about where this is headed. I’ve written some version of this post over and over again in my head, and more than once in my drafts folder which _you’ll_ never see let me tell you right now. But like ripping off a Band-Aid, some things just have to be done. So here it goes. + +### The 37signals Problem + +I was aghast when the meltdown at 37signals happened in 2021. It was widely covered at the time, perhaps best by Casey Newton in several pieces such as [Behind the controversy at Basecamp](https://www.theverge.com/2021/4/27/22406673/basecamp-political-speech-policy-controversy) and [Inside the all-hands meeting that led to a third of Basecamp employees quitting](https://www.theverge.com/2021/5/3/22418208/basecamp-all-hands-meeting-employee-resignations-buyouts-implosion). At the time, I thought _surely_ there would need to be some reckoning with how DHH conducts himself within open source projects as well such as Rails and Hotwire. Perhaps Rails could set up a more transparent governance structure, or at the very least announce DHH stepping down from a position of influence for a while (while making a very public stand around proper Code of Conduct (CoC) etiquette). + +Not only did none of that happen đŸ€š, but DHH made a _huge_ stink about not being properly invited to keynote RailsConf again right away, leading to [RailsConf and DHH going their separate ways](https://thenewstack.io/railsconf-and-dhh-go-their-separate-ways/) and the eventual formation of the “Rails Foundation” and Rails World conferences. So
no such reckoning. DHH would maintain an iron grip on Rails indefinitely (this new foundation really just solidifying his personal influence rather than offering any sort of real check on his power or ego), and in fact go forward to “compete” with RubyCentral and RailsConf. đŸ˜© + +As if this wasn’t all bad enough, the next shoe to drop dropped
and in a very public way as these things are wont to do. Out of the blue, without warning to any regular contributors or other community members, 37signals (aka DHH) simply decided to remove TypeScript from the Hotwire Turbo codebase. Again, no opportunity for discussion, no time for a heads up or any sort of guidance on how it might affect existing contributions. Just **boom**, here’s the PR, insta-merge within hours, [self-congratulatory DHH post on HEY World](https://world.hey.com/dhh/turbo-8-is-dropping-typescript-70165c01), done. 😳 + +Folks, **this is not how you run an open source software project**. Somebody’s hobby project on GitHub that’s really just their own little playground, sure, I guess. But not something as consequential as, oh I dunno, _the frontend stack of the Ruby on Rails framework_ and a tool used even outside of Rails by other frameworks! đŸ€Ș + +Note carefully that none of what I’m saying or about to say has any bearing on the _merits_ of removing TypeScript. We can debate those merits at our leisure, and anyone who knows me knows I’m no big fan of TypeScript. But that’s not what this is about. This is about how people govern open source projects and conduct themselves among peers. + +Needless to say, this move to unexpectedly rip TypeScript out of Turbo generally went down like a lead balloon, and things got heated fast. That’s never a good sign (when long-time regular contributors to a project are themselves feeling pretty grumpy), and it eventually led to this seminal issue: [Remove DHH for CoC Violations · Issue \#977](https://github.com/hotwired/turbo/issues/977). + +To be very clear, nobody’s claiming that making the decision to remove TypeScript was a CoC violation, but the _manner_ in which it was done: with _zero_ involvement of the community and no consideration whatsoever (active hostility in fact) of broad feedback about the decision. I want to quote DHH’s posted response to this claim of CoC violation in full, because there simply is no way for me to read this without feeling enraged once again, and I want you to feel enraged too: + +> “This is elevating a disagreement of a technical decision to a level of nonsense that has no place here. This project has been founded, funded, and maintained predominantly by the resources and investment of 37signals. We will set the direction as we see fit, accepting input and contributions as they're presented, but with no guarantee of concurrence or merging. All the best finding a project that's more to your liking in direction or leadership or otherwise somewhere else 👋” + +Notice all the very specific language DHH employs here: + +* “nonsense” — regular readers of his blog know this to be code for “woke lefties” who would dare challenge his alt-right “edgelord” positioning on a variety of topics. Every time DHH’s political machinations are being publicly challenged, you’ll see the accusations of “nonsense” trotted out ([here’s but one example](https://world.hey.com/dhh/may-shopify-s-immunity-spread-to-the-whole-herd-7bd855ce)
stochastic terrorism is “nonsense” in DHH-speak, a product of “woke scolds”). +* “founded, funded, and maintained by
37signals” — in other words, you, dear contributor to the Turbo repo, don’t actually matter if you aren’t specifically part of the business entity known as 37signals. This is technically open source, sure, but the benefits mostly flow in a single direction. 37signals gets all the benefits of _your_ efforts to improve _their_ codebase, yet meanwhile you get none of the power. Yes, you get to use their code in the end, but that’s it. That’s the only benefit. _Whoop-dee-frickin’-doo._ +* “We will set the direction as we see fit” — and by “we” he means himself. DHH. The big kahuna. +* “All the best finding a project that's more to your liking” — aka if you don’t like how I run things, _fuck you_. + +Folks, there are times when situations are complicated, nuanced, with no real good guys or bad guys, and it’s genuinely hard to parse out what’s really going on and how to process the myriad of factors in order to arrive at a comprehensive decision. + +**This is not one of those times.** 😅 + +Clearly what we witnessed in this debacle is _far_ from a shining example of how one should govern an “open source” project. Perhaps it would be better described as “source available” — use the code, but don’t count on the stewards of the code to care for the needs of the community. And to get real specific, I am convinced that yes, DHH has indeed been in violation of his own CoC, and the real tragedy is _nobody has the power to call him on his own bullshit_. DHH is co-owner of 37signals, and 37signals controls all Hotwire intellectual property. + +Personally, I find DHH’s continued stranglehold over the Rails and Hotwire frameworks nauseating and thoroughly unacceptable. But ultimately, that’s not the hardest part of it for me. It’s all the carrying water for him that’s gone on in the broader community. People—and yes, good people all—still keep promoting Rails (and Rails World), keep releasing Ruby code and educational resources that prop up Rails as much if not more so as Ruby, and essentially keep DHH on his pedestal. + +**It’s enough to make you just want to up and quit Ruby.** Which I very nearly did. 😭 + +But, y’know, I gave myself lots of time to think and reflect. I chatted a lot with my close friends and fellow Bridgetown team mates. I mused on ways I might be able to make Bridgetown “fun” again, both in terms of ongoing maintenance as well as future feature development. I waited to see if maybe I could get my boat unstuck and past Burnout Marsh and start heading downriver towards calmer waters again. + +**And now I’ve arrived here.** 😌 + +---- + +### What’s Next for Bridgetown in 2024 + +This post kicks off a short blog series outlining some of the approach we’re taking to construct the next major release of Bridgetown, version 2.0. But it’s also an announcement: we have a new [Community site](https://community.bridgetown.pub) y’all! 🙌 + +Part of my general burnout in 2023 was just dealing with the absolute insanity which seems to have taken over the computer industry
not the least of which is the rapid “enshittification” of commercial social networks. It really got me paranoid—not only worrying about which services were actively going sideways (*cough* Reddit *cough*) but which might implode next in the future. Bridgetown has relied heavily on Discord, and to a lesser extent GitHub Discussions, and, well, I’ve been growing increasingly antsy about each. + +So rather than wait for more shitty developments and scramble to react to them, I decided to be proactive and set up a new [Bridgetown Community site](https://community.bridgetown.pub), based on Lemmy. This serves as a replacement to GitHub Discussions, and an adjunct to Discord. We’ll still rely on Discord for chit-chat (at least until something can serve as a truly suitable substitute) but look to the Community site for longer forum-style posts, technical conversations, tutorials, and something “bloggy” that’s a bit less formal than posting here on the main blog. There are some interesting tidbits there already, and I look forward to more folks in the Bridgetown ecosystem commenting there going forward! + +So let’s wrap up with a brief mention of what we’re announcing today as part of the “Road to Bridgetown 2.0” push. If you read my diatribe above, what I’ll say next probably won’t come as much of a shock. + +**We’ve begun the process of de-37signals-ifying Bridgetown.** (Now there’s a mouthful! 😆) + +Here’s what this means. We have put an immediate stop to integrating any more dependencies run by 37signals in Bridgetown. In practical terms, this means no additional embrace of libraries like Active Support, and no continued investment in bundled configurations such as Turbo or Stimulus (in fact we’ll be removing these for Bridgetown 2.0). And over time (this will be very much an incremental thing), we will either _remove_ our internal dependency on Rails libraries like Active Support or _vendor_ specific code we can’t easily replace. + +This is certainly not ideal. The Bridgetown codebase, and community at large, has benefited from the features provided by Active Support, Turbo, and other 37signals-run projects. But as DHH so emphatically put it, “all the best finding a project that's more to your liking in direction or leadership or otherwise somewhere else 👋”. So that’s _exactly_ what we are doing. We’ll be looking at other libraries — or in certain cases just building our own solutions — to replace the functionality we had relied on from 37signals. + +We take Bridgetown’s own [Code of Conduct](https://github.com/bridgetownrb/bridgetown/blob/main/CODE_OF_CONDUCT.md) seriously, and part of that approach means we need to be careful we don’t pull in third-party dependencies from open source projects which are themselves in violation of _their_ CoCs. We’re not in the business of policing the internet, nor can we ever vouch for all other open source projects we might ever touch in some way. But it was a _strategic decision_ originally to embrace codebases run by 37signals, and it is another strategic decision to let them go. I’ve talked about this at length with the rest of the Bridgetown core team, and we are in agreement that it’s in the best long-term interests of the Bridgetown project to take a public stand on this. + +So that is merely one aspect of the work that’s ongoing as we head towards Bridgetown 2.0. But thankfully, there’s a lot more that will no doubt prove more exciting and hopeful, from a minimum requirements bump to Ruby 3.1 and Node 20 to a _huge_ performance boost in development in the form of Signals-based Fast Refresh. More on that in the next blog post. + +The big takeaway is that I’m feeling more pumped about the future of Bridgetown than I have in many months. Between sorting out feelings of disappointment around past events, and coming up with a list of improvements to the project and the ecosystem I’m very excited to be moving forward on, a new day has dawned. 🌞 + +**Bridgetown 2.0 represents a sort of clean break**, not just because we can remove deprecated APIs, streamline aspects of the codebase, and improve features in ways that will help make the framework faster and more stable, but because version 0.x represents an experiment, 1.0 represents something stable yet still new, and 2.0 represents _longevity_. Bridgetown is here to stay. We have a full major version bump looming. And we hope you’ll stick around to see what comes next. đŸ€“ From 13d7f3e95d053e2312f78304fed2fcccb2ada990 Mon Sep 17 00:00:00 2001 From: Jared White Date: Thu, 22 Feb 2024 09:51:30 -0800 Subject: [PATCH 04/26] add discussion link --- .../2024/2024-02-22-road-to-bridgetown-2.0-escaping-burnout.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bridgetown-website/src/_posts/2024/2024-02-22-road-to-bridgetown-2.0-escaping-burnout.md b/bridgetown-website/src/_posts/2024/2024-02-22-road-to-bridgetown-2.0-escaping-burnout.md index 1593ebac7..ea9790a51 100644 --- a/bridgetown-website/src/_posts/2024/2024-02-22-road-to-bridgetown-2.0-escaping-burnout.md +++ b/bridgetown-website/src/_posts/2024/2024-02-22-road-to-bridgetown-2.0-escaping-burnout.md @@ -86,3 +86,6 @@ So that is merely one aspect of the work that’s ongoing as we head towards Bri The big takeaway is that I’m feeling more pumped about the future of Bridgetown than I have in many months. Between sorting out feelings of disappointment around past events, and coming up with a list of improvements to the project and the ecosystem I’m very excited to be moving forward on, a new day has dawned. 🌞 **Bridgetown 2.0 represents a sort of clean break**, not just because we can remove deprecated APIs, streamline aspects of the codebase, and improve features in ways that will help make the framework faster and more stable, but because version 0.x represents an experiment, 1.0 represents something stable yet still new, and 2.0 represents _longevity_. Bridgetown is here to stay. We have a full major version bump looming. And we hope you’ll stick around to see what comes next. đŸ€“ + +_Want to discuss this post? [Jump over to our Community site and add your comment](https://community.bridgetown.pub/post/11)_ 🔗 +{: style="text-align:center; margin-block-start: 1.5lh"} From b3005f0fd02821a1095397105200db0d7c164e2e Mon Sep 17 00:00:00 2001 From: Jared White Date: Thu, 22 Feb 2024 10:10:54 -0800 Subject: [PATCH 05/26] update homepage copy --- bridgetown-website/src/_pages/index.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bridgetown-website/src/_pages/index.md b/bridgetown-website/src/_pages/index.md index 8fe8accc6..53c0d1ac8 100644 --- a/bridgetown-website/src/_pages/index.md +++ b/bridgetown-website/src/_pages/index.md @@ -17,7 +17,7 @@ page_class: homepage ## A next-generation, progressive site generator & fullstack framework, powered by Ruby. {:style="color:var(--color-brick);"} -Built upon venerated open source technologies such as **Ruby**, **Puma**, and **Roda** — and grown on the fertile soil of **Rails** & **Jekyll** — **Bridgetown** puts power back in the hands of individuals to create extraordinary things. +Built upon venerated open source languages & technologies such as **Ruby**, **Puma**, **Roda**, and **esbuild**, **Bridgetown** puts power back in the hands of individuals to create extraordinary things. While your competitors are wrestling with complicated build tools, limited programming idioms, and mountains of boilerplate, **you’re out changing the world**. {:style="margin-left:auto; margin-right:auto; max-width:43em"} @@ -128,7 +128,7 @@ Looking for [0.2x documentation](https://bridgetown-v0.onrender.com/)? ## Build fast. Deploy fast. Serve fast. {:.serif .colorful} -Like the Ruby language itself, **Bridgetown** is optimized for [web developer happiness](/docs/philosophy). Express yourself in code which is elegant and maintainable. Bundled configurations and community resources like our [Discord Chat](https://discord.gg/4E6hktQGz4) and [Bridgetown Cards](https://bridgetown.cards) help you quickly get a leg up. Go from zero to hero in no time with HTML-first build artifacts and rapid Git-based deployment on services like [Render](https://www.render.com). +Like the Ruby language itself, **Bridgetown** is optimized for [web developer happiness](/docs/philosophy). Express yourself in code which is elegant and maintainable. Bundled configurations and resources like our [Bridgetown Community Site](https://community.bridgetown.pub) and [Discord Chat](https://discord.gg/4E6hktQGz4) help you quickly get a leg up. Go from zero to hero in no time with HTML-first build artifacts and rapid Git-based deployment on services like [Render](https://www.render.com).

@@ -244,7 +244,7 @@ Bridgetown's philosophy is if we take the time to build what you'll actually nee ### Modern Frontend Build System - Bridgetown sets you up with blazing-fast, zero-config esbuild & PostCSS. Or pick Webpack if you prefer. Either way, add modern JavaScript libraries like Turbo, Stimulus, Lit, even Preact with a simple command. Install comprehensive component libraries such as Shoelace for rapid UI development. Go big with interactive functionality or stay minimalist for that “zero JS" experience. It's totally your choice. + Bridgetown sets you up with blazing-fast, zero-config esbuild & PostCSS. Add modern CSS starter kits and JavaScript libraries in a performant way with a few simple commands. Install comprehensive component libraries such as Shoelace for rapid UI development. Go big with interactive functionality or stay minimalist for that “zero JS" experience. It's totally your choice.

Read the Docs @@ -257,7 +257,7 @@ Bridgetown's philosophy is if we take the time to build what you'll actually nee ### Sky-High Plugin Architecture - Bridgetown might just be the easiest way to get started learning and writing Ruby code. Craft custom plugins to enhance your site build and content with a straightforward DSL and make huge strides in only a few lines! If you already have experience writing Rails apps, you should feel right at home. (Yes, we love Active Support too!) + Bridgetown might just be the easiest way to get started learning and writing Ruby code. Craft custom plugins to enhance your site build and content with a straightforward DSL and make huge strides in only a few lines! And if you already have experience writing Ruby apps in other frameworks, you should feel right at home.

Read the Docs @@ -278,7 +278,7 @@ Bridgetown's philosophy is if we take the time to build what you'll actually nee

-Then when you're ready, [bundled configurations](/docs/bundled-configurations) and [plugins](/plugins) can take you even farther. Add SEO/social graph support, news feeds, inlined SVGs, asset management integration, headless CMS integration, automated testing, islands architecture, Turbo, Shoelace, Lit SSR + Hydration, and a whole lot more. +Then when you're ready, [bundled configurations](/docs/bundled-configurations) and [plugins](/plugins) can take you even farther. Add SEO/social graph support, news feeds, inlined SVGs, asset management integration, headless CMS integration, automated testing, islands architecture, Shoelace, Lit SSR + Hydration, and a whole lot more. {:style="text-align:center; margin-top:3rem; margin-left:auto; margin-right:auto; max-width:50em"}

From f2f259423f1ac73bcb65452c5344090a6506b833 Mon Sep 17 00:00:00 2001 From: Jarrett Lusso Date: Sun, 25 Feb 2024 18:11:05 -0500 Subject: [PATCH 06/26] Add dynamic deployment documentation (#850) When I was trying to deploy Bridgetown dynamically, i struggled to find any documentation on how to best go about it. --- bridgetown-website/src/_docs/deployment.md | 50 ++++++++++++++++++++-- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/bridgetown-website/src/_docs/deployment.md b/bridgetown-website/src/_docs/deployment.md index bfd83dd85..1e17dbccb 100644 --- a/bridgetown-website/src/_docs/deployment.md +++ b/bridgetown-website/src/_docs/deployment.md @@ -44,6 +44,10 @@ Some popular services include: [Netlify](https://www.netlify.com) is a web developer platform which focuses on productivity and global scale without requiring costly infrastructure. Get set up with continuous deployment, lead gen forms, one click HTTPS, and so much more. +### Fly.io + +[Fly.io](https://fly.io) is a platform that focuses on container based deployment. Their service transforms containers into micro-VMs that run on hardware all across the globe. The section below on [Docker](/docs/deployment#docker) has some examples that can be used with Fly. + ## Manual Deployment For a simple method of deployment, you can simply transfer the contents of your `output` folder to any web server. You can use something like `scp` to securely copy the folder, or you can use a more advanced tool: @@ -56,7 +60,11 @@ rsync in the [Digital Ocean tutorial](https://www.digitalocean.com/community/tut ### Docker -Many modern hosting solutions support deploying a `Dockerfile`. Building a Bridgetown site for one of these services is as easy as adding this file to a `Dockerfile` in the root directory of your project: +Many modern hosting solutions support deploying with a `Dockerfile`. Building a Bridgetown site for one of these services is as easy as creating a `Dockerfile` in the root directory of your project. See the examples below. + +#### Static Site + +If you're simply looking to deploy a static version of your site. ```Dockerfile # Build frontend JS and CSS assets using ESbuild @@ -85,11 +93,45 @@ FROM pierrezemb/gostatic COPY --from=bridgetown_builder /app/output /srv/http/ ``` -A `Dockerfile` like this could be used, for example, to [deploy a static website to Fly.io](https://fly.io/docs/languages-and-frameworks/static/). +#### Dynamic Site + +If you're looking to use things like [Dynamic Routes & SSR](/docs/routes). + +```Dockerfile +ARG RUBY_VERSION=3.2.2 +FROM ruby:$RUBY_VERSION-slim as base + +ENV VOLTA_HOME=/usr/local + +RUN apt-get update &&\ + apt-get install --yes build-essential git curl + +RUN curl https://get.volta.sh | bash &&\ + volta install node@lts yarn@latest + +WORKDIR /app + +FROM base as gems +COPY Gemfile* . +RUN bundle install + +FROM base +COPY . . +COPY --from=base $VOLTA_HOME/bin $VOLTA_HOME/bin +COPY --from=base $VOLTA_HOME/tools $VOLTA_HOME/tools +COPY --from=base /app /app +COPY --from=gems /usr/local/bundle /usr/local/bundle + +RUN yarn install +RUN bundle exec bridgetown frontend:build + +EXPOSE 4000 +CMD bundle exec bridgetown start +``` ### GitLab Pages -[GitLab pages](https://docs.gitlab.com/ee/user/project/pages/) can host static websites. Create a repository on GitLab, +[GitLab pages](https://docs.gitlab.com/ee/user/project/pages/) can host static websites. Create a repository on GitLab, which we suppose is at https://gitlab.com/bridgetownrb/mysite Add the following .gitlab-ci.yml file to your project, which we shall suppose is called `mysite` following the documentation setup [instructions](/docs/). The .gitlab-ci.yml file should be in the mysite directory created using `bridgetown new mysite` and should contain @@ -173,7 +215,7 @@ For more details, [see the documentation](https://docs.gitlab.com/ee/user/projec ### GitHub Pages -Much like with GitLab, you can also deploy static sites to [GitHub Pages](https://pages.github.com/). You can make use of [GitHub Actions](https://github.com/features/actions) to automate building and deploying your site to GitHub Pages. +Much like with GitLab, you can also deploy static sites to [GitHub Pages](https://pages.github.com/). You can make use of [GitHub Actions](https://github.com/features/actions) to automate building and deploying your site to GitHub Pages. Bridgetown includes a [bundled configuration to set up GitHub pages](/docs/bundled-configurations#github-pages-configuration). You can apply it with the following command: From 854eca8d83f5bfa4910ed54c154cac7daccfc373 Mon Sep 17 00:00:00 2001 From: Jarrett Lusso Date: Sun, 25 Feb 2024 20:11:47 -0500 Subject: [PATCH 07/26] Add notice to Tailwind CSS blog post about bundled configuration (#849) * Add notice to Tailwind CSS blog post about bundled configuration Closes: #785 * Adjust wording --- .../2020/2020-05-07-postcss-tailwind-plugins-oh-my.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bridgetown-website/src/_posts/2020/2020-05-07-postcss-tailwind-plugins-oh-my.md b/bridgetown-website/src/_posts/2020/2020-05-07-postcss-tailwind-plugins-oh-my.md index 9bdcf2150..d3ded96de 100644 --- a/bridgetown-website/src/_posts/2020/2020-05-07-postcss-tailwind-plugins-oh-my.md +++ b/bridgetown-website/src/_posts/2020/2020-05-07-postcss-tailwind-plugins-oh-my.md @@ -5,12 +5,17 @@ author: jared category: news --- +{%@ Note type: :warning do %} + #### This post is a bit outdated! + Since writing this post, automations were added to Bridgetown. To start using Tailwind CSS with Bridgetown, check out the [community-maintained automation](https://github.com/bridgetownrb/tailwindcss-automation). +{% end %} + Personally, [I'm a Bulma man myself](https://bulma.io), but I understand there are a ton of you out there who love [Tailwind CSS](https://tailwindcss.com) and won't give it up until they pry it out of your cold, dead hands. So I'm pleased as Ruby-colored punch to [highlight this breezy tutorial by Andrew Mason][andrewm-blog] all about how you can quickly and easily set up a new Bridgetown website with Tailwind CSS and PostCSS. From the [article][andrewm-blog]: - + > If you have had Ruby/Rails/Jekyll experience, you should feel right at home with Bridgetown. Bridgetown also removes the barrier to entry for integrating webpack and all the goodies the JavaScript community has to offer. [andrewm-blog]: https://andrewm.codes/blog/build-and-deploy-a-static-site-with-ruby-bridgetown-tailwindcss-and-netlify/ From c8382f508d81c7f58b314e11842e472a5618332c Mon Sep 17 00:00:00 2001 From: Jared White Date: Thu, 29 Feb 2024 08:24:51 -0800 Subject: [PATCH 08/26] New Baselines --- ...29-road-to-bridgetown-2.0-new-baselines.md | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 bridgetown-website/src/_posts/2024/2024-02-29-road-to-bridgetown-2.0-new-baselines.md diff --git a/bridgetown-website/src/_posts/2024/2024-02-29-road-to-bridgetown-2.0-new-baselines.md b/bridgetown-website/src/_posts/2024/2024-02-29-road-to-bridgetown-2.0-new-baselines.md new file mode 100644 index 000000000..c1eaa73a5 --- /dev/null +++ b/bridgetown-website/src/_posts/2024/2024-02-29-road-to-bridgetown-2.0-new-baselines.md @@ -0,0 +1,88 @@ +--- +date: Thu, 29 Feb 2024 08:14:56 -0800 +title: Road to Bridgetown 2.0, Part 2 (New Baselines) +subtitle: Announcing a solid set of defaults we believe will make Bridgetown that much more robust, appealing, and ready to tackle the challenges of tomorrow. +author: jared +category: future +--- + +> “And blood-black nothingness began to spin
a system of cells interlinked within cells interlinked within cells interlinked within one stem
and dreadfully distinct against the dark, a tall white fountain played.” +{: style="text-align:center; margin-inline: 1.25vw"} + +OK OK, not that [baseline](https://www.youtube.com/watch?v=1h-seEowtDw). 😜 + +Rather, what we're talking about are **technology baselines**. Minimum language version requirements. Language syntaxes. Tool dependencies. That sort of thing. + +The **Bridgetown 2.0** release cycle lets us reset some of these baselines, moving the framework into a more modern era without sacrificing developer experience or causing major upgrade headaches. For the most part, you should be able to keep your projects running with few (if any) changes. But of course, with a little spit and polish, you'll be able to take full advantage of improvements lower in the stack. + +Let's step through the various baselines we'll be providing in Bridgetown 2.0. + +### Ruby 3.1 + +Bridgetown 3.1 will require a **minimum Ruby version of 3.1**. Our policy is that for each major version number increment (in this case, v2), we will move the minimum Ruby version to two yearly releases prior to the current one. Since today's Ruby version is 3.3, that allows us to support Ruby 3.1 and 3.2 as well. + +Because we're moving from the past minimum of Ruby 2.7 to 3.1, this opens up a whole new world of Ruby v3 syntax and functionality being made available to the Bridgetown ecosystem. I wrote about [some of my favorite Ruby 3.1 features](https://www.fullstackruby.dev/ruby-3-fundamentals/2021/01/06/everything-you-need-to-know-about-destructuring-in-ruby-3/) over two years ago! And even more has happened since with the releases of Ruby 3.2 and 3.3. (YJIT, anyone?) + +We suspect many Bridgetown projects are already on Ruby 3, and for those still using Ruby 2.7, the upgrade process to switch to at least 3.1 should be fairly smooth. + +### Node 20 + +Until recently, for a good window of time it seemed like the particular version of Node you happened to be running wasn't a huge deal since Bridgetown's use of Node has been almost exclusively relegated to compiling frontend assets. + +While that will continue to be the case, we are making some specific, intentional changes to *how* Bridgetown integrates with Node. In order to streamline these efforts, it makes sense to standardize on newer versions of Node. + +As of the time of this writing Node 21 is the current production release, but as we suspect Node 22 is right around the corner (based on Node's yearly release schedule), we are jumping the gun just a tad and going with **Node 20** as our baseline (since essentially that will be two versions prior to current once Bridgetown 2.0 is released later in Q2). + +Which brings us to: + +### ESM + +The JavaScript NPM ecosystem has been stumbling towards its goal of coalescing around ES Modules (ESM), rather than CommonJS, for quite a long time now. It feels like we've arrived at the moment when it's now or never, so let's do it now. For those of you only vaguely aware of what the differences are, here it is in a nutshell: + +```js +const path = require("path") // CommonJS + +import path from "path" // ESM +``` + +Yes, for those of you asking, ESM has been the _only_ way you write JavaScript for client-side purposes (since ES6 anyway). Yet Node's historical CommonJS manner of importing and exporting modules and packages has persisted on the server. The end is nigh though, as universal ESM syntax has been embraced more and more throughout the ecosystem. + +There are two ways to instruct Node to use ESM instead of CommonJS. You can name JavaScript file extensions as `.mjs`. Or you can add `"type": "module"` to your `package.json` file. + +For Bridgetown 2.0, **we will be opting for that latter option**, and all configuration files for tools like esbuild and PostCSS will be supplied in ESM format. CommonJS will still work in your existing projects, but for all new projects, it will be all ESM, all the time! 👏 + +### Farewell Yarn + +When the Bridgetown framework first launched in 2020, many people considered Yarn to be a better package manager than Node's built-in `npm` solution. Many frameworks had built up around it, and even Ruby on Rails had embraced it. + +But time doesn't stand still, and neither did npm because at this point, it works just as well as "classic" Yarn and newer versions of Yarn ended up causing headaches due to changing designs, syntax, and feature-set sweet spots. + +So in Bridgetown 2.0, we're greatly simplifying and **migrating to using npm by default**. You still have the *option* of keeping classic Yarn around for use in your existing Bridgetown projects—or you can switch over to npm or even another popular package manager, [pnpm](https://pnpm.io/). We'll focus on npm out of the box, but switching to pnpm should you wish it will be straightforward (we've actually supported it in the most recent v1.x releases anyway). + +### Farewell Webpack + +Bridgetown has defaulted to using esbuild for its frontend bundler for some time now, but with Bridgetown 2.0 **we'll be removing official support for Webpack**. This does mean we recommend migrating your projects from Webpack over to esbuild *as soon as possible*, since we have no guarantee Webpack will continue to work once Bridgetown 2.0 arrives. + +The writing has been on the wall for some time, as the entire web industry generally pivots away from Webpack and towards more modern solutions like esbuild (Vite, Turbopack, and Parcel being some other popular options). + +The good news is that we continue to feel *extremely* satisfied with our embrace of esbuild. I personally like to say that esbuild is the "last bundler" I'll ever use. And I really believe that. I see no reason years from now why esbuild won't still be perfectly adequate to perform the sorts of lightweight frontend bundling and asset pipeline tasks Bridgetown users typically require. It's nice to have that level of confidence in a framework dependency. + +### ERB by Default + +And last but certainly not least, we'll be switching away from Liquid as our default out-of-the-box template engine and over to ERB. Bridgetown is a Ruby framework after all, and **ERB is the template language most Rubyists are familiar with**. The reason we ever defaulted to Liquid in the first place was an historical one
Jekyll defaulted to Liquid—and in fact _only_ supports Liquid (you have to install a third-party plugin to get some sort of ERB support). But with Bridgetown having supported ERB for years now, it makes sense to go ERB-first. + +However, we have a few tricks up our sleeve—some extra features in the works to bring [Serbea-like pipelines over to ERB](https://www.serbea.dev/#add-pipelines-to-any-ruby-templates), as well as a new DSL based on procs & heredocs called **Streamlined** you can use instead of ERB in certain parts of your codebase to generate complicated HTML quickly and efficiently. (This is essentially our answer to "tag builders.") + +And for that **maximum cool factor**, we'll be unveiling an optional, first-party solution to server-rendering **web components** which can later be hydrated and become interactive on the client-side. We've already offered a solution of sorts along these lines with our [integration of Lit-based web components](https://www.bridgetownrb.com/docs/components/lit). However, this new solution will provide a whole new component format—one which takes further advantage of Ruby as well as the proposed [HTML Modules](https://github.com/WICG/webcomponents/blob/gh-pages/proposals/html-modules-explainer.md) spec. *Ooo
exciting!* + +(Note that we'll be retiring first-party support for Haml and Slim. I don't wish to step on anybody's toes, but template syntaxes based around indentation/whitespace rules just aren't on the radar of frontend developers by and large. I would argue they feel more like an artifact of Ruby's past than anything modern developers are looking for. Let's rally around writing HTML templates in ways which frontend devs can feel comfortable with and get up to speed on quickly.) + +### Wrap Up + +So there you have it: **Ruby 3.1. Node 20. npm. esbuild. ERB and a whole lot more.** A solid set of defaults we believe will make Bridgetown that much more robust, appealing, and ready to tackle the challenges of tomorrow. + +There are also some efforts underway to streamline parts of Bridgetown's internals to make it easier for contributors and maintainers. Besides simply removing a handful of small deprecations, we're in the process of completely moving away from Cucumber and towards standard Minitest for integration tests to bring them in line with the rest of the automated test suite. You can [read more about these efforts](https://community.bridgetown.pub/post/10) on the community site. + +Along with quality-of-life and maintenance improvements, we hope to make progress in increasing the build performance of Bridgetown. Perhaps not so much in production per se (where, to be honest, it's less critical—the difference in your site rebuilding in CI in 12 seconds vs. 6 actually doesn't matter much), *but most definitely in development*. We all know how frustrating it can be to make a small text change and then have to wait seconds—maybe even tens of seconds!—before the page will refresh in your browser. We have a solution in mind called **Fast Refresh** based on the principles of Signals, using the [Signalize gem](https://github.com/whitefusionhq/signalize) which is a Ruby port of Preact Signals. It's not quite an "incremental build" type of solution, but it'll get us where we need to go. More on all that in the next installment of *Road to Bridgetown 2.0*. + +Until then, hop on over to our community site and let us know what you're most excited about regarding these changes in Bridgetown 2.0. As always, your feedback is most welcome! From 0e10adf601bf47c621505aa02d1247951a99e905 Mon Sep 17 00:00:00 2001 From: Jared White Date: Thu, 29 Feb 2024 08:35:42 -0800 Subject: [PATCH 09/26] Add discussion link and other fixes --- bridgetown-website/src/_data/authors.yml | 2 +- bridgetown-website/src/_pages/authors/[author].serb | 6 +++--- .../2024/2024-02-29-road-to-bridgetown-2.0-new-baselines.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bridgetown-website/src/_data/authors.yml b/bridgetown-website/src/_data/authors.yml index 122f4c861..f45a54a9c 100644 --- a/bridgetown-website/src/_data/authors.yml +++ b/bridgetown-website/src/_data/authors.yml @@ -1,7 +1,7 @@ jared: name: Jared White avatar: /images/jared-white-avatar.jpg - twitter: jaredcwhite + mastodon: indieweb.social/@jaredwhite website: https://jaredwhite.com margaret: name: Margaret Berry diff --git a/bridgetown-website/src/_pages/authors/[author].serb b/bridgetown-website/src/_pages/authors/[author].serb index f5b43873e..03992870a 100644 --- a/bridgetown-website/src/_pages/authors/[author].serb +++ b/bridgetown-website/src/_pages/authors/[author].serb @@ -18,7 +18,7 @@ prototype: {% end %}

- +

{% author = page.data.author_data %} @@ -28,8 +28,8 @@ prototype: on the Web or on - {% if author.twitter %} - Twitter + {% if author.mastodon %} + Mastodon {% elsif author.github %} GitHub {% end %} diff --git a/bridgetown-website/src/_posts/2024/2024-02-29-road-to-bridgetown-2.0-new-baselines.md b/bridgetown-website/src/_posts/2024/2024-02-29-road-to-bridgetown-2.0-new-baselines.md index c1eaa73a5..0e674b6a0 100644 --- a/bridgetown-website/src/_posts/2024/2024-02-29-road-to-bridgetown-2.0-new-baselines.md +++ b/bridgetown-website/src/_posts/2024/2024-02-29-road-to-bridgetown-2.0-new-baselines.md @@ -85,4 +85,4 @@ There are also some efforts underway to streamline parts of Bridgetown's interna Along with quality-of-life and maintenance improvements, we hope to make progress in increasing the build performance of Bridgetown. Perhaps not so much in production per se (where, to be honest, it's less critical—the difference in your site rebuilding in CI in 12 seconds vs. 6 actually doesn't matter much), *but most definitely in development*. We all know how frustrating it can be to make a small text change and then have to wait seconds—maybe even tens of seconds!—before the page will refresh in your browser. We have a solution in mind called **Fast Refresh** based on the principles of Signals, using the [Signalize gem](https://github.com/whitefusionhq/signalize) which is a Ruby port of Preact Signals. It's not quite an "incremental build" type of solution, but it'll get us where we need to go. More on all that in the next installment of *Road to Bridgetown 2.0*. -Until then, hop on over to our community site and let us know what you're most excited about regarding these changes in Bridgetown 2.0. As always, your feedback is most welcome! +Until then, [hop on over to our community site and let us know](https://community.bridgetown.pub/post/12) what you're most excited about regarding these changes in Bridgetown 2.0. As always, your feedback is most welcome! From 1b7e40c504991f6cfc4abcfc5731eb08e0f4d4c9 Mon Sep 17 00:00:00 2001 From: Ayush Newatia Date: Tue, 5 Mar 2024 17:34:53 +0000 Subject: [PATCH 10/26] Fix spelling of cuprite (#859) --- bridgetown-website/src/_docs/routes.md | 2 +- .../src/_posts/2021/2021-10-24-era-of-bridgetown-v1.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bridgetown-website/src/_docs/routes.md b/bridgetown-website/src/_docs/routes.md index 888f77825..a5cfdddaf 100644 --- a/bridgetown-website/src/_docs/routes.md +++ b/bridgetown-website/src/_docs/routes.md @@ -154,7 +154,7 @@ This is a contrived example of course, but you can easily imagine loading a spec You can even use placeholders in folder names! A route saved to `src/_routes/books/[id]/chapter/[chapter_id].erb` would match to something like `/books/234259/chapter/5` and let you access `r.params[:id]` and `r.params[:chapter_id]`. Pretty nifty. -Testing is straightforward as well. Simply place `.test.rb` files alongside your routes, and you’ll be able to use Capybara to write **fast** integration tests including interactions requiring Javascript (assuming Cupite is also installed). (_docs coming soon_) +Testing is straightforward as well. Simply place `.test.rb` files alongside your routes, and you’ll be able to use Capybara to write **fast** integration tests including interactions requiring Javascript (assuming Cuprite is also installed). (_docs coming soon_) To opt-into the `bridgetown-routes` gem, make sure it's enabled in your `Gemfile`: diff --git a/bridgetown-website/src/_posts/2021/2021-10-24-era-of-bridgetown-v1.md b/bridgetown-website/src/_posts/2021/2021-10-24-era-of-bridgetown-v1.md index f9a735263..99f68da0e 100644 --- a/bridgetown-website/src/_posts/2021/2021-10-24-era-of-bridgetown-v1.md +++ b/bridgetown-website/src/_posts/2021/2021-10-24-era-of-bridgetown-v1.md @@ -122,7 +122,7 @@ This is a contrived example of course, but you can easily imagine loading a spec You can even use placeholders in folder names! A route saved to `src/_routes/books/[id]/chapter/[chapter_id].erb` would match to something like `/books/234259/chapter/5` and let you access `r.params[:id]` and `r.params[:chapter_id]`. Pretty nifty. -Testing is straightforward as well. Simply place `.test.rb` files alongside your routes, and you’ll be able to use Capybara to write **fast** integration tests including interactions requiring Javascript (assuming Cupite is also installed). +Testing is straightforward as well. Simply place `.test.rb` files alongside your routes, and you’ll be able to use Capybara to write **fast** integration tests including interactions requiring Javascript (assuming Cuprite is also installed). Rest assured, a **full setup guide & tutorial** for all this stuff is on its way. ([Want to get it sooner?](https://fundraising.bridgetownrb.com) 😉) From 628028c231e118c339575ac7f700a12a85ae7d53 Mon Sep 17 00:00:00 2001 From: Lucas Dohmen Date: Thu, 14 Mar 2024 06:13:19 +0100 Subject: [PATCH 11/26] esbuild: Add missing image formats to the file endings loaded as files (#863) --- bridgetown-website/config/esbuild.defaults.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bridgetown-website/config/esbuild.defaults.js b/bridgetown-website/config/esbuild.defaults.js index 104f973a8..f15964469 100644 --- a/bridgetown-website/config/esbuild.defaults.js +++ b/bridgetown-website/config/esbuild.defaults.js @@ -318,9 +318,13 @@ module.exports = async (esbuildOptions, ...args) => { bundle: true, loader: { ".jpg": "file", + ".jpeg": "file", ".png": "file", ".gif": "file", ".svg": "file", + ".avif": "file", + ".jxl": "file", + ".webp": "file", ".woff": "file", ".woff2": "file", ".ttf": "file", From c7738e495eef69eb3c18c921da88b24d2d8dd56e Mon Sep 17 00:00:00 2001 From: Matias Korhonen Date: Fri, 15 Mar 2024 05:15:23 +0200 Subject: [PATCH 12/26] Relax the Rouge version requirement (#864) --- Gemfile.lock | 7 +++++-- bridgetown-core/bridgetown-core.gemspec | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index d9907e24a..7166e23ee 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -25,7 +25,7 @@ PATH listen (~> 3.0) rake (>= 13.0) roda (~> 3.46) - rouge (~> 3.0) + rouge (>= 3.0, < 5.0) serbea (~> 1.0) thor (~> 1.1) tilt (~> 2.0) @@ -152,6 +152,9 @@ GEM nokogiri (1.16.0-x86_64-linux) racc (~> 1.4) nokolexbor (0.5.2) + nokolexbor (0.5.2-arm64-darwin) + nokolexbor (0.5.2-x86_64-darwin) + nokolexbor (0.5.2-x86_64-linux) parallel (1.24.0) parser (3.2.2.4) ast (~> 2.4.1) @@ -173,7 +176,7 @@ GEM rexml (3.2.6) roda (3.75.0) rack - rouge (3.30.0) + rouge (4.2.0) rspec (3.12.0) rspec-core (~> 3.12.0) rspec-expectations (~> 3.12.0) diff --git a/bridgetown-core/bridgetown-core.gemspec b/bridgetown-core/bridgetown-core.gemspec index 610ad74b9..7850d2d9d 100644 --- a/bridgetown-core/bridgetown-core.gemspec +++ b/bridgetown-core/bridgetown-core.gemspec @@ -48,7 +48,7 @@ Gem::Specification.new do |s| s.add_runtime_dependency("listen", "~> 3.0") s.add_runtime_dependency("rake", ">= 13.0") s.add_runtime_dependency("roda", "~> 3.46") - s.add_runtime_dependency("rouge", "~> 3.0") + s.add_runtime_dependency("rouge", [">= 3.0", "< 5.0"]) s.add_runtime_dependency("serbea", "~> 1.0") s.add_runtime_dependency("thor", "~> 1.1") s.add_runtime_dependency("tilt", "~> 2.0") From c8ab4a1871ba86e533f02857169de40b1fc5e84f Mon Sep 17 00:00:00 2001 From: Matthew Pace Date: Thu, 14 Mar 2024 23:17:48 -0400 Subject: [PATCH 13/26] move site and collections console commands to locals (#853) --- .../lib/bridgetown-core/commands/console.rb | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/bridgetown-core/lib/bridgetown-core/commands/console.rb b/bridgetown-core/lib/bridgetown-core/commands/console.rb index bace48fac..544ae547b 100644 --- a/bridgetown-core/lib/bridgetown-core/commands/console.rb +++ b/bridgetown-core/lib/bridgetown-core/commands/console.rb @@ -2,17 +2,11 @@ module Bridgetown module ConsoleMethods - def site - Bridgetown::Current.site - end - - def collections - site.collections - end - def reload! Bridgetown.logger.info "Reloading site..." + site = Bridgetown::Current.site + I18n.reload! # make sure any locale files get read again Bridgetown::Hooks.trigger :site, :pre_reload, site Bridgetown::Hooks.clear_reloadable_hooks @@ -98,7 +92,14 @@ def console # rubocop:disable Metrics IRB::ExtendCommandBundle.include ConsoleMethods IRB.setup(nil) - workspace = IRB::WorkSpace.new + workspace = IRB::WorkSpace.new( + begin + site = Bridgetown::Current.site + collections = site.collections + + binding + end + ) irb = IRB::Irb.new(workspace) IRB.conf[:IRB_RC]&.call(irb.context) IRB.conf[:MAIN_CONTEXT] = irb.context From dc08da22084dee5dc5d4d828d0c0e171ce0ec0c4 Mon Sep 17 00:00:00 2001 From: Jared White Date: Thu, 14 Mar 2024 20:33:19 -0700 Subject: [PATCH 14/26] switch approach again for console access to `site` and `collections` --- .../lib/bridgetown-core/commands/console.rb | 11 +++-------- bridgetown-website/Gemfile.lock | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/bridgetown-core/lib/bridgetown-core/commands/console.rb b/bridgetown-core/lib/bridgetown-core/commands/console.rb index 544ae547b..9b1e43bca 100644 --- a/bridgetown-core/lib/bridgetown-core/commands/console.rb +++ b/bridgetown-core/lib/bridgetown-core/commands/console.rb @@ -92,14 +92,9 @@ def console # rubocop:disable Metrics IRB::ExtendCommandBundle.include ConsoleMethods IRB.setup(nil) - workspace = IRB::WorkSpace.new( - begin - site = Bridgetown::Current.site - collections = site.collections - - binding - end - ) + workspace = IRB::WorkSpace.new + workspace.main.define_singleton_method(:site) { Bridgetown::Current.site } + workspace.main.define_singleton_method(:collections) { site.collections } irb = IRB::Irb.new(workspace) IRB.conf[:IRB_RC]&.call(irb.context) IRB.conf[:MAIN_CONTEXT] = irb.context diff --git a/bridgetown-website/Gemfile.lock b/bridgetown-website/Gemfile.lock index 7d0766662..b6f13da14 100644 --- a/bridgetown-website/Gemfile.lock +++ b/bridgetown-website/Gemfile.lock @@ -25,7 +25,7 @@ PATH listen (~> 3.0) rake (>= 13.0) roda (~> 3.46) - rouge (~> 3.0) + rouge (>= 3.0, < 5.0) serbea (~> 1.0) thor (~> 1.1) tilt (~> 2.0) From f5f851ceffac62bac281a791b576f1c89955df46 Mon Sep 17 00:00:00 2001 From: Jared White Date: Thu, 14 Mar 2024 20:55:13 -0700 Subject: [PATCH 15/26] improve dark mode syntax colors --- bridgetown-website/Gemfile.lock | 2 +- .../frontend/styles/theme-dark.css | 31 +++++++++++-------- bridgetown-website/src/_docs/resources.md | 2 +- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/bridgetown-website/Gemfile.lock b/bridgetown-website/Gemfile.lock index b6f13da14..80209a764 100644 --- a/bridgetown-website/Gemfile.lock +++ b/bridgetown-website/Gemfile.lock @@ -116,7 +116,7 @@ GEM rexml (3.2.6) roda (3.71.0) rack - rouge (3.30.0) + rouge (4.2.0) ruby2_keywords (0.0.5) ruby2js (5.1.0) parser diff --git a/bridgetown-website/frontend/styles/theme-dark.css b/bridgetown-website/frontend/styles/theme-dark.css index 65fa486d9..30df5c475 100644 --- a/bridgetown-website/frontend/styles/theme-dark.css +++ b/bridgetown-website/frontend/styles/theme-dark.css @@ -58,6 +58,10 @@ fill: var(--color-light-gray); } + & abbr[title] { + color: var(--color-light-gray); + } + & code, & pre { background-color: var(--color-blackish); @@ -85,10 +89,10 @@ } & .highlight :is(.k, .mi) { - color: var(--color-syntax-light-beige); + color: var(--color-syntax-beige); } - & .highlight .kn { + & .highlight :is(.kn, .m) { color: var(--color-syntax-mid-blue); } @@ -107,10 +111,10 @@ } & .highlight .s { - color: var(--color-syntax-steel-teal); + color: var(--color-syntax-light-gray); } - & .highlight :is(.c, .c1, .nx) { + & .highlight :is(.c, .c1, .nx, .nl) { color: var(--color-syntax-charcoal); } @@ -118,14 +122,10 @@ color: var(--color-syntax-steel-teal); } - & .highlight .n { + & .highlight :is(.n, .nd) { color: var(--color-syntax-light-green); } - & .highlight .nb { - color: #8aaee3; - } - & .highlight .nc { color: var(--color-syntax-dark-red); } @@ -147,7 +147,7 @@ } & .highlight .nt { - color: var(--color-syntax-beige); + color: var(--color-syntax-light-beige); } & .highlight .nv { @@ -159,11 +159,11 @@ } & .highlight .s2 { - color: var(--color-syntax-steel-teal); + color: var(--color-syntax-light-gray); } & .highlight :is(.gs, .kd) { - color: var(--color-syntax-mid-blue); + color: var(--color-syntax-light-green); } /* highlights end */ @@ -189,7 +189,12 @@ } & body > nav.edge { - background: linear-gradient(to bottom, var(--color-darkest-gray) 0%, #492512 90%, var(--color-darkest-gray) 100%); + background: linear-gradient( + to bottom, + var(--color-darkest-gray) 0%, + #492512 90%, + var(--color-darkest-gray) 100% + ); } & sl-button[variant="primary"]::part(base) { diff --git a/bridgetown-website/src/_docs/resources.md b/bridgetown-website/src/_docs/resources.md index 0e3fc266b..5fce14797 100644 --- a/bridgetown-website/src/_docs/resources.md +++ b/bridgetown-website/src/_docs/resources.md @@ -290,7 +290,7 @@ markdownify output.join("\n") Now obviously it's silly to build up Markdown content in an array of strings in a Ruby code file
but imagine building or using third-party DSLs to generate sophisticated markup and advanced structural documents of all kinds. [Arbre](https://activeadmin.github.io/arbre/) is but one example of a Ruby-first approach to creating templates. -``` +```ruby # What if your .rb template looked like this? Arbre::Context.new do From 2bf2d1e297c85935f02d7a2d49fb813a2aef624f Mon Sep 17 00:00:00 2001 From: Jared White Date: Thu, 14 Mar 2024 20:59:57 -0700 Subject: [PATCH 16/26] update nokolexbor in Gemfile.lock --- Gemfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 7166e23ee..79c0e8e73 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -151,10 +151,10 @@ GEM racc (~> 1.4) nokogiri (1.16.0-x86_64-linux) racc (~> 1.4) - nokolexbor (0.5.2) - nokolexbor (0.5.2-arm64-darwin) - nokolexbor (0.5.2-x86_64-darwin) - nokolexbor (0.5.2-x86_64-linux) + nokolexbor (0.5.3) + nokolexbor (0.5.3-arm64-darwin) + nokolexbor (0.5.3-x86_64-darwin) + nokolexbor (0.5.3-x86_64-linux) parallel (1.24.0) parser (3.2.2.4) ast (~> 2.4.1) From a260a4bd0ddaa314582fe9436d333b4833d3c366 Mon Sep 17 00:00:00 2001 From: MSILycanthropy <53885212+MSILycanthropy@users.noreply.github.com> Date: Sat, 16 Mar 2024 13:49:17 -0500 Subject: [PATCH 17/26] Use Global Regex for Stimulus Configuration (#865) * fix(stimulus): use global regex in template * chore: update changelog * chore(contributors): update readme * double-escape so backlash in Ruby caries over to JS --------- Co-authored-by: Jared White --- CHANGELOG.md | 3 ++- README.md | 8 ++++---- .../lib/bridgetown-core/configurations/stimulus.rb | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06505325a..808474e1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## Unreleased +- Use global regex for Stimulus Configuration ## [1.3.2] - 2024-01-01 @@ -705,7 +706,7 @@ Final release of 0.21.0! See below for full changelog. ## 0.11.1 - 2020-04-24 * Add a git init step to `bridgetown new` command [#18](https://github.com/bridgetownrb/bridgetown/pull/18) -* Update sass-loader webpack config to support .sass [#14](https://github.com/bridgetownrb/bridgetown/pull/14) ([jaredmoody](https://github.com/jaredmoody)) +* Update sass-loader webpack config to support .sass [#14](https://github.com/bridgetownrb/bridgetown/pull/14) ([jaredmoody](https://github.com/jaredmoody)) * Add customizable permalinks to Prototype Pages (aka `/path/to/:term/and/beyond`). Use hooks and in-memory caching to speed up Pagination. _Inspired by [use cases like this](https://annualbeta.com/blog/dynamic-social-sharing-images-with-eleventy/)
_ [#12](https://github.com/bridgetownrb/bridgetown/pull/12) ## 0.11.0 - 2020-04-21 diff --git a/README.md b/README.md index f877620fa..05bed70c0 100644 --- a/README.md +++ b/README.md @@ -181,10 +181,10 @@ Bridgetown is built by: |@vvveebs|@rickychilcott|@tommasongr|@tombruijn|@svoop| |London, UK|Ohio, US|Amsterdam, The Netherlands|Milan, IT|Europe| -|michaelherold|joemasilotti|ikass|jw81| -|:---:|:---:|:---:|:---:| -|@michaelherold|@joemasilotti|@ikass|@jw81| -|Omaha, NE|Portland, OR|Latvia|Kansas City, MO| +|michaelherold|joemasilotti|ikass|jw81|jw81 +|:---:|:---:|:---:|:---:|:---:| +|@michaelherold|@joemasilotti|@ikass|@jw81|@MSILycanthropy| +|Omaha, NE|Portland, OR|Latvia|Kansas City, MO|Kansas City, MO| || |:---:| diff --git a/bridgetown-core/lib/bridgetown-core/configurations/stimulus.rb b/bridgetown-core/lib/bridgetown-core/configurations/stimulus.rb index 5233028fb..d22923d7c 100644 --- a/bridgetown-core/lib/bridgetown-core/configurations/stimulus.rb +++ b/bridgetown-core/lib/bridgetown-core/configurations/stimulus.rb @@ -37,8 +37,8 @@ if (filename.includes("_controller.") || filename.includes("-controller.")) { const identifier = filename.replace("./controllers/", "") .replace(/[_-]controller\\..*$/, "") - .replace("_", "-") - .replace("/", "--") + .replace(/_/g, "-") + .replace(/\\//g, "--") Stimulus.register(identifier, controller.default) } From 3c2910b3204094a737045c0c0035919183487cc5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 16 Mar 2024 11:55:30 -0700 Subject: [PATCH 18/26] Bump yard from 0.9.34 to 0.9.36 (#857) Bumps [yard](https://github.com/lsegal/yard) from 0.9.34 to 0.9.36. - [Release notes](https://github.com/lsegal/yard/releases) - [Changelog](https://github.com/lsegal/yard/blob/main/CHANGELOG.md) - [Commits](https://github.com/lsegal/yard/compare/v0.9.34...v0.9.36) --- updated-dependencies: - dependency-name: yard dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 79c0e8e73..5b5086a6e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -252,7 +252,7 @@ GEM tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.5.0) - yard (0.9.34) + yard (0.9.36) zeitwerk (2.6.12) PLATFORMS From 08514ac67365691407c70f7bcef59415f5d0f8cc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 16 Mar 2024 11:55:42 -0700 Subject: [PATCH 19/26] Bump puma from 6.3.1 to 6.4.2 in /bridgetown-website (#846) Bumps [puma](https://github.com/puma/puma) from 6.3.1 to 6.4.2. - [Release notes](https://github.com/puma/puma/releases) - [Changelog](https://github.com/puma/puma/blob/master/History.md) - [Commits](https://github.com/puma/puma/compare/v6.3.1...v6.4.2) --- updated-dependencies: - dependency-name: puma dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- bridgetown-website/Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bridgetown-website/Gemfile.lock b/bridgetown-website/Gemfile.lock index 80209a764..298d15d7b 100644 --- a/bridgetown-website/Gemfile.lock +++ b/bridgetown-website/Gemfile.lock @@ -93,7 +93,7 @@ GEM rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) minitest (5.19.0) - nio4r (2.5.9) + nio4r (2.7.0) nokogiri (1.15.4-arm64-darwin) racc (~> 1.4) nokogiri (1.15.4-x86_64-linux) @@ -104,7 +104,7 @@ GEM ast (~> 2.4.1) racc public_suffix (5.0.3) - puma (6.3.1) + puma (6.4.2) nio4r (~> 2.0) racc (1.7.1) rack (3.0.8) From a57a50021078cd5879c96127a135360581444236 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 16 Mar 2024 11:55:53 -0700 Subject: [PATCH 20/26] Bump rack from 3.0.8 to 3.0.9.1 (#855) Bumps [rack](https://github.com/rack/rack) from 3.0.8 to 3.0.9.1. - [Release notes](https://github.com/rack/rack/releases) - [Changelog](https://github.com/rack/rack/blob/main/CHANGELOG.md) - [Commits](https://github.com/rack/rack/compare/v3.0.8...v3.0.9.1) --- updated-dependencies: - dependency-name: rack dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5b5086a6e..d61ebd9cf 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -161,7 +161,7 @@ GEM racc public_suffix (5.0.4) racc (1.7.3) - rack (3.0.8) + rack (3.0.9.1) rack-test (2.1.0) rack (>= 1.3) rainbow (3.1.1) From fb14549c282bb146abc621da1b359f15a104514e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 16 Mar 2024 11:56:04 -0700 Subject: [PATCH 21/26] Bump rack from 3.0.8 to 3.0.9.1 in /bridgetown-website (#856) Bumps [rack](https://github.com/rack/rack) from 3.0.8 to 3.0.9.1. - [Release notes](https://github.com/rack/rack/releases) - [Changelog](https://github.com/rack/rack/blob/main/CHANGELOG.md) - [Commits](https://github.com/rack/rack/compare/v3.0.8...v3.0.9.1) --- updated-dependencies: - dependency-name: rack dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- bridgetown-website/Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bridgetown-website/Gemfile.lock b/bridgetown-website/Gemfile.lock index 298d15d7b..44829a08a 100644 --- a/bridgetown-website/Gemfile.lock +++ b/bridgetown-website/Gemfile.lock @@ -107,7 +107,7 @@ GEM puma (6.4.2) nio4r (~> 2.0) racc (1.7.1) - rack (3.0.8) + rack (3.0.9.1) rake (13.0.6) rb-fsevent (0.11.2) rb-inotify (0.10.1) From 3d3dc434981a346ff98d4ec3a009cd7bf588919f Mon Sep 17 00:00:00 2001 From: Jared White Date: Sat, 16 Mar 2024 12:16:24 -0700 Subject: [PATCH 22/26] Release 1.3.3 (cherry picked from commit 29c5178278619d3809e059f2d7f501201d8ddc4e) --- CHANGELOG.md | 12 +++++- Gemfile.lock | 38 ++++++++++--------- .../lib/bridgetown-core/version.rb | 2 +- 3 files changed, 32 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 808474e1d..f2cf1989f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## Unreleased -- Use global regex for Stimulus Configuration + +## [1.3.3] - 2024-03-16 + +- Use global regex for Stimulus Configuration [#865](https://github.com/bridgetownrb/bridgetown/pull/865) ([@MSILycanthropy](https://github.com/MSILycanthropy)) +- Move site and collections console commands to locals [#853](https://github.com/bridgetownrb/bridgetown/pull/853) ([@mpace965](https://github.com/mpace965)) +- Relax the Rouge version requirement [#864](https://github.com/bridgetownrb/bridgetown/pull/864) ([@matiaskorhonen](https://github.com/matiaskorhonen)) +- esbuild: Add webp (and some others) to the file endings loaded as files [#863](https://github.com/bridgetownrb/bridgetown/pull/863) ([@moonglum](https://github.com/moonglum)) +- Improve Netlify bundled configuration [#839](https://github.com/bridgetownrb/bridgetown/pull/839) ([@jclusso](https://github.com/jclusso)) +- Improve localization helpers [#842](https://github.com/bridgetownrb/bridgetown/pull/842) ([@jclusso](https://github.com/jclusso)) +- Remove trailing whitespace from template resource [#838](https://github.com/bridgetownrb/bridgetown/pull/838) ([@unasuke](https://github.com/unasuke)) +- Thanks to @jclusso & @ayushn21 for docs improvements! ## [1.3.2] - 2024-01-01 diff --git a/Gemfile.lock b/Gemfile.lock index d61ebd9cf..994d6e6d7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,13 +1,13 @@ PATH remote: bridgetown-builder specs: - bridgetown-builder (1.3.2) - bridgetown-core (= 1.3.2) + bridgetown-builder (1.3.3) + bridgetown-core (= 1.3.3) PATH remote: bridgetown-core specs: - bridgetown-core (1.3.2) + bridgetown-core (1.3.3) activemodel (>= 6.0, < 8.0) activesupport (>= 6.0, < 8.0) addressable (~> 2.4) @@ -34,16 +34,16 @@ PATH PATH remote: bridgetown-paginate specs: - bridgetown-paginate (1.3.2) - bridgetown-core (= 1.3.2) + bridgetown-paginate (1.3.3) + bridgetown-core (= 1.3.3) PATH remote: bridgetown specs: - bridgetown (1.3.2) - bridgetown-builder (= 1.3.2) - bridgetown-core (= 1.3.2) - bridgetown-paginate (= 1.3.2) + bridgetown (1.3.3) + bridgetown-builder (= 1.3.3) + bridgetown-core (= 1.3.3) + bridgetown-paginate (= 1.3.3) GEM remote: https://rubygems.org/ @@ -62,7 +62,7 @@ GEM tzinfo (~> 2.0) addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) - amazing_print (1.5.0) + amazing_print (1.6.0) ansi (1.5.0) ast (2.4.2) backport (1.2.0) @@ -105,13 +105,12 @@ GEM ruby2_keywords e2mmap (0.1.0) erubi (1.12.0) - faraday (2.8.1) - base64 - faraday-net_http (>= 2.0, < 3.1) - ruby2_keywords (>= 0.0.4) + faraday (2.9.0) + faraday-net_http (>= 2.0, < 3.2) faraday-follow_redirects (0.3.0) faraday (>= 1, < 3) - faraday-net_http (3.0.2) + faraday-net_http (3.1.0) + net-http ffi (1.16.3) hash_with_dot_access (1.2.0) activesupport (>= 5.0.0, < 8.0) @@ -125,7 +124,7 @@ GEM kramdown (~> 2.0) language_server-protocol (3.17.0.3) liquid (5.4.0) - listen (3.8.0) + listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) memory_profiler (1.0.1) @@ -142,6 +141,8 @@ GEM ruby-progressbar multi_test (1.1.0) mutex_m (0.2.0) + net-http (0.4.1) + uri nokogiri (1.16.0) mini_portile2 (~> 2.8.2) racc (~> 1.4) @@ -174,7 +175,7 @@ GEM reverse_markdown (2.1.1) nokogiri rexml (3.2.6) - roda (3.75.0) + roda (3.78.0) rack rouge (4.2.0) rspec (3.12.0) @@ -252,8 +253,9 @@ GEM tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.5.0) + uri (0.13.0) yard (0.9.36) - zeitwerk (2.6.12) + zeitwerk (2.6.13) PLATFORMS arm64-darwin-22 diff --git a/bridgetown-core/lib/bridgetown-core/version.rb b/bridgetown-core/lib/bridgetown-core/version.rb index a172e1ddb..ba51785a8 100644 --- a/bridgetown-core/lib/bridgetown-core/version.rb +++ b/bridgetown-core/lib/bridgetown-core/version.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true module Bridgetown - VERSION = "1.3.2" + VERSION = "1.3.3" CODE_NAME = "Kelly Butte" end From a7c23534ad396bf63a6bc78a0d0a6f45913766b0 Mon Sep 17 00:00:00 2001 From: Jared White Date: Sat, 16 Mar 2024 12:27:37 -0700 Subject: [PATCH 23/26] test: fix occasional failure case (cherry picked from commit c53423fe821bde91d1f189bebf4bc2bba141f0e4) --- .../lib/bridgetown-core/utils/loaders_manager.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bridgetown-core/lib/bridgetown-core/utils/loaders_manager.rb b/bridgetown-core/lib/bridgetown-core/utils/loaders_manager.rb index f20bc3671..161feb4e1 100644 --- a/bridgetown-core/lib/bridgetown-core/utils/loaders_manager.rb +++ b/bridgetown-core/lib/bridgetown-core/utils/loaders_manager.rb @@ -39,9 +39,11 @@ def clear_descendants_for_reload(_cpath, value, _abspath) end # TODO: this could probably be refactored to work like the above - ActiveSupport::DescendantsTracker.class_variable_get( - :@@direct_descendants - )[value.superclass]&.reject! { _1 == value } + if ActiveSupport::DescendantsTracker.class_variables.include?(:@@direct_descendants) + ActiveSupport::DescendantsTracker.class_variable_get( + :@@direct_descendants + )[value.superclass]&.reject! { _1 == value } + end end def setup_loaders(autoload_paths = []) # rubocop:todo Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity From 0e9454146007a49e228df6b6ea897f08553da9d9 Mon Sep 17 00:00:00 2001 From: Jared White Date: Sat, 16 Mar 2024 12:37:37 -0700 Subject: [PATCH 24/26] docs: add info about date command (cherry picked from commit fb2a944472185aa77749f7f29899726d029961f7) --- bridgetown-website/src/_docs/command-line-usage.md | 1 + 1 file changed, 1 insertion(+) diff --git a/bridgetown-website/src/_docs/command-line-usage.md b/bridgetown-website/src/_docs/command-line-usage.md index cf39fc102..b57c0d2b1 100644 --- a/bridgetown-website/src/_docs/command-line-usage.md +++ b/bridgetown-website/src/_docs/command-line-usage.md @@ -28,6 +28,7 @@ Available commands are: * [`bin/bridgetown plugins [list|cd]`](/docs/commands/plugins) - Display information about installed plugins or allow you to copy content out of gem-based plugins into your site folders. * `bin/bridgetown apply` - Run an [automation script](/docs/automations) for your existing site. * `bin/bridgetown configure CONFIGURATION` - Run a [bundled configuration](/docs/bundled-configurations) for your existing site. Invoke without arguments to see all available configurations. +* `bin/bridgetown date` - Displays the current date and time so you can copy'n'paste it into your front matter. * `bin/bridgetown help` - Shows help, optionally for a given subcommand, e.g. `bridgetown help build`. * `bin/bridgetown doctor` - Outputs any deprecation or configuration issues. * `bin/bridgetown clean` - Removes all generated files: destination folder, metadata file, and Bridgetown caches. From 5671b0f88b985fef9da5d573f05f459bc2152e55 Mon Sep 17 00:00:00 2001 From: Jared White Date: Sat, 16 Mar 2024 13:01:22 -0700 Subject: [PATCH 25/26] update Gemfile.lock --- Gemfile.lock | 74 +++++++++++++++++++++++++--------------------------- 1 file changed, 36 insertions(+), 38 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 994d6e6d7..ffe7b49ce 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -48,9 +48,9 @@ PATH GEM remote: https://rubygems.org/ specs: - activemodel (7.1.2) - activesupport (= 7.1.2) - activesupport (7.1.2) + activemodel (7.1.3.2) + activesupport (= 7.1.3.2) + activesupport (7.1.3.2) base64 bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) @@ -69,10 +69,10 @@ GEM base64 (0.2.0) benchmark (0.3.0) benchmark-ips (2.13.0) - bigdecimal (3.1.5) + bigdecimal (3.1.7) builder (3.2.4) colorator (1.1.0) - concurrent-ruby (1.2.2) + concurrent-ruby (1.2.3) connection_pool (2.4.1) csv (3.2.8) cucumber (8.0.0) @@ -99,10 +99,9 @@ GEM cucumber-messages (~> 18.0, >= 18.0.0) cucumber-messages (18.0.0) cucumber-tag-expressions (4.1.0) - diff-lcs (1.5.0) + diff-lcs (1.5.1) docile (1.4.0) - drb (2.2.0) - ruby2_keywords + drb (2.2.1) e2mmap (0.1.0) erubi (1.12.0) faraday (2.9.0) @@ -114,7 +113,7 @@ GEM ffi (1.16.3) hash_with_dot_access (1.2.0) activesupport (>= 5.0.0, < 8.0) - i18n (1.14.1) + i18n (1.14.4) concurrent-ruby (~> 1.0) jaro_winkler (1.5.6) json (2.7.1) @@ -128,11 +127,11 @@ GEM rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) memory_profiler (1.0.1) - mime-types (3.5.1) + mime-types (3.5.2) mime-types-data (~> 3.2015) - mime-types-data (3.2023.1205) + mime-types-data (3.2024.0305) mini_portile2 (2.8.5) - minitest (5.20.0) + minitest (5.22.3) minitest-profile (0.0.2) minitest-reporters (1.6.1) ansi @@ -143,21 +142,21 @@ GEM mutex_m (0.2.0) net-http (0.4.1) uri - nokogiri (1.16.0) + nokogiri (1.16.3) mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.16.0-arm64-darwin) + nokogiri (1.16.3-arm64-darwin) racc (~> 1.4) - nokogiri (1.16.0-x86_64-darwin) + nokogiri (1.16.3-x86_64-darwin) racc (~> 1.4) - nokogiri (1.16.0-x86_64-linux) + nokogiri (1.16.3-x86_64-linux) racc (~> 1.4) nokolexbor (0.5.3) nokolexbor (0.5.3-arm64-darwin) nokolexbor (0.5.3-x86_64-darwin) nokolexbor (0.5.3-x86_64-linux) parallel (1.24.0) - parser (3.2.2.4) + parser (3.3.0.5) ast (~> 2.4.1) racc public_suffix (5.0.4) @@ -171,47 +170,46 @@ GEM rb-inotify (0.10.1) ffi (~> 1.0) rbs (2.8.4) - regexp_parser (2.8.3) + regexp_parser (2.9.0) reverse_markdown (2.1.1) nokogiri rexml (3.2.6) roda (3.78.0) rack rouge (4.2.0) - rspec (3.12.0) - rspec-core (~> 3.12.0) - rspec-expectations (~> 3.12.0) - rspec-mocks (~> 3.12.0) - rspec-core (3.12.2) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.3) + rspec (3.13.0) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.0) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-mocks (3.12.6) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-support (3.12.1) - rubocop (1.59.0) + rspec-support (~> 3.13.0) + rspec-support (3.13.1) + rubocop (1.62.1) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.2.4) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.30.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.30.0) - parser (>= 3.2.1.0) + rubocop-ast (1.31.2) + parser (>= 3.3.0.4) rubocop-bridgetown (0.3.2) rubocop (~> 1.23) rubocop-performance (~> 1.12) - rubocop-performance (1.20.1) + rubocop-performance (1.20.2) rubocop (>= 1.48.1, < 2.0) rubocop-ast (>= 1.30.0, < 2.0) ruby-progressbar (1.13.0) - ruby2_keywords (0.0.5) serbea (1.0.1) activesupport (>= 6.0) erubi (>= 1.10) @@ -248,7 +246,7 @@ GEM ffi (~> 1.1) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) - thor (1.3.0) + thor (1.3.1) tilt (2.3.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) @@ -288,4 +286,4 @@ DEPENDENCIES yard (~> 0.9) BUNDLED WITH - 2.5.3 + 2.5.6 From 4f933bbce74b98a71cf9ed8611305469c444f2f8 Mon Sep 17 00:00:00 2001 From: Jared White Date: Sat, 16 Mar 2024 13:04:53 -0700 Subject: [PATCH 26/26] bump Ruby matrix versions --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 17ab2756b..81b6e79df 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby_version: [3.0.0, 3.1.2, 3.2.0, 3.3.0] + ruby_version: [3.0.6, 3.1.4, 3.2.2, 3.3.0] continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }} # Has to be top level to cache properly env: