Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions Libraries/WebSocket/Event.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these licenses should be BSD

* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule Event

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may break Facebook's code. cc @vjeux can you grep for this?

*
*/

'use strict';

class Event {
constructor(type) {
this.type = type.toString();
}
}

module.exports = Event;
25 changes: 25 additions & 0 deletions Libraries/WebSocket/MessageEvent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule MessageEvent
*
*/

'use strict';

var Event = require('Event');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious - this is quite a generic name and could conflict with other code in the future. How about calling it WebSocketEvent?


class MessageEvent extends Event {
constructor(type, eventInitDict) {
super(type);

Object.assign(this, eventInitDict);
}
}

module.exports = MessageEvent;
12 changes: 6 additions & 6 deletions Libraries/WebSocket/RCTWebSocket.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/* Begin PBXBuildFile section */
1338BBE01B04ACC80064A9C9 /* RCTSRWebSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = 1338BBDD1B04ACC80064A9C9 /* RCTSRWebSocket.m */; };
1338BBE11B04ACC80064A9C9 /* RCTWebSocketExecutor.m in Sources */ = {isa = PBXBuildFile; fileRef = 1338BBDF1B04ACC80064A9C9 /* RCTWebSocketExecutor.m */; };
3C86DF7C1ADF695F0047B81A /* RCTWebSocketManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C86DF7B1ADF695F0047B81A /* RCTWebSocketManager.m */; };
3C86DF7C1ADF695F0047B81A /* RCTWebSocketModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C86DF7B1ADF695F0047B81A /* RCTWebSocketModule.m */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -18,8 +18,8 @@
1338BBDE1B04ACC80064A9C9 /* RCTWebSocketExecutor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTWebSocketExecutor.h; sourceTree = "<group>"; };
1338BBDF1B04ACC80064A9C9 /* RCTWebSocketExecutor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTWebSocketExecutor.m; sourceTree = "<group>"; };
3C86DF461ADF2C930047B81A /* libRCTWebSocket.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTWebSocket.a; sourceTree = BUILT_PRODUCTS_DIR; };
3C86DF7A1ADF695F0047B81A /* RCTWebSocketManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTWebSocketManager.h; sourceTree = "<group>"; };
3C86DF7B1ADF695F0047B81A /* RCTWebSocketManager.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = RCTWebSocketManager.m; sourceTree = "<group>"; tabWidth = 2; };
3C86DF7A1ADF695F0047B81A /* RCTWebSocketModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTWebSocketModule.h; sourceTree = "<group>"; };
3C86DF7B1ADF695F0047B81A /* RCTWebSocketModule.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = RCTWebSocketModule.m; sourceTree = "<group>"; tabWidth = 2; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -40,8 +40,8 @@
1338BBDD1B04ACC80064A9C9 /* RCTSRWebSocket.m */,
1338BBDE1B04ACC80064A9C9 /* RCTWebSocketExecutor.h */,
1338BBDF1B04ACC80064A9C9 /* RCTWebSocketExecutor.m */,
3C86DF7A1ADF695F0047B81A /* RCTWebSocketManager.h */,
3C86DF7B1ADF695F0047B81A /* RCTWebSocketManager.m */,
3C86DF7A1ADF695F0047B81A /* RCTWebSocketModule.h */,
3C86DF7B1ADF695F0047B81A /* RCTWebSocketModule.m */,
3C86DF471ADF2C930047B81A /* Products */,
);
indentWidth = 2;
Expand Down Expand Up @@ -112,7 +112,7 @@
buildActionMask = 2147483647;
files = (
1338BBE01B04ACC80064A9C9 /* RCTSRWebSocket.m in Sources */,
3C86DF7C1ADF695F0047B81A /* RCTWebSocketManager.m in Sources */,
3C86DF7C1ADF695F0047B81A /* RCTWebSocketModule.m in Sources */,
1338BBE11B04ACC80064A9C9 /* RCTWebSocketExecutor.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@

#import "RCTBridgeModule.h"

@interface RCTWebSocketManager : NSObject <RCTBridgeModule>
@interface RCTWebSocketModule : NSObject <RCTBridgeModule>

@end
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/

#import "RCTWebSocketManager.h"
#import "RCTWebSocketModule.h"

#import "RCTBridge.h"
#import "RCTEventDispatcher.h"
Expand All @@ -29,11 +29,11 @@ - (void)setReactTag:(NSNumber *)reactTag

@end

@interface RCTWebSocketManager () <RCTSRWebSocketDelegate>
@interface RCTWebSocketModule () <RCTSRWebSocketDelegate>

@end

@implementation RCTWebSocketManager
@implementation RCTWebSocketModule
{
RCTSparseArray *_sockets;
}
Expand Down
39 changes: 0 additions & 39 deletions Libraries/WebSocket/WebSocket.android.js

This file was deleted.

126 changes: 0 additions & 126 deletions Libraries/WebSocket/WebSocket.ios.js

This file was deleted.

Loading