Skip to content

Commit

Permalink
feat!: remove https option (#414)
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath authored and ahangarha committed Mar 28, 2024
1 parent a15a6e2 commit 45474a8
Show file tree
Hide file tree
Showing 10 changed files with 4 additions and 39 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Changes since the last non-beta release.

The usage of those has been deprecated in Shakapacker v7 and now fully removed in v8. See the [v7 Upgrade Guide](./docs/v7_upgrade.md) for more information if you are still yet to address this deprecation.

- Remove `https` option for `webpack-dev-server` [PR 414](https://github.com/shakacode/shakapacker/pull/414) by [G-Rath](https://github.com/g-rath).

- Drop support for Ruby 2.6 [PR 415](https://github.com/shakacode/shakapacker/pull/415) by [G-Rath](https://github.com/g-rath).

## [v7.2.3] - March 23, 2024
Expand Down
17 changes: 1 addition & 16 deletions lib/shakapacker/dev_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,6 @@ def port
fetch(:port)
end

def https?
value = fetch(:https)

unless value.nil?
puts "WARNING: `https: true` has been deprecated in favor of `server: 'https'`"
end

case value
when true, "true", Hash
true
else
false
end
end

def server
server_value = fetch(:server)
server_type = server_value.is_a?(Hash) ? server_value[:type] : server_value
Expand All @@ -65,7 +50,7 @@ def server
end

def protocol
return "https" if server == "https" || https? == true
return "https" if server == "https"

"http"
end
Expand Down
1 change: 0 additions & 1 deletion spec/dummy/config/shakapacker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ development:

# Reference: https://webpack.js.org/configuration/dev-server/
dev_server:
https: false
host: localhost
port: 3035
# Hot Module Replacement updates modules while the application is running without a full reload
Expand Down
1 change: 0 additions & 1 deletion spec/mounted_app/test/dummy/config/webpacker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ development:

# Reference: https://webpack.js.org/configuration/dev-server/
dev_server:
https: false
host: localhost
port: 3035
public: localhost:3035
Expand Down
17 changes: 1 addition & 16 deletions spec/shakapacker/dev_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@
end
end

it "doesn't use https in development environment" do
with_rails_env("development") do
expect(Shakapacker.dev_server.https?).to be false
end
end

it "uses http protocol in development environment" do
with_rails_env("development") do
expect(Shakapacker.dev_server.protocol).to eq "http"
Expand All @@ -48,7 +42,7 @@
context "#protocol in development environment" do
let(:dev_server) { Shakapacker.dev_server }

it "returns `http` by default (with unset `server` and `https`)" do
it "returns `http` by default (with unset `server`)" do
with_rails_env("development") do
expect(dev_server.protocol).to eq "http"
end
Expand All @@ -61,15 +55,6 @@
expect(dev_server.protocol).to eq "https"
end
end

it "returns `https` with unset `server` and `https` set to `true`" do
expect(dev_server).to receive(:server).and_return("http")
expect(dev_server).to receive(:https?).and_return(true)

with_rails_env("development") do
expect(dev_server.protocol).to eq "https"
end
end
end

context "#server in development environment" do
Expand Down
1 change: 0 additions & 1 deletion spec/shakapacker/shakapacker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
allow(dev_server).to receive(:host).and_return("localhost")
allow(dev_server).to receive(:port).and_return("3035")
allow(dev_server).to receive(:pretty?).and_return(false)
allow(dev_server).to receive(:https?).and_return(true)
allow(dev_server).to receive(:running?).and_return(true)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ development:

# Reference: https://webpack.js.org/configuration/dev-server/
dev_server:
https: false
host: localhost
port: 3035
public: localhost:3035
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ development:

# Reference: https://webpack.js.org/configuration/dev-server/
dev_server:
https: false
host: localhost
port: 3035
public: localhost:3035
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ development:

# Reference: https://webpack.js.org/configuration/dev-server/
dev_server:
https: false
host: localhost
port: 3035
public: localhost:3035
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ development:

# Reference: https://webpack.js.org/configuration/dev-server/
dev_server:
https: false
host: localhost
port: 3035
public: localhost:3035
Expand Down

0 comments on commit 45474a8

Please sign in to comment.