Skip to content

Commit

Permalink
docs: deprecate settings.domains (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
sherwinski authored Jun 3, 2019
1 parent 8deb9f3 commit 950c7ba
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ console.log(url); // => "https://my-social-network.imgix.net/users/1.png?w=400&h
```

## Domain Sharded URLs
**Warning: Domain Sharding has been deprecated and will be removed in the next major release**<br>
**Warning: Domain Sharding has been deprecated and will be removed in the next major release. As a result, the `domains` argument will be deprecated in favor of `domain` instead.**<br>
To find out more, see our [blog post](https://blog.imgix.com/2019/05/03/deprecating-domain-sharding) explaining the decision to remove this feature.

Domain sharding enables you to spread image requests across multiple domains.
Expand Down
2 changes: 1 addition & 1 deletion src/imgix-core-js.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
this.settings.domains = [this.settings.domains];
}
else {
console.warn("Warning: Domain sharding has been deprecated and will be removed in the next major version.");
console.warn("Warning: Domain sharding has been deprecated and will be removed in the next major version.\nAs a result, the 'domains' argument will be deprecated in favor of 'domain' instead.");
}

if (!this.settings.host && this.settings.domains.length === 0) {
Expand Down
16 changes: 8 additions & 8 deletions test/test-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('Imgix client:', function describeSuite() {
});

it('initializes with domains list', function testSpec() {
var deprecation_warning = "Warning: Domain sharding has been deprecated and will be removed in the next major version.";
var deprecation_warning = "Warning: Domain sharding has been deprecated and will be removed in the next major version.\nAs a result, the 'domains' argument will be deprecated in favor of 'domain' instead.";
stub = sinon.stub(console, 'warn').callsFake(function(warning) {
assert.equal(warning, deprecation_warning);
});
Expand All @@ -55,7 +55,7 @@ describe('Imgix client:', function describeSuite() {
});

it('errors with invalid shard strategy', function testSpec() {
var deprecation_warning = "Warning: Domain sharding has been deprecated and will be removed in the next major version.";
var deprecation_warning = "Warning: Domain sharding has been deprecated and will be removed in the next major version.\nAs a result, the 'domains' argument will be deprecated in favor of 'domain' instead.";
var stub = sinon.stub(console, 'warn').callsFake(function(warning) {
assert.equal(warning, deprecation_warning);
});
Expand All @@ -71,7 +71,7 @@ describe('Imgix client:', function describeSuite() {
});

it('errors with invalid domain - appended slash', function testSpec() {
var deprecation_warning = "Warning: Domain sharding has been deprecated and will be removed in the next major version.";
var deprecation_warning = "Warning: Domain sharding has been deprecated and will be removed in the next major version.\nAs a result, the 'domains' argument will be deprecated in favor of 'domain' instead.";
var stub = sinon.stub(console, 'warn').callsFake(function(warning) {
assert.equal(warning, deprecation_warning);
});
Expand All @@ -84,7 +84,7 @@ describe('Imgix client:', function describeSuite() {
});

it('errors with invalid domain - prepended scheme ', function testSpec() {
var deprecation_warning = "Warning: Domain sharding has been deprecated and will be removed in the next major version.";
var deprecation_warning = "Warning: Domain sharding has been deprecated and will be removed in the next major version.\nAs a result, the 'domains' argument will be deprecated in favor of 'domain' instead.";
var stub = sinon.stub(console, 'warn').callsFake(function(warning) {
assert.equal(warning, deprecation_warning);
});
Expand All @@ -97,7 +97,7 @@ describe('Imgix client:', function describeSuite() {
});

it('errors with invalid domain - appended dash ', function testSpec() {
var deprecation_warning = "Warning: Domain sharding has been deprecated and will be removed in the next major version.";
var deprecation_warning = "Warning: Domain sharding has been deprecated and will be removed in the next major version.\nAs a result, the 'domains' argument will be deprecated in favor of 'domain' instead.";
var stub = sinon.stub(console, 'warn').callsFake(function(warning) {
assert.equal(warning, deprecation_warning);
});
Expand Down Expand Up @@ -372,7 +372,7 @@ describe('Imgix client:', function describeSuite() {
describe('Sharding', function describeSuite() {
describe('CRC', function describeSuite() {
it('path resolves to same domain', function testSpec() {
var deprecation_warning = "Warning: Domain sharding has been deprecated and will be removed in the next major version.";
var deprecation_warning = "Warning: Domain sharding has been deprecated and will be removed in the next major version.\nAs a result, the 'domains' argument will be deprecated in favor of 'domain' instead.";
var stub = sinon.stub(console, 'warn').callsFake(function(warning) {
assert.equal(warning, deprecation_warning);
});
Expand Down Expand Up @@ -412,7 +412,7 @@ describe('Imgix client:', function describeSuite() {

describe('Cyclic', function describeSuite() {
it('domains cycle', function testSpec() {
var deprecation_warning = "Warning: Domain sharding has been deprecated and will be removed in the next major version.";
var deprecation_warning = "Warning: Domain sharding has been deprecated and will be removed in the next major version.\nAs a result, the 'domains' argument will be deprecated in favor of 'domain' instead.";
var stub = sinon.stub(console, 'warn').callsFake(function(warning) {
assert.equal(warning, deprecation_warning);
});
Expand All @@ -434,7 +434,7 @@ describe('Imgix client:', function describeSuite() {
});

it('single domain sharding', function testSpec() {
var deprecation_warning = "Warning: Domain sharding has been deprecated and will be removed in the next major version.";
var deprecation_warning = "Warning: Domain sharding has been deprecated and will be removed in the next major version.\nAs a result, the 'domains' argument will be deprecated in favor of 'domain' instead.";
var stub = sinon.stub(console, 'warn').callsFake(function(warning) {
assert.equal(warning, deprecation_warning);
});
Expand Down

0 comments on commit 950c7ba

Please sign in to comment.