Skip to content

Commit

Permalink
Merge branch 'main' into handle-suspense
Browse files Browse the repository at this point in the history
  • Loading branch information
guochengcheng04 committed Sep 19, 2022
2 parents bd148fe + 4f8b014 commit af5313d
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 14 deletions.
5 changes: 0 additions & 5 deletions .changeset/clean-boats-repeat.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/red-cups-yell.md

This file was deleted.

6 changes: 6 additions & 0 deletions packages/mobx-react/CHANGELOG.md
@@ -1,5 +1,11 @@
# mobx-react

## 7.5.3

### Patch Changes

- [`78d1aa23`](https://github.com/mobxjs/mobx/commit/78d1aa2362b4dc5d521518688d6ac7e2d4f7ad3a) [#3458](https://github.com/mobxjs/mobx/pull/3458) Thanks [@egilll](https://github.com/egilll)! - A slight revamp of the README, wording, and clearer links

## 7.5.2

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/mobx-react/package.json
@@ -1,6 +1,6 @@
{
"name": "mobx-react",
"version": "7.5.2",
"version": "7.5.3",
"description": "React bindings for MobX. Create fully reactive components.",
"source": "src/index.ts",
"main": "dist/index.js",
Expand Down Expand Up @@ -51,7 +51,7 @@
}
},
"devDependencies": {
"mobx": "^6.6.1",
"mobx": "^6.6.2",
"mobx-react-lite": "^3.4.0"
},
"keywords": [
Expand Down
10 changes: 10 additions & 0 deletions packages/mobx/CHANGELOG.md
@@ -1,5 +1,15 @@
# mobx

## 6.6.2

### Patch Changes

- [`b375535c`](https://github.com/mobxjs/mobx/commit/b375535c422453963f5d3485a2ef5233568c12a6) [#3344](https://github.com/mobxjs/mobx/pull/3344) Thanks [@Nokel81](https://github.com/Nokel81)! - Allow readonly tuples as part of IObservableMapInitialValues

* [`7260cd41`](https://github.com/mobxjs/mobx/commit/7260cd413b1e52449523826ac239c2a197b2880f) [#3516](https://github.com/mobxjs/mobx/pull/3516) Thanks [@urugator](https://github.com/urugator)! - fix regression #3514: LegacyObservableArray compat with Safari 9.\*

- [`78d1aa23`](https://github.com/mobxjs/mobx/commit/78d1aa2362b4dc5d521518688d6ac7e2d4f7ad3a) [#3458](https://github.com/mobxjs/mobx/pull/3458) Thanks [@egilll](https://github.com/egilll)! - A slight revamp of the README, wording, and clearer links

## 6.6.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/mobx/package.json
@@ -1,6 +1,6 @@
{
"name": "mobx",
"version": "6.6.1",
"version": "6.6.2",
"description": "Simple, scalable state management.",
"source": "src/mobx.ts",
"main": "dist/index.js",
Expand Down
21 changes: 21 additions & 0 deletions packages/mobx/src/types/legacyobservablearray.ts
Expand Up @@ -14,6 +14,21 @@ import {
defineProperty
} from "../internal"

// Bug in safari 9.* (or iOS 9 safari mobile). See #364
const ENTRY_0 = createArrayEntryDescriptor(0)

const safariPrototypeSetterInheritanceBug = (() => {
let v = false
const p = {}
Object.defineProperty(p, "0", {
set: () => {
v = true
}
})
Object.create(p)["0"] = 1
return v === false
})()

/**
* This array buffer contains two lists of properties, so that all arrays
* can recycle their property definitions, which significantly improves performance of creating
Expand Down Expand Up @@ -57,6 +72,12 @@ class LegacyObservableArray<T> extends StubArray {
this.spliceWithArray(0, 0, initialValues)
allowStateChangesEnd(prev)
}

if (safariPrototypeSetterInheritanceBug) {
// Seems that Safari won't use numeric prototype setter untill any * numeric property is
// defined on the instance. After that it works fine, even if this property is deleted.
Object.defineProperty(this, "0", ENTRY_0)
}
}

concat(...arrays: T[][]): T[] {
Expand Down

0 comments on commit af5313d

Please sign in to comment.