Commit Graph

81345 Commits

Author SHA1 Message Date
David Heinemeier Hansson
af7428c4ac
Replace webpack with importmapped Hotwire as default js (#42999)
* Turbolinks is being replaced with Hotwire

* Make --webpack opt-in

* Don't use specific webpacker installers any more in preparation for next Webpacker

* Update railties/lib/rails/app_updater.rb

Co-authored-by: Alex Ghiculescu <alex@tanda.co>

* Trailing whitespace

* Convert to Turbo data attribute for tracking

* Default is no webpack, no hotwire

* Swap out turbolinks references for hotwire

* Drop explicit return

* Only generate package.json if using webpack

* Only create package.json in webpack mode

* Only create app/javascript in webpack mode

* Generate correct style/js links based on js mode

* Fix tests from changed output format

Not sure why these are showing up in this PR, though.

* Rubocopping

* Stick with webpack for the test app for now

* Adjust tests

* Replace minitest-reporters with minitest-ci (#43016)

minitest-reporters is used to create junit xml reports on CI.

But when it loads before rails minitest plugin makes
`Rails::TestUnitReporter` not being added as a reporter.

minitest-ci is now only loaded at ci and does not interferes with
rails minitest plugins. And keeps junit reports workings

* Too heavy handed to actually run bundle

Just like we don't auto-migrate

* Pin js frameworks in importmap

Instead of having importmap preconfigure it.

* Match updated app/javascript path

* No need for the explaining comment

* Fixes test cases for replace webpack with importmapped Hotwire as default js (#42999)

* Fix rubocop issues

* Fix more railities test cases

* Fix plugin generator railties shared test cases

* Fix Action Text install generator asset pipeline spec

* They're modules, not files

* Let dev use the latest release as well

So we don't have to replace unexisting dev releases with latest release

* Make Webpack responsible for generating all the JS files it needs

Webpacker 6 has already moved from app/javascript to app/packs.

* Don't add rails/ujs by default any longer

All the ajax/form functionality has been superseded by Turbo. The rest lives in a weird inbetween land we need to address through other means.

* Use new importmap location

* Switch to using turbo-rails and stimulus-rails directly

The hotwire-rails gem does not offer enough value for its indirection

* Use latest Webpacker

* Prevent version resolution requests from getting swallowed

* Use ESM syntax for imports

* Move management of yarn, package.json, etc to Webpacker 6

* Update for Webpacker 6

* Move bin/setup addition to Webpacker as well

* Remove dead tests

* Bump to Webpacker 6.0.0.rc.2

* No longer relevant given the new default is no webpacker

* Rely on Webpacker 6

* No longer relevant

* No longer relevant

* Make cable channel generator work for both webpacker and importmap setups

* Fix tests

* For tests testing importmap way

* Use Webpacker 6 dummy

* RuboCopping

* One more bump to fix webpack-dev-server

* Another bump. Hopefully the last one!

* Also enough to not want turbo tracking on

* Fix tests

* Latest

* Fix tests

* Fix more tests

* Fix tests

Co-authored-by: Alex Ghiculescu <alex@tanda.co>
Co-authored-by: André Luis Leal Cardoso Junior <andrehjr@gmail.com>
Co-authored-by: Abhay Nikam <nikam.abhay1@gmail.com>
Co-authored-by: Guillermo Iguaran <guilleiguaran@gmail.com>
2021-08-26 10:39:36 +02:00
Xavier Noria
39f15e163d Iterates docs about autoloading during boot 2021-08-26 09:41:10 +02:00
Alex Ghiculescu
326d88660f Avoid returning a constant in ActionDispatch::ShowExceptions 2021-08-25 17:02:51 -07:00
Jean Boussier
6e9304a05d
Merge pull request #43086 from nstuart-at-salesforce/nas_addRaiseErrorsParam
Removed rescue block from `ActiveSupport::Cache::RedisCacheStore#handle_exception`
2021-08-25 17:32:24 +02:00
Kasper Timm Hansen
94e80269e3
[ci skip] Fully qualify attributes (we're in docs) and move them above the class so it's not confused with the belongs_to's 2021-08-25 16:59:02 +02:00
Kasper Timm Hansen
163466467e
[ci skip] Use more consistent spacing; trim some ending newlines 2021-08-25 16:58:17 +02:00
Kasper Timm Hansen
1ade156d3c
[ci skip] Use more modern tag.x call structure 2021-08-25 16:56:22 +02:00
Kasper Timm Hansen
ccad4b0886
[ci skip] Modernize example; make it consistent with the example at the top documentation 2021-08-25 16:55:47 +02:00
Kasper Timm Hansen
6faf60b158
[ci skip] Fix some links that didn't link but now should, you get me? 2021-08-25 16:55:00 +02:00
Kasper Timm Hansen
ea5397e708
[ci skip] Use symbols and double quoted strings more consistently in these docs 2021-08-25 16:54:22 +02:00
Jonathan Hefner
c70e264871
Merge pull request #43095 from cpjmcquillan/patch-1
[GUIDES] Fix ActiveJob custom serializer typo [ci-skip]

Co-authored-by: Petrik <petrik@deheus.net>
2021-08-25 08:26:07 -05:00
Connor McQuillan
f2fa3ec015
[GUIDES] Fix ActiveJob custom serializer typo
Correct `config/initializer/custom_serializers.rb` to
`config/initializers/custom_serializers.rb`.

- Fix typo in guides/source/active_job_basics.md
- Fix 2 typos in guides/source/autoloading_and_reloading_constants.md
2021-08-25 13:50:54 +01:00
Petrik de Heus
fe9625c022
Temporarily disable Azure service tests (#43091)
The Azure service tests are currently failing on the main branch,
probably because of configuration. We can temporarily disable them while
we get things working again.
2021-08-25 11:22:39 +02:00
Kasper Timm Hansen
915b9cdbb7
Clear up resolve_link_as
Swaps to case/when to highlight the 3 branches better and uses `presence_in`
to cut down on the else branch noise.

`resolve_link_as` added in: eb90b8bc86e758045a707cae43d11dab538ca6db
Most recent other commit: 46bfd082b00a6c10f7263c769edb9c053bd03936

Made a decision to tweak this as core, don't send cosmetic PRs.
2021-08-24 22:38:40 +02:00
Jean Boussier
c7647f8842
Merge pull request #43088 from nateberkopec/preload-images
Make preload_link_tag work with images
2021-08-24 22:14:21 +02:00
Nate Berkopec
46bfd082b0
Make preload_link_tag work with images 2021-08-24 13:49:02 -06:00
Rafael Mendonça França
d2b23f48e8
Copy-edit documentation [ci skip] 2021-08-24 19:09:25 +00:00
Nicholas Stuart
aabc27fe15
Move assert_raise into behavior classes 2021-08-24 12:06:53 -07:00
Nicholas Stuart
934966a127
fix rubymine copy/paste spaces 2021-08-24 10:11:19 -07:00
Nicholas Stuart
b2e9c4c409
Reset caching_with_rails.md file 2021-08-24 10:10:15 -07:00
Nicholas Stuart
2c15e00a2c
Address PR comments. 2021-08-24 10:09:07 -07:00
Nicholas Stuart
2e097e86d2
Add test case 2021-08-24 09:36:55 -07:00
Nicholas Stuart
c83e690311
Revert the raise_errors param and Removed rescue block from ActiveSupport::Cache::RedisCacheStore#handle_exception 2021-08-24 09:33:08 -07:00
Berkhan Berkdemir
790723b92f
Look yarnpkg in $PATH other than yarn (#42253)
This is defined as an issue in #37558; however, we take advantage of
Debian `yarnpkg` package. With that, `yarnpkg` users from Debian can
use `bin/yarn` and `yarn` package provided from Yarn community will
not be affected because `yarn` is executed first.
2021-08-24 16:02:39 +02:00
Jean Boussier
af87199a80 Handle NullObject instances in Active Job query tag 2021-08-24 15:07:20 +02:00
Jean Boussier
703d4b216a
Merge pull request #43079 from Shopify/ar-query-logs-instance-exec
Pass `ActiveRecord::QueryLogs` as argument rather than `instance_exec`
2021-08-24 09:01:48 +02:00
Nicholas Stuart
22b000bde8
Update CHANGELOG.md 2021-08-23 20:29:18 -07:00
Nicholas Stuart
b9f61c1b26
Update documentation 2021-08-23 20:25:05 -07:00
Ryuta Kamizono
61e6515b46
Merge pull request #43084 from p8/activestorage/bump-azure-storage-2.0
Upgrade azure-storage-blob to support ruby > 2.5
2021-08-24 11:41:18 +09:00
Nicholas Stuart
7f1129277b
init commit 2021-08-23 17:35:00 -07:00
John Hawthorn
ea5cf6db7c
Merge pull request #43027 from hahmed/ha/add-regression-test-for-render-to-string
Add a test to catch regressions for render_to_string
2021-08-23 13:43:21 -07:00
Petrik
0920b02c1d Upgrade azure-storage-blob to use at least 2.0.0
azure-storage-blob 1.1.0 supports ruby 1.9.3 to 2.5:
https://github.com/Azure/azure-storage-ruby/blob/v1.1.0-common/common/README.md

azure-storage-blob 2.0.0 supports ruby 2.3 to 2.7:
https://github.com/Azure/azure-storage-ruby/blob/v2.0.0-blob/common/README.md
2021-08-23 22:03:15 +02:00
Haroon Ahmed
f69406b3fe Add a test to catch regressions for render_to_string to not override subsequent render 2021-08-23 20:40:21 +01:00
Xavier Noria
2344463b97
Merge pull request #43083 from jhawthorn/fix_multi_db_test
Add require to failing multi_db test
2021-08-23 20:32:46 +02:00
Jean Boussier
b9635ccc05 Pass ActiveRecord::QueryLogs as argument rather than instance_exec
Otherwise we expose all the interal state of `QueryLogs` as an API.

It also makes the API more friendly to typing frameworks.
2021-08-23 20:29:45 +02:00
John Hawthorn
723ccf8fec Add require to failing multi_db test
This started failing related to the removal of the classic autoloader.
This adds the require of environment.rb that other tests already had.
2021-08-23 11:27:22 -07:00
John Hawthorn
2daef106af
Merge pull request #42945 from jhawthorn/hash_match
Remove details_key-based Template cache
2021-08-23 10:47:58 -07:00
Xavier Noria
891189d9b8
Merge pull request #43080 from rails/del-as-clear
Final touches deleting the classic autoloader
2021-08-23 18:04:16 +02:00
Xavier Noria
fddfaa08af Move AS::Dependencies.clear to the main file 2021-08-23 17:49:48 +02:00
Jean Boussier
46e43f57f6
Merge pull request #43078 from Shopify/ar-query-log-default-context
Make ActiveRecord::QueryLogs default behavior to return the context content
2021-08-23 17:44:40 +02:00
Jean Boussier
e12514ac43
Merge pull request #43076 from Shopify/ar-query-logs-nesting
Make `QueryLogs.set_context` restore previous values
2021-08-23 16:38:13 +02:00
Jean Boussier
6ea85aff71 Make QueryLogs.set_context restore previous values
It's really the least surpising behavior for block based APIs like this one
and is consistent with `with_tags`.
2021-08-23 16:08:40 +02:00
Jean Boussier
9f035e2222 Make ActiveRecord::QueryLogs default behavior to return the context content
This should cover the vast majority of use cases, e.g.

```ruby
config.active_record.query_log_tags = [:api_client_id]

ActiveRecord::QueryLogs.set_context(api_client_id: api_client.id) do
  # ...
end
```
2021-08-23 15:58:37 +02:00
Eileen M. Uchitelle
a81aeb63a0
Merge pull request #43050 from intrip/42912-restore-db-connection-on-schema-load-name
Reestablish connection to previous database after after running db:schema:load:name
2021-08-23 09:20:02 -04:00
Xavier Noria
a8fa8b0ef8 Delete AS::Dependencies.verbose=
As documented, the public way to trace autoloading activity
is Rails.autoloaders.log!
2021-08-23 10:05:13 +02:00
Xavier Noria
61d7f33f67 Delete AS::Dependencies.autoloaded_constants 2021-08-23 10:05:13 +02:00
Xavier Noria
86a55dbe0f Delete private constant AS::Dependencies::UNBOUND_METHOD_MODULE_NAME 2021-08-23 10:05:13 +02:00
Xavier Noria
651737f059 AS::Dependencies no longer extends self
AS::Dependencies is not meant to be used as a mixin. I guess extend self
made sense time ago.
2021-08-23 10:05:13 +02:00
Xavier Noria
7bbe1f4bce Delete the classic version of AS::Dependencies.clear 2021-08-23 10:05:08 +02:00
Xavier Noria
08481be86e Delete the classic version of AS::Dependencies.autoloaded_constants 2021-08-23 09:20:52 +02:00