Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

leancloud-realtime

Package Overview
Dependencies
Maintainers
2
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

leancloud-realtime - npm Package Compare versions

Comparing version 3.0.0-beta.4 to 3.0.0

2

bower.json
{
"name": "leancloud-realtime",
"version": "3.0.0-beta.4",
"version": "3.0.0",
"homepage": "https://github.com/leancloud/js-realtime-sdk/",

@@ -5,0 +5,0 @@ "description": "LeanCloud JavaScript Realtime SDK",

@@ -0,1 +1,17 @@

<a name="3.0.0"></a>
# 3.0.0 (2016-06-22)
同时发布
- leancloud-realtime-typed-messages 1.0.0
### Bug Fixes
* **TypedMessages:** 修复在部分浏览器中抛出 `Object.assign` 未定义的异常 ([a0fa8ca](https://github.com/leancloud/js-realtime-sdk/commit/a0fa8ca))
### Features
* 兼容 IE10 ([75d325d](https://github.com/leancloud/js-realtime-sdk/commit/75d325d))
<a name="3.0.0-beta.4"></a>

@@ -2,0 +18,0 @@ # 3.0.0-beta.4 (2016-05-30)

@@ -37,8 +37,12 @@ /* eslint-disable */

var SAUCE_BROWSERS = [{
// browserName: 'firefox',
// }, {
browserName: 'firefox',
version: 'latest',
platform: 'Windows 7'
}, {
browserName: 'iPhone',
version: '8.0'
}, {
browserName: 'chrome'
browserName: 'chrome',
version: 'latest',
platform: 'Windows 7'
}, {

@@ -125,3 +129,3 @@ browserName: 'chrome',

},
'messages': {
'typed-messages': {
dest: 'typed-messages/dist/typed-messages.js',

@@ -131,7 +135,5 @@ src: 'typed-messages/src/index.js',

plugins: [
babel({
presets: [ 'es2015-rollup' ],
babelrc: false,
babel(Object.assign({}, babelConfigs, {
exclude: 'node_modules/**',
}),
})),
nodeResolve({

@@ -147,6 +149,6 @@ main: true,

moduleId: 'typed-messages',
external: ['leancloud-realtime', 'avoscloud-sdk'],
external: ['leancloud-realtime', 'leancloud-storage'],
globals: {
'leancloud-realtime': 'AV',
'avoscloud-sdk': 'AV',
'leancloud-storage': 'AV',
},

@@ -172,2 +174,11 @@ }

}
},
'typed-messages': {
options: {
sourceMap: true,
sourceMapIn: 'typed-messages/dist/typed-messages.js.map'
},
files: {
'typed-messages/dist/typed-messages.min.js': ['typed-messages/dist/typed-messages.js']
}
}

@@ -210,3 +221,3 @@ },

});
grunt.registerTask('build', ['rollup:dist-browser', 'rollup:dist', 'uglify:browser', 'rollup:messages', 'validate-es5']);
grunt.registerTask('build', ['rollup:dist-browser', 'rollup:dist', 'uglify:browser', 'rollup:typed-messages', 'uglify:typed-messages', 'validate-es5']);
grunt.registerTask('cdn', 'Upload dist to CDN.', function() {

@@ -213,0 +224,0 @@

{
"name": "leancloud-realtime",
"version": "3.0.0-beta.4",
"version": "3.0.0",
"description": "LeanCloud Realtime Message JavaScript SDK",

@@ -35,3 +35,2 @@ "main": "dist/realtime.js",

"devDependencies": {
"avoscloud-sdk": "1.0.0-rc9",
"babel-cli": "^6.9.0",

@@ -45,3 +44,3 @@ "babel-eslint": "^6.0.0",

"conventional-changelog-cli": "^1.1.1",
"docdash": "^0.3.0",
"docdash": "^0.4.0",
"eslint": "^2.10.0",

@@ -62,11 +61,12 @@ "eslint-config-airbnb-base": "^3.0.1",

"jsdoc-ignore-future": "^1.1.0",
"leancloud-storage": "^1.0.0",
"load-grunt-tasks": "^3.4.1",
"mocha": "^2.3.4",
"qiniu": "^6.1.9",
"rollup": "^0.26.0",
"rollup": "^0.32.0",
"rollup-plugin-babel": "^2.4.0",
"rollup-plugin-commonjs": "^2.2.1",
"rollup-plugin-commonjs": "^3.0.0",
"rollup-plugin-json": "^2.0.0",
"rollup-plugin-node-resolve": "^1.4.0",
"should": "^8.2.2",
"should": "^9.0.0",
"should-sinon": "0.0.5",

@@ -77,3 +77,3 @@ "sinon": "2.0.0-pre",

"dependencies": {
"axios": "^0.11.0",
"axios": "^0.12.0",
"babel-runtime": "^6.6.1",

@@ -80,0 +80,0 @@ "debug": "^2.2.0",

LeanCloud JavaScript Realtime SDK
====
[![Build Status](https://img.shields.io/travis/leancloud/js-realtime-sdk/next.svg?style=flat-square)](https://travis-ci.org/leancloud/js-realtime-sdk/branches)
[![Codecov](https://img.shields.io/codecov/c/github/leancloud/js-realtime-sdk/next.svg?style=flat-square)](https://codecov.io/github/leancloud/js-realtime-sdk?branch=next)
[![Build Status](https://img.shields.io/travis/leancloud/js-realtime-sdk.svg?style=flat-square)](https://travis-ci.org/leancloud/js-realtime-sdk)
[![Codecov](https://img.shields.io/codecov/c/github/leancloud/js-realtime-sdk.svg?style=flat-square)](https://codecov.io/github/leancloud/js-realtime-sdk)
[![David](https://img.shields.io/david/leancloud/js-realtime-sdk.svg?style=flat-square)](https://david-dm.org/leancloud/js-realtime-sdk)

@@ -12,16 +12,21 @@ [![npm](https://img.shields.io/npm/v/leancloud-realtime.svg?style=flat-square)](https://www.npmjs.com/package/leancloud-realtime)

----
next 分支上为 3.x 版本。
master 分支上为 2.x 版本,将仅得到安全更新,相关文档参见 [2.x 文档](https://leancloud.cn/docs/js_realtime.html)。
master 分支为开发版本。
v2 分支上为 2.x 版本,将仅得到安全更新,相关文档参见 [2.x 文档](https://leancloud.cn/docs/js_realtime.html)。
3.x 与 2.x 的 API 不兼容,以下说明与文档均指 3.x 版本。
自 v3 起遵循 [语义化版本](http://semver.org/lang/zh-CN/)。
试用 3.x beta 版本:
安装稳定版本:
```
npm install leancloud-realtime@next
npm install leancloud-realtime
```
安装 v2 版本:
```
npm install leancloud-realtime@2
```
支持的运行环境
----
- 浏览器 / WebView
- IE 11 / Edge
- IE 10+ / Edge
- Chrome 31+

@@ -62,3 +67,3 @@ - Firefox latest

0. 提交改动,请遵循 [conversational commit message 风格](http://www.ruanyifeng.com/blog/2016/01/commit_message_change_log.html)
0. 发起 Pull Request 至 **next 分支**
0. 发起 Pull Request 至 master 分支

@@ -105,3 +110,2 @@ ### 项目的目录结构

* `IMClient`:对应即时通讯中的「用户」,持有 connection 与 conversations,负责创建管理将收到的消息处理后在对应 conversation 上派发,所有的 IMClients 共享一个 messageParser
* `PushClient`:not implemented yet
* `MessageParser` 消息解析器,负责将一个 JSON 格式的消息 parse 为对应的 Message 类

@@ -115,3 +119,3 @@ * `Conversation`:实现对话相关的操作

* `TextMessage`:文本消息,继承自 `TypedMessage`
* 其他富媒体消息类(`FileMessage` 及其子类、`LocationMessage`)由于依赖 avoscloud-sdk,作为另一个独立 package 发布
* 其他富媒体消息类(`FileMessage` 及其子类、`LocationMessage`)由于依赖 leancloud-storage,作为另一个独立 package 发布

@@ -152,3 +156,3 @@ ### 开启调试模式

### 持续集成
合并 PR 到 next 分支后持续集成会自动运行 `npm build` 与 `npm run doc`,然后将 dist 目录推送到 dist 分支,将文档与 demo 推送到 gh-pages。
合并 PR 到 master 分支后持续集成会自动运行 `npm build` 与 `npm run doc`,然后将 dist 目录推送到 dist 分支,将文档与 demo 推送到 gh-pages。

@@ -160,8 +164,8 @@ Release Process Workflow

0. Commit `package.json`,`bower.json`,`changelog.md`
0. Push to remote `next` branch
0. Push to remote `master` branch
0. 等待持续集成 pass
0. 使用 GitHub 基于 dist 分支生成 pre-release 包(for bower)
0. Fetch and checkout remote `dist` branch 并确认该提交的内容是即将发布的版本
0. npm publish with `next` tag(`npm publish --tag=next`,需 npm 协作者身份)
0. npm publish(`npm publish`,需 npm 协作者身份),如果是 pre-release 版本需要带 next tag
0. `grunt upload` 上传到 CDN
0. 发布 leancloud-realtime-typed-messages(`cd typed-messages && npm publish`)
/* eslint-disable no-param-reassign */
import { getStaticProperty, isIE10 } from '../utils';

@@ -16,8 +17,3 @@ /**

* @example @messageType(1)
* class CustomMessage extends TypedMessage {
* // IE10- hack: https://phabricator.babeljs.io/T116
* static parse(...args) {
* return super.parse(...args);
* }
* }
* class CustomMessage extends TypedMessage {}
*

@@ -52,6 +48,2 @@ * // 不支持 decorator 的情况下可以这样使用

* }
* // IE10- hack: https://phabricator.babeljs.io/T116
* static parse(...args) {
* return super.parse(...args);
* }
* }

@@ -80,6 +72,22 @@ *

return target => {
const originalCustomFields = Array.isArray(target._customFields)
? target._customFields : [];
// IE10 Hack:
// static properties in IE10 will not be inherited from super
// search for parse method and assign it manually
let originalCustomFields = isIE10
? getStaticProperty(target, '_customFields')
: target._customFields;
originalCustomFields = Array.isArray(originalCustomFields)
? originalCustomFields : [];
target._customFields = originalCustomFields.concat(fields);
};
};
// IE10 Hack:
// static properties in IE10 will not be inherited from super
// search for parse method and assign it manually
export const IE10Compatible = target => {
if (isIE10) {
target.parse = getStaticProperty(target, 'parse');
}
};
import TypedMessage from './typed-message';
import { messageType } from './helpers';
import { messageType, IE10Compatible } from './helpers';
// jsdoc-ignore-start
@messageType(-1)
@IE10Compatible
// jsdoc-ignore-end

@@ -7,0 +8,0 @@ export default class TextMessage extends TypedMessage {

import Message from './message';
import { messageField } from './helpers';
import { getStaticProperty, isIE10 } from '../utils';

@@ -105,4 +106,6 @@ // jsdoc-ignore-start

message.content = json; // eslint-disable-line no-param-reassign
let fields = Array.isArray(message.constructor._customFields)
? message.constructor._customFields : [];
const customFields = isIE10
? getStaticProperty(message.constructor, '_customFields')
: message.constructor._customFields;
let fields = Array.isArray(customFields) ? customFields : [];
fields = fields.reduce((result, field) => {

@@ -109,0 +112,0 @@ if (typeof field !== 'string') return result;

@@ -256,5 +256,7 @@ import Connection from './connection';

if (message.peerId !== null) {
const client = this._clients[message.peerId];
if (client) {
return Promise.resolve(client._dispatchMessage(message)).catch(debug);
const targetClient = this._clients[message.peerId];
if (targetClient) {
return Promise.resolve(targetClient)
.then(client => client._dispatchMessage(message))
.catch(debug);
}

@@ -261,0 +263,0 @@ return debug(

@@ -66,2 +66,13 @@ import isPlainObject from 'lodash/isPlainObject';

export const isIE10 = (
global.navigator &&
global.navigator.userAgent &&
global.navigator.userAgent.indexOf('MSIE 10.') !== -1
);
/* eslint-disable no-proto */
export const getStaticProperty = (klass, property) =>
(klass[property] || (klass.__proto__ ? getStaticProperty(klass.__proto__, property) : undefined));
/* eslint-enable no-proto */
export const union = (a, b) => Array.from(new Set([...a, ...b]));

@@ -68,0 +79,0 @@ export const difference = (a, b) => Array.from(

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc