Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .changeset/fresh-computed-super.md

This file was deleted.

3 changes: 0 additions & 3 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,5 @@ jobs:
- name: Test size
run: npm run test:size

- name: Test flow
run: npm -w mobx run test:flow

- name: Test performance
run: npm -w mobx run test:performance
22 changes: 4 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 0 additions & 11 deletions packages/mobx/.flowconfig

This file was deleted.

8 changes: 8 additions & 0 deletions packages/mobx/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# mobx

## 6.16.1

### Patch Changes

- [`7fd93348e81f484c4ec2dcca8cde5fa6ed7412fe`](https://github.com/mobxjs/mobx/commit/7fd93348e81f484c4ec2dcca8cde5fa6ed7412fe) [#4661](https://github.com/mobxjs/mobx/pull/4661) Thanks [@js2me](https://github.com/js2me)! - Fix Stage 3 `@computed` overrides that delegate to a same-named parent getter via `super`.

- [`02afa5b6c33441737df81d344161a03bb9aea0c8`](https://github.com/mobxjs/mobx/commit/02afa5b6c33441737df81d344161a03bb9aea0c8) [#4666](https://github.com/mobxjs/mobx/pull/4666) Thanks [@kubk](https://github.com/kubk)! - Remove outdated Flow typechecker support artifacts from the package.

## 6.16.0

### Minor Changes
Expand Down
13 changes: 0 additions & 13 deletions packages/mobx/__tests__/.babelrc

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as mobx from "../../../src/mobx"
import * as mobx from "../../src/mobx"
import * as utils from "../utils/test-utils"

test("action should wrap in transaction", () => {
Expand Down Expand Up @@ -341,7 +341,6 @@ test("runInAction", () => {
{ arguments: [], name: "<unnamed action>" }
])

mobx.configure({ enforceActions: "never" })
spyDisposer()

d()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const mobx = require("../../../src/mobx.ts")
const mobx = require("../../src/mobx.ts")

test("correct api should be exposed", function () {
expect(
Expand Down Expand Up @@ -80,6 +80,6 @@ test("correct api should be exposed", function () {
})

test("mobx has no dependencies", () => {
const pkg = require("../../../package.json")
const pkg = require("../../package.json")
expect(pkg.dependencies).toEqual({})
})
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict"

const mobx = require("../../../src/mobx.ts")
const mobx = require("../../src/mobx.ts")
const { observable, when, _getAdministration, reaction, computed, makeObservable, autorun } = mobx
const iterall = require("iterall")

Expand Down Expand Up @@ -188,7 +188,7 @@ test("findLast(findLastIndex) and remove", function () {
}
return false
}
;[].findLastIndex;
;[].findLastIndex
expect(a.findLast(predicate)).toBe(20)
expect(a.findLastIndex(predicate)).toBe(2)
expect(a.findLast(predicate)).toBe(20)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* @type {typeof import("./../../../src/v5/mobx")}
* @type {typeof import("./../../src/mobx")}
*/
const mobx = require("../../../src/mobx.ts")
const utils = require("../../v5/utils/test-utils")
const mobx = require("../../src/mobx.ts")
const utils = require("../utils/test-utils")

test("autorun passes Reaction as an argument to view function", function () {
const a = mobx.observable.box(1)
Expand Down Expand Up @@ -143,8 +143,6 @@ test("when effect is an action", function (done) {
() => a.get() === 1,
() => {
a.set(2)

mobx.configure({ enforceActions: "never" })
done()
},
{ timeout: 1 }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* @type {typeof import("../../../src/v5/mobx")}
* @type {typeof import("../../src/mobx")}
*/
const mobx = require("../../../src/mobx.ts")
const mobx = require("../../src/mobx.ts")

const utils = require("../../v5/utils/test-utils")
const utils = require("../utils/test-utils")

const { $mobx } = mobx

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import {
isAction,
configure,
makeObservable
} from "../../../src/mobx"
import * as mobx from "../../../src/mobx"
} from "../../src/mobx"
import * as mobx from "../../src/mobx"

test("babel", function () {
class Box {
Expand Down Expand Up @@ -428,8 +428,6 @@ test("267 (babel) should be possible to declare properties observable outside st
}
}
Store // just to avoid linter warning

configure({ enforceActions: "never" })
})

test("288 atom not detected for object property", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import {
isAction,
configure,
makeObservable
} from "../../../src/mobx"
import * as mobx from "../../../src/mobx"
} from "../../src/mobx"
import * as mobx from "../../src/mobx"

test("babel", function () {
class Box {
Expand Down Expand Up @@ -489,8 +489,6 @@ test("267 (babel) should be possible to declare properties observable outside st
}
}
Store // just to avoid linter warning

configure({ enforceActions: "never" })
})

test("288 atom not detected for object property", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
onBecomeUnobserved,
runInAction,
makeAutoObservable
} from "../../../src/mobx"
} from "../../src/mobx"

describe("become-observed", () => {
it("work on map with number as key", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const m = require("../mobx4")
const m = require("../../src/mobx.ts")

test("cascading active state (form 1)", function () {
const Store = function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
isComputedProp,
isAction,
makeObservable
} from "../../../src/mobx"
} from "../../src/mobx"

// @ts-ignore
import { primitive, serialize, deserialize, createModelSchema } from "serializr"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const mobx = require("../../../src/mobx.ts")
const mobx = require("../../src/mobx.ts")
const m = mobx
const utils = require("../../v5/utils/test-utils")
const utils = require("../utils/test-utils")

const { observable, computed, $mobx, autorun } = mobx

Expand Down Expand Up @@ -739,42 +739,33 @@ test("it should be possible to handle global errors in reactions - 2 - #1480", (
test("global error handling will be skipped when using disableErrorBoundaries - 1", () => {
utils.supressConsole(() => {
mobx.configure({ disableErrorBoundaries: true })
try {
mobx.observable.box(1)

expect(() => {
mobx.autorun(function () {
throw "OOPS"
})
}).toThrow(/OOPS/)
} finally {
mobx.configure({ disableErrorBoundaries: false })
mobx._resetGlobalState()
}

mobx.observable.box(1)

expect(() => {
mobx.autorun(function () {
throw "OOPS"
})
}).toThrow(/OOPS/)
})
})

test("global error handling will be skipped when using disableErrorBoundaries - 2", () => {
utils.supressConsole(() => {
mobx.configure({ disableErrorBoundaries: true })
try {
const a = mobx.observable.box(1)
const a = mobx.observable.box(1)

const d = mobx.reaction(
() => a.get(),
() => {
throw "OOPS"
}
)
expect(() => {
a.set(2)
}).toThrow(/OOPS/)

d()
} finally {
mobx.configure({ disableErrorBoundaries: false })
mobx._resetGlobalState()
}
const d = mobx.reaction(
() => a.get(),
() => {
throw "OOPS"
}
)
expect(() => {
a.set(2)
}).toThrow(/OOPS/)

d()
})
})

Expand Down Expand Up @@ -857,13 +848,6 @@ describe("es5 compat warnings", () => {
`[Error: [MobX] MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead.]`
)
})

afterEach(() => {
mobx._resetGlobalState()
mobx.configure({
useProxies: "always"
})
})
})

test("should throw when adding properties in ES5 compat mode", () => {})
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
extendObservable,
observable,
reaction
} from "../../../src/mobx"
} from "../../src/mobx"

test("extendObservable should work", function () {
class Box {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const mobx = require("../../../src/mobx.ts")
const mobx = require("../../src/mobx.ts")
const m = mobx

const { $mobx } = mobx
Expand Down Expand Up @@ -914,7 +914,7 @@ test("Default debug names - development", () => {
})

test("Default debug names - production", () => {
const mobx = require(`../../../dist/mobx.cjs.production.min.js`)
const mobx = require(`../../dist/mobx.cjs.production.min.js`)

expect(mobx.getDebugName(mobx.observable({ x() {} }, { x: mobx.action }).x)).toBe("x") // perhaps should be "<unnamed action>"??
expect(mobx.getDebugName(mobx.createAtom())).toBe("Atom")
Expand All @@ -941,7 +941,7 @@ test("Default debug names - production", () => {

test("User provided debug names are always respected", () => {
const mobxDevelopment = mobx
const mobxProduction = require(`../../../dist/mobx.cjs.production.min.js`)
const mobxProduction = require(`../../dist/mobx.cjs.production.min.js`)

const name = "CustomName"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as mobx from "../../../src/mobx"
import * as mobx from "../../src/mobx"
import {
flow,
FlowCancellationError,
isFlowCancellationError,
makeObservable
} from "../../../src/mobx"
} from "../../src/mobx"

function delay(time, value, shouldThrow = false) {
return new Promise((resolve, reject) => {
Expand Down Expand Up @@ -277,7 +277,6 @@ test("flows can be cancelled - 3 - throw in finally should be caught", done => {
err => {
expect("" + err).toBe("OOPS")
expect(counter.counter).toBe(4)
mobx.configure({ enforceActions: "never" })
d()
done()
}
Expand Down
Loading