From a13f9ae7a7e8e8c695b1e3bd714afbb92ad81591 Mon Sep 17 00:00:00 2001 From: Michael D Date: Fri, 23 May 2025 16:15:14 -0300 Subject: [PATCH 1/5] Create npm-publish.yml --- .github/workflows/npm-publish.yml | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/npm-publish.yml diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 00000000..2a4766d3 --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,33 @@ +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages + +name: Node.js Package + +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + - run: npm ci + - run: npm test + + publish-npm: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + registry-url: https://registry.npmjs.org/ + - run: npm ci + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.npm_token}} From 743aaa3b4c0da6453dac6700be9b17e3b36c6829 Mon Sep 17 00:00:00 2001 From: itsmichaeldiego Date: Fri, 23 May 2025 16:23:12 -0300 Subject: [PATCH 2/5] 2.2.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 70cf63ea..ca29060b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "google-map-react", - "version": "2.2.3", + "version": "2.2.4", "description": "Isomorphic component that allows rendering react components on a google map", "author": "istarkov https://github.com/istarkov", "license": "MIT", From 5776154425ef3dca82b1ea2d993dfa9819c5bd0d Mon Sep 17 00:00:00 2001 From: Ben Hodgson <116538172+BenHodgsonR2R@users.noreply.github.com> Date: Sat, 24 May 2025 05:28:08 +1000 Subject: [PATCH 3/5] Fix: React 18 markers (#1224) * disable batching for _onChange listener * correctly reset cache * move flushsync out of lifecycle method --- src/google_map.js | 6 ++++-- src/google_map_markers.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/google_map.js b/src/google_map.js index c47613ed..c4f365a7 100644 --- a/src/google_map.js +++ b/src/google_map.js @@ -1,7 +1,7 @@ /* eslint-disable import/no-extraneous-dependencies, react/forbid-prop-types, no-console, no-undef */ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import ReactDOM from 'react-dom'; +import ReactDOM, { flushSync } from 'react-dom'; // helpers import GoogleMapMap from './google_map_map'; @@ -703,7 +703,9 @@ class GoogleMap extends Component { this_._onChildMouseMove(); if (this_.markersDispatcher_) { - this_.markersDispatcher_.emit('kON_CHANGE'); + flushSync(() => { + this_.markersDispatcher_.emit('kON_CHANGE'); + }) if (this_.fireMouseEventOnIdle_) { this_.markersDispatcher_.emit('kON_MOUSE_POSITION_CHANGE'); } diff --git a/src/google_map_markers.js b/src/google_map_markers.js index e2fbb666..b6727026 100644 --- a/src/google_map_markers.js +++ b/src/google_map_markers.js @@ -93,7 +93,7 @@ export default class GoogleMapMarkers extends Component { this.props.dispatcher.removeListener('kON_CLICK', this._onChildClick); this.props.dispatcher.removeListener('kON_MDOWN', this._onChildMouseDown); - this.dimensionsCache_ = null; + this.dimensionsCache_ = {}; } _getState = () => ({ From 85378efadee814589745463168ccca8e4493aeb6 Mon Sep 17 00:00:00 2001 From: Dan Cielos Date: Fri, 23 May 2025 13:28:26 -0600 Subject: [PATCH 4/5] Update README.md (fixed a typo) (#1210) Hi! I found a simple typo on README, so I figured I might as well fix it. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4131748e..0f62dbde 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ export default function SimpleMap(){ ### My map doesn't appear! -- Make sure the container element has width and height. The map will try to fill the parent container, but if the container has no size, the map will collapse to 0 width / height. This is not a requirement for google-map-react, [its a requirement for google-maps in general](https://developers.google.com/maps/documentation/javascript/tutorial). +- Make sure the container element has width and height. The map will try to fill the parent container, but if the container has no size, the map will collapse to 0 width / height. This is not a requirement for google-map-react, [it's a requirement for google-maps in general](https://developers.google.com/maps/documentation/javascript/tutorial). ## Installation From 34a8fdd51115822b39d9d010501dbc9b6843869d Mon Sep 17 00:00:00 2001 From: itsmichaeldiego Date: Fri, 23 May 2025 16:28:38 -0300 Subject: [PATCH 5/5] 2.2.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ca29060b..e13031f4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "google-map-react", - "version": "2.2.4", + "version": "2.2.5", "description": "Isomorphic component that allows rendering react components on a google map", "author": "istarkov https://github.com/istarkov", "license": "MIT",