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

react-google-maps

Package Overview
Dependencies
Maintainers
1
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-google-maps - npm Package Compare versions

Comparing version 4.3.1 to 4.3.2

10

CHANGELOG.md

@@ -0,1 +1,11 @@

<a name="4.3.2"></a>
## [4.3.2](https://github.com/tomchentw/react-google-maps/compare/v4.3.1...v4.3.2) (2015-11-17)
### Bug Fixes
* **async/ScriptjsGoogleMap:** switch to _.isEqual for key comparasion ([0a1df35](https://github.com/tomchentw/react-google-maps/commit/0a1df35)), closes [#143](https://github.com/tomchentw/react-google-maps/issues/143)
<a name="4.3.1"></a>

@@ -2,0 +12,0 @@ ## [4.3.1](https://github.com/tomchentw/react-google-maps/compare/v4.3.0...v4.3.1) (2015-11-16)

23

lib/async/ScriptjsGoogleMap.js

@@ -7,2 +7,4 @@ "use strict";

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();

@@ -78,9 +80,7 @@

value: function componentWillReceiveProps(nextProps) {
var _this2 = this;
if ("production" !== process.env.NODE_ENV) {
var changedKeys = (0, _utilsMakeUrl.getUrlObjChangedKeys)(this.props, nextProps);
var changedKeys = Object.keys(ScriptjsGoogleMap.propTypes).filter(function (key) {
return _this2.props[key] !== nextProps[key];
});
(0, _warning2["default"])(0 === changedKeys.length, "ScriptjsGoogleMap doesn't support mutating props after initial render. Changed props: %s", "[" + changedKeys.join(", ") + "]");
(0, _warning2["default"])(0 === changedKeys.length, "ScriptjsGoogleMap doesn't support mutating url related props after initial render. Changed props: %s", "[" + changedKeys.join(", ") + "]");
}
}

@@ -107,13 +107,6 @@ }, {

key: "propTypes",
value: {
// PropTypes for URL generation
// https://nodejs.org/api/url.html#url_url_format_urlobj
protocol: _react.PropTypes.string,
hostname: _react.PropTypes.string.isRequired,
port: _react.PropTypes.number,
pathname: _react.PropTypes.string.isRequired,
query: _react.PropTypes.object.isRequired,
value: _extends({}, _utilsMakeUrl.urlObjDefinition, {
// PropTypes for ScriptjsGoogleMap
loadingElement: _react.PropTypes.node
},
}),
enumerable: true

@@ -120,0 +113,0 @@ }]);

@@ -7,5 +7,14 @@ "use strict";

exports["default"] = makeUrl;
exports.getUrlObjChangedKeys = getUrlObjChangedKeys;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var _url = require("url");
var _react = require("react");
var _lodashIsequal = require("lodash.isequal");
var _lodashIsequal2 = _interopRequireDefault(_lodashIsequal);
function makeUrl(urlObj) {

@@ -21,2 +30,18 @@ return (0, _url.format)({

module.exports = exports["default"];
var urlObjDefinition = {
// PropTypes for URL generation
// https://nodejs.org/api/url.html#url_url_format_urlobj
protocol: _react.PropTypes.string,
hostname: _react.PropTypes.string.isRequired,
port: _react.PropTypes.number,
pathname: _react.PropTypes.string.isRequired,
query: _react.PropTypes.object.isRequired
};
exports.urlObjDefinition = urlObjDefinition;
function getUrlObjChangedKeys(urlObj, nextUrlObj) {
return Object.keys(urlObjDefinition).filter(function (key) {
return !(0, _lodashIsequal2["default"])(urlObj[key], nextUrlObj[key]);
});
}
{
"__template__gist__": "https://gist.github.com/tomchentw/368a93bb748ad9d576f1#file-package-json",
"name": "react-google-maps",
"version": "4.3.1",
"version": "4.3.2",
"description": "React.js Google Maps integration component",

@@ -85,2 +85,3 @@ "main": "lib/index.js",

"invariant": "^2.1.1",
"lodash.isequal": "^3.0.4",
"scriptjs": "^2.5.8",

@@ -87,0 +88,0 @@ "warning": "^2.1.0"

@@ -21,2 +21,4 @@ import {

default as makeUrl,
urlObjDefinition,
getUrlObjChangedKeys,
} from "../utils/makeUrl";

@@ -26,9 +28,3 @@

static propTypes = {
// PropTypes for URL generation
// https://nodejs.org/api/url.html#url_url_format_urlobj
protocol: PropTypes.string,
hostname: PropTypes.string.isRequired,
port: PropTypes.number,
pathname: PropTypes.string.isRequired,
query: PropTypes.object.isRequired,
...urlObjDefinition,
// PropTypes for ScriptjsGoogleMap

@@ -54,6 +50,7 @@ loadingElement: PropTypes.node,

componentWillReceiveProps (nextProps) {
const changedKeys = Object.keys(ScriptjsGoogleMap.propTypes)
.filter(key => this.props[key] !== nextProps[key]);
if ("production" !== process.env.NODE_ENV) {
const changedKeys = getUrlObjChangedKeys(this.props, nextProps);
warning(0 === changedKeys.length, `ScriptjsGoogleMap doesn't support mutating props after initial render. Changed props: %s`, `[${ changedKeys.join(", ") }]`);
warning(0 === changedKeys.length, `ScriptjsGoogleMap doesn't support mutating url related props after initial render. Changed props: %s`, `[${ changedKeys.join(", ") }]`);
}
}

@@ -60,0 +57,0 @@

@@ -5,2 +5,10 @@ import {

import {
PropTypes,
} from "react";
import {
default as isEqual,
} from "lodash.isequal";
export default function makeUrl (urlObj) {

@@ -15,1 +23,16 @@ return formatUrlObj({

}
export const urlObjDefinition = {
// PropTypes for URL generation
// https://nodejs.org/api/url.html#url_url_format_urlobj
protocol: PropTypes.string,
hostname: PropTypes.string.isRequired,
port: PropTypes.number,
pathname: PropTypes.string.isRequired,
query: PropTypes.object.isRequired,
};
export function getUrlObjChangedKeys (urlObj, nextUrlObj) {
return Object.keys(urlObjDefinition)
.filter(key => !isEqual(urlObj[key], nextUrlObj[key]));
}
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