Skip to content

Commit dc2d3ad

Browse files
authored
Remove external URL dependency (Azure#15300)
* Remove external URL dependency to address compatibility issues
1 parent 6968df5 commit dc2d3ad

File tree

8 files changed

+25
-7
lines changed

8 files changed

+25
-7
lines changed

sdk/web-pubsub/web-pubsub/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Release History
2+
## 1.0.0-beta.2 (2021-05-19)
3+
Remove "url" dependency
24

35
## 1.0.0-beta.1 (2021-04-23)
46

sdk/web-pubsub/web-pubsub/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@azure/web-pubsub",
3-
"version": "1.0.0-beta.1",
3+
"version": "1.0.0-beta.2",
44
"description": "Azure client library for Azure Web PubSub",
55
"sdk-type": "client",
66
"main": "dist/index.js",
@@ -41,6 +41,9 @@
4141
"README.md",
4242
"LICENSE"
4343
],
44+
"browser": {
45+
"./dist-esm/src/util/url.js": "./dist-esm/src/util/url.browser.js"
46+
},
4447
"repository": "github:Azure/azure-sdk-for-js",
4548
"keywords": [
4649
"Azure",
@@ -114,7 +117,6 @@
114117
"sinon": "^9.0.2",
115118
"source-map-support": "^0.5.9",
116119
"typescript": "~4.2.0",
117-
"url": "^0.11.0",
118120
"typedoc": "0.15.2"
119121
},
120122
"//sampleConfiguration": {

sdk/web-pubsub/web-pubsub/review/web-pubsub.api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export class WebPubSubServiceClient {
179179
sendToConnection(connectionId: string, message: JSONTypes, options?: HubSendToConnectionOptions): Promise<RestResponse>;
180180
sendToConnection(connectionId: string, message: HttpRequestBody | JSONTypes, options?: HubSendToConnectionOptions | HubSendTextToConnectionOptions): Promise<RestResponse>;
181181
sendToUser(username: string, message: string, options: HubSendTextToUserOptions): Promise<RestResponse>;
182-
sendToUser(username: string, message: JSONTypes, options: HubSendTextToUserOptions): Promise<RestResponse>;
182+
sendToUser(username: string, message: JSONTypes, options?: HubSendToUserOptions): Promise<RestResponse>;
183183
sendToUser(username: string, message: HttpRequestBody, options?: HubSendToUserOptions | HubSendTextToUserOptions): Promise<RestResponse>;
184184
}
185185

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT license.
3+
4+
/// <reference lib="dom" />

sdk/web-pubsub/web-pubsub/src/hubClient.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ export class WebPubSubServiceClient {
344344
): Promise<RestResponse>;
345345

346346
public async sendToAll(
347-
message: HttpRequestBody | JSONTypes,
347+
message: HttpRequestBody | string,
348348
options: HubSendToAllOptions | HubSendTextToAllOptions = {}
349349
): Promise<RestResponse> {
350350
const normalizedOptions = normalizeSendToAllOptions(options);
@@ -389,7 +389,7 @@ export class WebPubSubServiceClient {
389389
public async sendToUser(
390390
username: string,
391391
message: JSONTypes,
392-
options: HubSendTextToUserOptions
392+
options?: HubSendToUserOptions
393393
): Promise<RestResponse>;
394394

395395
/**
@@ -406,7 +406,7 @@ export class WebPubSubServiceClient {
406406
): Promise<RestResponse>;
407407
public async sendToUser(
408408
username: string,
409-
message: JSONTypes | HttpRequestBody,
409+
message: string | HttpRequestBody,
410410
options: HubSendToUserOptions = {}
411411
): Promise<RestResponse> {
412412
const { span, updatedOptions } = createSpan("WebPubSubServiceClient-hub-sendToUser", options);

sdk/web-pubsub/web-pubsub/src/parseConnectionString.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { AzureKeyCredential } from "@azure/core-auth";
2-
import { URL } from "url";
2+
import { URL } from "./util/url";
33

44
interface ParsedConnectionString {
55
credential: AzureKeyCredential;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT license.
3+
4+
const url = URL;
5+
6+
export { url as URL };
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT license.
3+
4+
export { URL } from "url";

0 commit comments

Comments
 (0)