Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting a new set methods #3853

Merged
merged 25 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
6572115
3850 - if you're using the corepack (https://nodejs.org/api/corepack.…
inoyakaigor Apr 2, 2024
eabcdde
3850 - first implementation of new Set methods
inoyakaigor Apr 2, 2024
9763039
3850 - call a method on the argument
inoyakaigor Apr 15, 2024
7131add
3850 - Add code to few another Set methods; align typings to TS PR#57230
inoyakaigor Apr 18, 2024
6b93c8a
3850 - review fixes: move reportObserved() into conditions branch; ch…
inoyakaigor Apr 18, 2024
4e438bb
3850 - add rest of the Set methods
inoyakaigor Apr 26, 2024
f5d6863
3850 - align functions parameter type declarations with its expected …
inoyakaigor May 2, 2024
46df92b
3850 - update TS to version with new Set methods; remove copied types…
inoyakaigor May 17, 2024
4a258c7
3850 - fix type for the «difference» function
inoyakaigor May 17, 2024
cf22937
3850 - add ESNext to tsconfig lib to fix tests
inoyakaigor May 17, 2024
a109642
3850 - update TS to Beta
inoyakaigor Jun 6, 2024
4767248
3850 - fix build failing (finally!)
inoyakaigor Jun 6, 2024
538ac5a
3850 - add tests for Set methods
inoyakaigor Jun 11, 2024
30fa622
3850 - change test for Set methods; change source code for methods wh…
inoyakaigor Jun 16, 2024
615b9e7
3850 - bump Nodejs version to 22 because it is support new Set method…
inoyakaigor Jun 16, 2024
68887de
Merge branch 'master' into 3850-new-set-methods
inoyakaigor Jun 16, 2024
7b7317b
3850 – tests for set-like objects
inoyakaigor Jun 19, 2024
74a307a
3850 – tests for check reactivity
inoyakaigor Jun 19, 2024
8ca04e6
3850 – update deps to TS 5.5; remove a packageManager field from pack…
inoyakaigor Jun 25, 2024
5f06ab2
3850 – cancel installation.md changes
inoyakaigor Jun 25, 2024
00d4cc9
3850 – esnext already contains es6
inoyakaigor Jun 30, 2024
81c2329
3850 – change types for new methods and checks for otherSet is has Se…
inoyakaigor Jul 1, 2024
113558b
3850 – review fixes: clarify the types
inoyakaigor Jul 1, 2024
4acd882
3850 – review fixes: removed unnecessary code
inoyakaigor Jul 2, 2024
d68dd2a
Merge branch 'main' into 3850-new-set-methods
urugator Jul 2, 2024
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
Prev Previous commit
Next Next commit
Merge branch 'master' into 3850-new-set-methods
# Conflicts:
#	.github/workflows/coveralls.yml
  • Loading branch information
inoyakaigor committed Jun 16, 2024
commit 68887de212616dce639e848747f935bc02d49aff
2 changes: 1 addition & 1 deletion .github/workflows/coveralls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ jobs:
run: yarn coverage

- name: Upload to coveralls
uses: coverallsapp/github-action@v2.2.3
uses: coverallsapp/github-action@v2.3.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
31 changes: 19 additions & 12 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,29 @@ When using MobX with TypeScript or Babel, and you plan to use classes; make sure
- **Babel**: Make sure to use at least version 7.12, with the following configuration:
```json
{
// Babel < 7.13.0
"plugins": [["@babel/plugin-proposal-class-properties", { "loose": false }]],

// Babel >= 7.13.0 (https://babeljs.io/docs/en/assumptions)
"plugins": [["@babel/plugin-proposal-class-properties"]],
"assumptions": {
"setPublicClassFields": false
// Babel < 7.13.0
"plugins": [["@babel/plugin-proposal-class-properties", { "loose": false }]],

// Babel >= 7.13.0 (https://babeljs.io/docs/en/assumptions)
"plugins": [["@babel/plugin-proposal-class-properties"]],
"assumptions": {
"setPublicClassFields": false
}
}
}
```
For verification insert this piece of code at the beginning of your sources (eg. `index.js`)
```

For verification insert this piece of code at the beginning of your sources (eg. `index.js`)

```javascript
if (!new class { x }().hasOwnProperty('x')) throw new Error('Transpiler is not configured correctly');
if (
!new (class {
x
})().hasOwnProperty("x")
)
throw new Error("Transpiler is not configured correctly")
inoyakaigor marked this conversation as resolved.
Show resolved Hide resolved
```

Note that for Next.js you must [customize Babel](https://nextjs.org/docs/advanced-features/customizing-babel-config) instead of TypeScript, even if your project is set up to use TypeScript.
Note that for Next.js you must [customize Babel](https://nextjs.org/docs/advanced-features/customizing-babel-config) instead of TypeScript, even if your project is set up to use TypeScript.

## MobX on older JavaScript environments

Expand Down
10 changes: 5 additions & 5 deletions packages/mobx/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1396,7 +1396,7 @@ A deprecation message will now be printed if creating computed properties while

```javascript
const x = observable({
computedProp: function() {
computedProp: function () {
return someComputation
}
})
Expand All @@ -1421,7 +1421,7 @@ or alternatively:

```javascript
observable({
computedProp: computed(function() {
computedProp: computed(function () {
return someComputation
})
})
Expand All @@ -1439,7 +1439,7 @@ N.B. If you want to introduce actions on an observable that modify its state, us
```javascript
observable({
counter: 0,
increment: action(function() {
increment: action(function () {
this.counter++
})
})
Expand Down Expand Up @@ -1565,10 +1565,10 @@ function Square() {
extendObservable(this, {
length: 2,
squared: computed(
function() {
function () {
return this.squared * this.squared
},
function(surfaceSize) {
function (surfaceSize) {
this.length = Math.sqrt(surfaceSize)
}
)
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.