1. 20 12月, 2018 1 次提交
  2. 13 12月, 2018 1 次提交
  3. 12 12月, 2018 1 次提交
  4. 05 12月, 2018 1 次提交
  5. 02 12月, 2018 1 次提交
    • R
      Remove circular dependency warnings in ActionCable javascript and publish... · aa1ba9cb
      rmacklin 提交于
      Remove circular dependency warnings in ActionCable javascript and publish source modules with fine-grained exports (#34370)
      
      * Replace several ActionCable.* references with finer-grained imports
      
      This reduces the number of circular dependencies among the module
      imports from 4:
      
      ```
      (!) Circular dependency: app/javascript/action_cable/index.js -> app/javascript/action_cable/connection.js -> app/javascript/action_cable/index.js
      (!) Circular dependency: app/javascript/action_cable/index.js -> app/javascript/action_cable/connection_monitor.js -> app/javascript/action_cable/index.js
      (!) Circular dependency: app/javascript/action_cable/index.js -> app/javascript/action_cable/consumer.js -> app/javascript/action_cable/index.js
      (!) Circular dependency: app/javascript/action_cable/index.js -> app/javascript/action_cable/subscriptions.js -> app/javascript/action_cable/index.js
      ```
      
      to 2:
      
      ```
      (!) Circular dependency: app/javascript/action_cable/index.js -> app/javascript/action_cable/connection.js -> app/javascript/action_cable/index.js
      (!) Circular dependency: app/javascript/action_cable/index.js -> app/javascript/action_cable/connection.js -> app/javascript/action_cable/connection_monitor.js -> app/javascript/action_cable/index.js
      ```
      
      * Remove tests that only test javascript object property assignment
      
      These tests really only assert that you can assign a property to
      the ActionCable global object. That's true for pretty much any object
      in javascript (it would only be false if the object has been frozen, or
      has explicitly set some properties to be nonconfigurable).
      
      * Refactor ActionCable to provide individual named exports
      
      By providing individual named exports rather than a default export which
      is an object with all of those properties, we enable applications to
      only import the functions they need: any unused functions will be
      removed via tree shaking.
      
      Additionally, this restructuring removes the remaining circular
      dependencies by extracting the separate adapters and logger modules, so
      there are now no warnings when compiling the ActionCable bundle.
      
      Note: This produces two small breaking API changes:
      
      - The `ActionCable.WebSocket` getter and setter would be moved to
        `ActionCable.adapters.WebSocket`. If a user is currently configuring
        this, when upgrading they'd need to either add a delegated
        getter/setter themselves, or change it like this:
         ```diff
         -    ActionCable.WebSocket = MyWebSocket
         +    ActionCable.adapters.WebSocket = MyWebSocket
          ```
         Applications which don't change the WebSocket adapter would not need
         any changes for this when upgrading.
      
      - Similarly, the `ActionCable.logger` getter and setter would be moved
        to `ActionCable.adapters.logger`. If a user is currently configuring
        this, when upgrading they'd need to either add a delegated
        getter/setter themselves, or change it like this:
         ```diff
         -    ActionCable.logger = myLogger
         +    ActionCable.adapters.logger = myLogger
          ```
         Applications which don't change the logger would not need any changes
         for this when upgrading.
      
      These two aspects of the public API have to change because there's no
      way to export a property setter for `WebSocket` (or `logger`) such that
      this:
      ```js
      import ActionCable from "actioncable"
      
      ActionCable.WebSocket = MyWebSocket
      ```
      would actually update `adapters.WebSocket`. (We can only offer that if
      we have two separate source files like if `index.js` uses
      `import * as ActionCable from "./action_cable" and then exports a
      wrapper which has delegated getters and setters for those properties.)
      
      This API change is very minor - it should be easy for applications to
      add the `adapters.` prefix in their assignments or to patch in delegated
      setters. And especially because most applications in the wild are not
      ever changing the default value of `ActionCable.WebSocket` or
      `ActionCable.logger` (because the default values are perfect), this API
      breakage is worth the tree-shaking benefits we gain.
      
      * Include source code in published actioncable npm package
      
      This allows actioncable users to ship smaller javascript bundles to
      visitors using modern browsers, as demonstrated in this repository:
      https://github.com/rmacklin/actioncable-es2015-build-example
      
      In that example, the bundle shrinks by 2.8K (25.2%) when you simply
      change the actioncable import to point to the untranspiled src.
      
      If you go a step further, like this:
      ```
      diff --git a/app/scripts/main.js b/app/scripts/main.js
      index 17bc031..1a2b2e0 100644
      --- a/app/scripts/main.js
      +++ b/app/scripts/main.js
      @@ -1,6 +1,6 @@
      -import ActionCable from 'actioncable';
      +import * as ActionCable from 'actioncable';
      
       let cable = ActionCable.createConsumer('wss://cable.example.com');
      
       cable.subscriptions.create('AppearanceChannel', {
      ```
      
      then the bundle shrinks by 3.6K (31.7%)!
      
      In addition to allowing smaller bundles for those who ship untranspiled
      code to modern browsers, including the source code in the published
      package can be useful in other ways:
      
      1. Users can import individual modules rather than the whole library
      2. As a result of (1), users can also monkey patch parts of actioncable
         by importing the relevant module, modifying the exported object, and
         then importing the rest of actioncable (which would then use the
         patched object).
      
      Note: This is the same enhancement that we made to activestorage in
      c0368ad0
      
      * Remove unused commonjs & resolve plugins from ActionCable rollup config
      
      These were added when we copied the rollup config from ActiveStorage,
      but ActionCable does not have any commonjs dependencies (it doesn't have
      any external dependencies at all), so these plugins are unnecessary here
      
      * Change ActionCable.startDebugging() -> ActionCable.logger.enabled=true
      
      and ActionCable.stopDebugging() -> ActionCable.logger.enabled=false
      
      This API is simpler and more clearly describes what it does
      
      * Change Travis configuration to run yarn install at the root for ActionCable builds
      
      This is necessary now that the repository is using Yarn Workspaces
      aa1ba9cb
  6. 27 11月, 2018 1 次提交
    • R
      Convert ActionCable tests from CoffeeScript to ES2015 and replace Blade with... · 85b08036
      rmacklin 提交于
      Convert ActionCable tests from CoffeeScript to ES2015 and replace Blade with Karma and Rollup (#34440)
      
      * Rename .coffee files in ActionCable test suite in prep for decaffeination
      
      * Decaffeinate ActionCable tests
      
      * Replace Blade with Karma and Rollup to run ActionCable JS tests
      
      - Add karma and qunit devDependencies
      
      - Add test script to ActionCable package
      
      - Use rollup to bundle ActionCable tests
      
      - Use karma as the ActionCable JS test runner
      
      * Replace vendored mock-socket with package devDependency in ActionCable
      
      * Move ActionCable yarn install to TravisCI before_install config
      
      * Clean up decaffeinated ActionCable tests to use consistent formatting
      85b08036
  7. 25 11月, 2018 1 次提交
    • Y
      Bump the minimum version of PostgreSQL to 9.3 · 6fb128d1
      Yasuo Honda 提交于
      https://www.postgresql.org/support/versioning/
      
      - 9.1 EOLed on September 2016.
      - 9.2 EOLed on September 2017.
      
      9.3 is also not supported since Nov 8, 2018.  https://www.postgresql.org/about/news/1905/
      I think it may be a little bit early to drop PostgreSQL 9.3 yet.
      
      * Deprecated `supports_ranges?` since no other databases support range data type
      
      * Add `supports_materialized_views?` to abstract adapter
      Materialized views itself is supported by other databases, other connection adapters may support them
      
      * Remove `with_manual_interventions`
      It was only necessary for PostgreSQL 9.1 or earlier
      
      * Drop CI against PostgreSQL 9.2
      6fb128d1
  8. 19 10月, 2018 1 次提交
  9. 11 10月, 2018 1 次提交
  10. 01 10月, 2018 2 次提交
    • R
      Remove duplicated before_install entries in .travis.yml · 2334fe8f
      Ryuta Kamizono 提交于
      It has incorrectly been re-added at #33079.
      
      Related #33861.
      2334fe8f
    • D
      Make Webpacker the default JavaScript compiler for Rails 6 (#33079) · 4838c171
      David Heinemeier Hansson 提交于
      * 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. https://github.com/rails/rails/commit/46215b179483d3e4d264555f5a4952f43eb8142a
      
      * 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 5d3ebb71059f635d3756cbda4ab9752027e09256.
      
      * 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
      4838c171
  11. 18 9月, 2018 1 次提交
    • Y
      CI against PostgreSQL 10 · 342e29bb
      Yasuo Honda 提交于
      - Replace port number 5433 to 5432 (default value) which Active Record unit tests expect
      - Restart PostgreSQL 10 service after changing port number
      - PostgreSQL 10 is a addon for the current Travis CI. Installing
      PostgreSQL 10 would cause longer CI to getting additional apt packages
      Refer https://docs.travis-ci.com/user/database-setup/#PostgreSQL
      
      - Use `sudo: required` for railties CI expecting PostgreSQL is up and running
      342e29bb
  12. 14 9月, 2018 1 次提交
  13. 12 9月, 2018 1 次提交
  14. 25 6月, 2018 1 次提交
  15. 09 6月, 2018 1 次提交
  16. 01 6月, 2018 1 次提交
    • Y
      CI against MariaDB 10.3 · 4d652936
      Yasuo Honda 提交于
      - MariaDB 10.3.7 is the first GA release
      https://mariadb.com/kb/en/library/mariadb-1037-release-notes/
      
      - MariaDB 10.3 translates `LENGTH()` to `OCTET_LENGTH()` function
      
      https://mariadb.com/kb/en/library/sql_modeoracle-from-mariadb-103/
      > MariaDB translates LENGTH() to OCTET_LENGTH()
      
      - MySQL does NOT translate `LENGTH()` to `OCTET_LENGTH()`
      However, it translates `OCTET_LENGTH()` to `LENGTH()`
      
      Here are generated schema dumps of this test to show the differences
      between MySQL and MariaDB:
      
      * MySQL 8.0 (Server version: 8.0.11 MySQL Community Server - GPL)
      ```ruby
        create_table \"virtual_columns\", options: \"ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci\", force: :cascade do |t|
          t.string \"name\"
          t.virtual \"upper_name\", type: :string, as: \"upper(`name`)\"
          t.virtual \"name_length\", type: :integer, as: \"length(`name`)\", stored: true
          t.virtual \"name_octet_length\", type: :integer, as: \"length(`name`)\", stored: true
        end
      ```
      
      * Maria DB 10.3 (Server version: 10.3.7-MariaDB-1:10.3.7+maria~bionic-log mariadb.org binary distribution)
      
      ```ruby
        create_table \"virtual_columns\", options: \"ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci\", force: :cascade do |t|
          t.string \"name\"
          t.virtual \"upper_name\", type: :string, as: \"ucase(`name`)\"
          t.virtual \"name_length\", type: :integer, as: \"octet_length(`name`)\", stored: true
          t.virtual \"name_octet_length\", type: :integer, as: \"octet_length(`name`)\", stored: true
        end
      ```
      4d652936
  17. 31 3月, 2018 1 次提交
  18. 13 3月, 2018 3 次提交
  19. 07 3月, 2018 1 次提交
  20. 21 2月, 2018 1 次提交
    • Y
      CI with `jruby-head` compatible with Ruby 2.4.1 · 00d29e18
      Yasuo Honda 提交于
      Since #32034 Rails 6 requires Ruby 2.4.1 or higher.
      Two CI jobs configured with the latest version of`jruby-9.1.15.0`
      compatibile with Ruby 2.3.3 are getting errors:
      
      https://travis-ci.org/rails/rails/jobs/343519339
      
      ```
      Bundler could not find compatible versions for gem "ruby":
        In Gemfile:
          ruby java
          rails java was resolved to 6.0.0.alpha, which depends on
            ruby (>= 2.4.1) java
      Could not find gem 'ruby (>= 2.4.1)', which is required by gem 'rails', in any
      of the relevant sources:
      ```
      00d29e18
  21. 18 2月, 2018 3 次提交
  22. 17 2月, 2018 1 次提交
  23. 02 2月, 2018 1 次提交
  24. 01 2月, 2018 1 次提交
  25. 07 1月, 2018 2 次提交
  26. 27 12月, 2017 1 次提交
  27. 25 12月, 2017 1 次提交
  28. 22 12月, 2017 2 次提交
  29. 12 12月, 2017 1 次提交
  30. 09 12月, 2017 1 次提交
  31. 06 12月, 2017 1 次提交
  32. 15 11月, 2017 1 次提交
  33. 13 11月, 2017 1 次提交