Permalink
Switch branches/tags
Commits on Oct 1, 2018
  1. Make Webpacker the default JavaScript compiler for Rails 6 (#33079)

    dhh committed Oct 1, 2018
    * Use Webpacker by default on new apps
    
    * Stop including coffee-rails by default
    
    * Drop using a js_compressor by default
    
    * Drop extra test for coffeescript inclusion by default
    
    * Stick with skip_javascript to signify skipping webpack
    
    * Don't install a JS runtime by default any more
    
    * app/javascript will be the new default directory for JS
    
    * Make it clear that this is just for configuring the default Webpack framework setup now
    
    * Start using the Webpack tag in the default layout
    
    * Irrelevant test
    
    * jQuery is long gone
    
    * Stop having asset pipeline compile default application.js
    
    * Add rails-ujs by default to the Webpack setup
    
    * Add Active Storage JavaScript to application.js pack by default
    
    * Consistent quoting
    
    * Add Turbolinks to default pack
    
    * Add Action Cable to default pack
    
    Need some work on how to set the global consumer that channels will
    work with. @javan?
    
    * Require all channels by default and use a separate consumer stub
    
    * Channel generator now targets Webpack style
    
    * Update task docs to match new generator style
    
    * Use uniform import style
    
    * Drop the JS assets generator
    
    It was barely helpful as it was. It’s no longer helpful in a Webpacked
    world. Sayonara!
    
    * Add app/javascript to the stats directories
    
    * Simpler import style
    
    Which match the other imports.
    
    * Address test failures from dropping JS compilation (and compression)
    
    * webpacker-default: Modify `AssetsGeneratorTest`
    
    Before:
    
    ```
    $ bin/test test/generators/assets_generator_test.rb
    Run options: --seed 46201
    
    F
    
    Failure:
    AssetsGeneratorTest#test_assets [/Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/assets_generator_test.rb:12]:
    Expected file "app/assets/javascripts/posts.js" to exist, but does not
    
    bin/test /Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/assets_generator_test.rb:10
    
    .
    
    Finished in 0.031343s, 63.8101 runs/s, 95.7152 assertions/s.
    2 runs, 3 assertions, 1 failures, 0 errors, 0 skips
    ```
    
    After:
    
    ```
    $ bin/test test/generators/assets_generator_test.rb
    Run options: --seed 43571
    
    ..
    
    Finished in 0.030370s, 65.8545 runs/s, 65.8545 assertions/s.
    2 runs, 2 assertions, 0 failures, 0 errors, 0 skips
    ```
    
    * webpacker-default: Modify `ChannelGeneratorTest`
    
    Before:
    
    ```
    $ bin/test test/generators/channel_generator_test.rb
    Run options: --seed 8986
    
    .F
    
    Failure:
    ChannelGeneratorTest#test_channel_with_multiple_actions_is_created [/Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:43]:
    Expected file "app/assets/javascripts/channels/chat.js" to exist, but does not
    
    bin/test /Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:34
    
    .F
    
    Failure:
    ChannelGeneratorTest#test_channel_is_created [/Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:29]:
    Expected file "app/assets/javascripts/channels/chat.js" to exist, but does not
    
    bin/test /Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:22
    
    E
    
    Error:
    ChannelGeneratorTest#test_cable_js_is_created_if_not_present_already:
    Errno::ENOENT: No such file or directory @ apply2files - /Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/fixtures/tmp/app/assets/javascripts/cable.js
    
    bin/test /Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:60
    
    F
    
    Failure:
    ChannelGeneratorTest#test_channel_suffix_is_not_duplicated [/Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:87]:
    Expected file "app/assets/javascripts/channels/chat.js" to exist, but does not
    
    bin/test /Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:80
    
    F
    
    Failure:
    ChannelGeneratorTest#test_channel_on_revoke [/Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:77]:
    Expected file "app/assets/javascripts/cable.js" to exist, but does not
    
    bin/test /Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:68
    
    Finished in 0.064384s, 108.7227 runs/s, 481.4861 assertions/s.
    7 runs, 31 assertions, 4 failures, 1 errors, 0 skips
    ```
    
    After:
    
    ```
    $ bin/test test/generators/channel_generator_test.rb
    Run options: --seed 44857
    
    .......
    
    Finished in 0.060243s, 116.1961 runs/s, 697.1764 assertions/s.
    7 runs, 42 assertions, 0 failures, 0 errors, 0 skips
    ```
    
    * Fix shared generator tests.
    
    * webpacker-default: Modify `ControllerGeneratorTest`
    
    The JS assets generator was dropped. ref. 46215b1
    
    * Revert "Simpler import style". It's currently failing with an error of "TypeError: undefined is not an object (evaluating '__WEBPACK_IMPORTED_MODULE_2_activestorage___default.a.start')". Waiting for @javan to have a look.
    
    This reverts commit 5d3ebb7.
    
    * require webpacker in test app
    
    * Add webpacker without making the build hang/timeout. (#33640)
    
    * use yarn workspaces to allow for installing unreleased packages and only generate js/bootsnap when required
    
    * no longer need to have webpacker in env templates as webpacker moved this config to yml file
    
    * Fix rubocop violation
    
    * Got the test passing for the running scaffold
    
    * update expected lines of code
    
    * update middleware tests to account for webpacker
    
    * disable js in plugins be default to get the tests passing (#34009)
    
    * clear codeclimate report issues
    
    * Anything newer than currently released is good
    
    * Use Webpacker development version during development of Rails
    
    * Edge should get development webpacker as well
    
    * Add changelog entry for Webpacker change
Commits on Sep 30, 2018
Commits on Feb 15, 2018
  1. Add #create_or_find_by to lean on unique constraints (#31989)

    dhh committed Feb 15, 2018
    Add #create_or_find_by to lean on unique constraints
Commits on Feb 9, 2018
  1. Add Relation#pick as short-hand for single-value plucks (#31941)

    dhh committed Feb 9, 2018
    * Add Relation#pick as short-hand for single-value plucks
Commits on Jan 12, 2018
  1. Use unsafe_inline as the default for script_src CSP until we get a no…

    dhh committed Jan 12, 2018
    …nce alternative
    
    Closes #31273 but we will still want to upgrade this to the
    nonce-approach when it’s ready.
Commits on Sep 11, 2017
  1. Add credentials using a generic EncryptedConfiguration class (#30067)

    dhh authored and kaspth committed Sep 11, 2017
    * WIP: Add credentials using a generic EncryptedConfiguration class
    
    This is sketch code so far.
    
    * Flesh out EncryptedConfiguration and test it
    
    * Better name
    
    * Add command and generator for credentials
    
    * Use the Pathnames
    
    * Extract EncryptedFile from EncryptedConfiguration and add serializers
    
    * Test EncryptedFile
    
    * Extract serializer validation
    
    * Stress the point about losing comments
    
    * Allow encrypted configuration to be read without parsing for display
    
    * Use credentials by default and base them on the master key
    
    * Derive secret_key_base in test/dev, source it from credentials in other envs
    
    And document the usage.
    
    * Document the new credentials setup
    
    * Stop generating the secrets.yml file now that we have credentials
    
    * Document what we should have instead
    
    Still need to make it happen, tho.
    
    * [ci skip] Keep wording to `key base`; prefer defaults.
    
    Usually we say we change defaults, not "spec" out a release.
    
    Can't use backticks in our sdoc generated documentation either.
    
    * Abstract away OpenSSL; prefer MessageEncryptor.
    
    * Spare needless new when raising.
    
    * Encrypted file test shouldn't depend on subclass.
    
    * [ci skip] Some woordings.
    
    * Ditch serializer future coding.
    
    * I said flip it. Flip it good.
    
    * [ci skip] Move require_master_key to the real production.rb.
    
    * Add require_master_key to abort the boot process.
    
    In case the master key is required in a certain environment
    we should inspect that the key is there and abort if it isn't.
    
    * Print missing key message and exit immediately.
    
    Spares us a lengthy backtrace and prevents further execution.
    
    I've verified the behavior in a test app, but couldn't figure the
    test out as loading the app just exits immediately with:
    
    ```
    /Users/kasperhansen/Documents/code/rails/activesupport/lib/active_support/testing/isolation.rb:23:in `load': marshal data too short (ArgumentError)
    	from /Users/kasperhansen/Documents/code/rails/activesupport/lib/active_support/testing/isolation.rb:23:in `run'
    	from /Users/kasperhansen/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/minitest-5.10.2/lib/minitest.rb:830:in `run_one_method'
    	from /Users/kasperhansen/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/minitest-5.10.2/lib/minitest/parallel.rb:32:in `block (2 levels) in start'
    ```
    
    It's likely we need to capture and prevent the exit somehow.
    Kernel.stub(:exit) didn't work. Leaving it for tomorrow.
    
    * Fix require_master_key config test.
    
    Loading the app would trigger the `exit 1` per require_master_key's
    semantics, which then aborted the test.
    
    Fork and wait for the child process to finish, then inspect the
    exit status.
    
    Also check we aborted because of a missing master key, so something
    else didn't just abort the boot.
    
    Much <3 to @tenderlove for the tip.
    
    * Support reading/writing configs via methods.
    
    * Skip needless deep symbolizing.
    
    * Remove save; test config reader elsewhere.
    
    * Move secret_key_base check to when we're reading it.
    
    Otherwise we'll abort too soon since we don't assign the secret_key_base
    to secrets anymore.
    
    * Add missing string literal comments; require unneeded yaml require.
    
    * ya ya ya, rubocop.
    
    * Add master_key/credentials after bundle.
    
    Then we can reuse the existing message on `rails new bc4`.
    
    It'll look like:
    
    ```
    Using web-console 3.5.1 from https://github.com/rails/web-console.git (at master@ce985eb)
    Using rails 5.2.0.alpha from source at `/Users/kasperhansen/Documents/code/rails`
    Using sass-rails 5.0.6
    Bundle complete! 16 Gemfile dependencies, 72 gems now installed.
    Use `bundle info [gemname]` to see where a bundled gem is installed.
    Adding config/master.key to store the master encryption key: 97070158c44b4675b876373a6bc9d5a0
    
    Save this in a password manager your team can access.
    
    If you lose the key, no one, including you, can access anything encrypted with it.
    
          create  config/master.key
    ```
    
    And that'll be executed even if `--skip-bundle` was passed.
    
    * Ensure test app has secret_key_base.
    
    * Assign secret_key_base to app or omit.
    
    * Merge noise
    
    * Split options for dynamic delegation into its own method and use deep symbols to make it work
    
    * Update error to point to credentials instead
    
    * Appease Rubocop
    
    * Validate secret_key_base when reading it.
    
    Instead of relying on the validation in key_generator move that into
    secret_key_base itself.
    
    * Fix generator and secrets test.
    
    Manually add config.read_encrypted_secrets since it's not there by default
    anymore.
    
    Move mentions of config/secrets.yml to config/credentials.yml.enc.
    
    * Remove files I have no idea how they got here.
    
    * [ci skip] swap secrets for credentials.
    
    * [ci skip] And now, changelogs are coming.
Commits on Aug 9, 2017
  1. Revert "Revert "Set Ruby version in Gemfile and .ruby-version by defa…

    dhh committed Aug 9, 2017
    …ult""
    
    This reverts commit a8f5904.
    
    See discussion on #30016.
Commits on Aug 6, 2017
  1. Merge pull request #30094 from dixpac/change_azure_name_in_storage_yml

    dhh committed Aug 6, 2017
    Fix wrong service name in the storage.yml
  2. Merge pull request #30099 from bogdanvlviv/set_version_of_active_stor…

    dhh committed Aug 6, 2017
    …age_to_5_2_0_alpha_inside_package_json
    
    Active Storage to 5.2.0.alpha inside `activestorage/package.json`
Commits on Aug 5, 2017
  1. Merge pull request #30066 from claudiob/ast-module

    dhh committed Aug 5, 2017
    `module ActiveStorage`, not `ActiveStorage::Class`
  2. Merge branch 'master' into ast-module

    dhh committed Aug 5, 2017
  3. Merge pull request #30068 from kamipo/user_start_with_than_regexp

    dhh committed Aug 5, 2017
    Use `content_type.start_with?("...")` than `content_type =~ /^.../`
  4. Merge pull request #30081 from y-yagi/fix_ruby_warnings

    dhh committed Aug 5, 2017
    Fix ruby warnings
  5. Merge pull request #30080 from georgeclaghorn/active-storage-secret-k…

    dhh committed Aug 5, 2017
    …ey-base
    
    Active Storage: check for `app.secrets.secret_key_base`, not `app.config.secret_key_base`
  6. Merge pull request #30082 from kamipo/add_missing_blank_line

    dhh committed Aug 5, 2017
    Add missing blank line between `config.active_storage` and `config.action_cable`
  7. Merge pull request #30083 from koic/change_gem_version_of_active_stor…

    dhh committed Aug 5, 2017
    …age_to_5_2_0
    
    Change gem version of Active Storage to 5.2.0.alpha
  8. Merge pull request #30056 from dixpac/remove_unecessary_variable

    dhh committed Aug 5, 2017
    Remove unnecessary variable
Commits on Aug 4, 2017
  1. Merge pull request #30020 from rails/active-storage-import

    dhh committed Aug 4, 2017
    Add Active Storage to Rails
  2. Include active_storage in all generated application.rb files

    dhh committed Aug 4, 2017
    And deal with a temporary test fix until we allow you to skip active storage.
  3. Convert to strings so array can be sorted deterministically

    dhh committed Aug 4, 2017
  4. Deterministic comparisons please

    dhh committed Aug 4, 2017
Commits on Aug 3, 2017
  1. Merge branch 'active-storage-import' of github.com:rails/rails into a…

    dhh committed Aug 3, 2017
    …ctive-storage-import
  2. Active Storage routes are now part of the default routes

    dhh committed Aug 3, 2017
    It's worth considering whether we should hide these by default, but I'm kinda thinking no. It's very reasonable that someone would want to call these directly, so they should be documented.
  3. Same issue from AR getting loaded earlier

    dhh committed Aug 3, 2017
  4. Including new default classes in loading test

    dhh committed Aug 3, 2017
  5. Active Storage loads AR earlier to extend it so require env later

    dhh committed Aug 3, 2017
  6. Generating the app is where the exception is now raised

    dhh committed Aug 3, 2017
Commits on Aug 2, 2017
  1. Merge branch 'master' into active-storage-import

    dhh committed Aug 2, 2017
Commits on Aug 1, 2017
  1. Skip if credentials aren't provided

    dhh committed Aug 1, 2017
  2. Remove circular dependency

    dhh committed Aug 1, 2017