From dc090269b9aaaa5a523c86ec359ae1db55edfa04 Mon Sep 17 00:00:00 2001 From: Junshan Liu Date: Wed, 12 Mar 2025 10:21:12 +0800 Subject: [PATCH 1/4] fix isReactElement for react 19 --- src/seamless-immutable.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/seamless-immutable.js b/src/seamless-immutable.js index f9ead88..250899d 100644 --- a/src/seamless-immutable.js +++ b/src/seamless-immutable.js @@ -3,9 +3,9 @@ function immutableInit(config) { - // https://github.com/facebook/react/blob/v15.0.1/src/isomorphic/classic/element/ReactElement.js#L21 - var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol.for && Symbol.for('react.element'); - var REACT_ELEMENT_TYPE_FALLBACK = 0xeac7; + // https://github.com/facebook/react/blob/v19.0.0/packages/shared/ReactSymbols.js#L16 + var REACT_LEGACY_ELEMENT_TYPE = Symbol.for('react.element'); + var REACT_ELEMENT_TYPE = Symbol.for('react.transitional.element') var globalConfig = { use_static: false @@ -604,7 +604,7 @@ function immutableInit(config) { function isReactElement(obj) { return typeof obj === 'object' && obj !== null && - (obj.$$typeof === REACT_ELEMENT_TYPE_FALLBACK || obj.$$typeof === REACT_ELEMENT_TYPE); + (obj.$$typeof === REACT_ELEMENT_TYPE || obj.$$typeof === REACT_LEGACY_ELEMENT_TYPE); } function isFileObject(obj) { From 4303ac52609877049ed1425bbff59ba57d3f79f4 Mon Sep 17 00:00:00 2001 From: Junshan Liu Date: Thu, 13 Mar 2025 14:54:10 +0800 Subject: [PATCH 2/4] fix isReactElement for react 19 --- seamless-immutable.development.js | 8 ++++---- seamless-immutable.development.min.js | 2 +- seamless-immutable.production.min.js | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/seamless-immutable.development.js b/seamless-immutable.development.js index db02798..dd277e1 100644 --- a/seamless-immutable.development.js +++ b/seamless-immutable.development.js @@ -3,9 +3,9 @@ function immutableInit(config) { - // https://github.com/facebook/react/blob/v15.0.1/src/isomorphic/classic/element/ReactElement.js#L21 - var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol.for && Symbol.for('react.element'); - var REACT_ELEMENT_TYPE_FALLBACK = 0xeac7; + // https://github.com/facebook/react/blob/v19.0.0/packages/shared/ReactSymbols.js#L16 + var REACT_LEGACY_ELEMENT_TYPE = Symbol.for('react.element'); + var REACT_ELEMENT_TYPE = Symbol.for('react.transitional.element') var globalConfig = { use_static: false @@ -604,7 +604,7 @@ function immutableInit(config) { function isReactElement(obj) { return typeof obj === 'object' && obj !== null && - (obj.$$typeof === REACT_ELEMENT_TYPE_FALLBACK || obj.$$typeof === REACT_ELEMENT_TYPE); + (obj.$$typeof === REACT_ELEMENT_TYPE || obj.$$typeof === REACT_LEGACY_ELEMENT_TYPE); } function isFileObject(obj) { diff --git a/seamless-immutable.development.min.js b/seamless-immutable.development.min.js index d20c521..2059a09 100644 --- a/seamless-immutable.development.min.js +++ b/seamless-immutable.development.min.js @@ -1 +1 @@ -/* (c) 2017, Richard Feldman, github.com/rtfeldman/seamless-immutable/blob/master/LICENSE */!function(){"use strict";function a(b){function c(a){return"object"==typeof a&&!Array.isArray(a)&&null!==a}function d(a){var b=Object.getPrototypeOf(a);return b?Object.create(b):{}}function e(a,b,c){Object.defineProperty(a,b,{enumerable:!1,configurable:!1,writable:!1,value:c})}function f(a,b){e(a,b,function(){throw new k("The "+b+" method cannot be invoked on an Immutable data structure.")})}function g(a){e(a,V,!0)}function h(a){return"object"!=typeof a||(null===a||Boolean(Object.getOwnPropertyDescriptor(a,V)))}function i(a,b){return a===b||a!==a&&b!==b}function j(a){return!(null===a||"object"!=typeof a||Array.isArray(a)||a instanceof Date)}function k(a){this.name="MyError",this.message=a,this.stack=(new Error).stack}function l(a,b){g(a);for(var c in b)b.hasOwnProperty(c)&&f(a,b[c]);return Object.freeze(a),a}function m(a,b){var c=a[b];e(a,b,function(){return O(c.apply(a,arguments))})}function n(a,b,c){var d=c&&c.deep;if(a in this&&(d&&this[a]!==b&&j(b)&&j(this[a])&&(b=O.merge(this[a],b,{deep:!0,mode:"replace"})),i(this[a],b)))return this;var e=u.call(this);return e[a]=O(b),p(e)}function o(a,b,c){var d=a[0];if(1===a.length)return n.call(this,d,b,c);var e,f=a.slice(1),g=this[d];if("object"==typeof g&&null!==g)e=O.setIn(g,f,b);else{var h=f[0];e=""!==h&&isFinite(h)?o.call(_,f,b):A.call(aa,f,b)}if(d in this&&g===e)return this;var i=u.call(this);return i[d]=e,p(i)}function p(a){for(var b in Z)if(Z.hasOwnProperty(b)){var c=Z[b];m(a,c)}U.use_static||(e(a,"flatMap",s),e(a,"asObject",v),e(a,"asMutable",u),e(a,"set",n),e(a,"setIn",o),e(a,"update",C),e(a,"updateIn",E),e(a,"getIn",F));for(var d=0,f=a.length;d Date: Thu, 13 Mar 2025 15:00:25 +0800 Subject: [PATCH 3/4] update package.json --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 1a2ccbf..2f4eef5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "seamless-immutable", - "version": "7.1.4", + "name": "@qlqllu/seamless-immutable", + "version": "7.1.5", "description": "Immutable data structures for JavaScript which are backwards-compatible with normal JS Arrays and Objects.", "main": "src/seamless-immutable.js", "browser": "seamless-immutable.development.js", @@ -34,7 +34,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/rtfeldman/seamless-immutable.git" + "url": "https://github.com/qlqllu/seamless-immutable" }, "keywords": [ "immutable" @@ -49,5 +49,5 @@ "validthis": true, "proto": true }, - "homepage": "https://github.com/rtfeldman/seamless-immutable" + "homepage": "https://github.com/qlqllu/seamless-immutable" } From b56c9c3dfc6d1f5923d36a9c6b3a7ae2679fd3c0 Mon Sep 17 00:00:00 2001 From: Junshan Liu Date: Wed, 13 Aug 2025 09:21:03 +0800 Subject: [PATCH 4/4] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 6336c4b..18d4078 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +This repo is forked from [rtfeldman/seamless-immutable](https://github.com/rtfeldman/seamless-immutable) to support React 19. +------------------ + seamless-immutable ==================