magic-akari / lrc-maker

歌词滚动姬|可能是你所能见到的最好用的歌词制作工具
https://lrc-maker.github.io
MIT License
865 stars 97 forks source link

Update mobx requirement to ^5.0.0 #6

Closed dependabot-preview[bot] closed 6 years ago

dependabot-preview[bot] commented 6 years ago

Updates the requirements on mobx to permit the latest version.

Changelog *Sourced from [mobx's changelog](https://github.com/mobxjs/mobx/blob/master/CHANGELOG.md).* > # 5.0.0 > > [Release blogpost](https://medium.com/p/4852bce05572/) > > ### Proxy support! > > MobX 5 is the first MobX version fully leveraging Proxies. This has two big advantages > > 1. MobX can now detect the addition of properties on plain observable objects, so it is now possible to use plain observable objects as dynamic collections. > 2. Observable arrays are now recognized as arrays by all third party libraries, which will avoid the need to slice them. > > ### The system requirements to run MobX has been upped > > * MobX 5 can only be used on environments that support `Proxies`. In practice this means, no Internet Explorer (Edge is fine). No nodejs < 6. React Native on Android only when JavaScript core is upgraded. All modern browsers are supported. > * Since MobX no longer runs on older browser, the compilation target has been upgraded to ES2015 syntax supporting browsers. This means that MobX is not loadable on older browsers without down compilation to ES5. > * If for whatever reason your project cannot meet this requirements, please stick to MobX 4. It will be actively maintained. All current features of MobX 5 are expressable in MobX 4 as well, but it means that for example to use dynamic objects some [additional APIs](https://mobx.js.org/refguide/object-api.html) are needed. > * The performance footprint of MobX 5 should be pretty similar to MobX 4. In our performance tests we saw some minor improvements in memory footprint, but overall it should be pretty comparable. > > ### Breaking changes > > * The required runtime needs to support the non-polyfillable `Proxy` API. > * The minimum runtime target is now ES2015, not ES5 > * `spy` has become a no-op in production builds > * All earlier deprecated APIs are dropped. Make sure to not have any deprecation warnings before upgrading. > * `array.move` and `array.peek` are removed from the API > * Dropped the third argument to `array.find` and `array.findIndex` since they were not standardized in ES. > * `.$mobx` property has been dropped from all observables and replaced by a Symbol. Instead of using `x.$mobx.name`, use `import { $mobx } from "mobx"; x[$mobx].name` etc. > * In some cases, the order in which autoruns are fired could have changed due to some internal optimizations (note that MobX never had a guarantee about the order in which autoruns fired!) > > ### New features > > * It is possible to pass the `proxy: false` argument to `observable.object` to disable proxying (theoretically slightly faster, but removes no dynamic key addition) > > ### Known Issues > > * Observable objects can no longer be frozen (otherwise they would become un-observable😎). If you are actually trying to do so MobX will now throw an exception like: `[mobx] Dynamic observable objects cannot be frozen]`. A place where that might happen unexpectedly is when passing an observable object as `style` property to a React component. Like ``, since React will freeze all style objects. The work-around is to simply pass a fresh, non-observable object for styling like: ``. > * If you are using `mobx` with `mobx-react`, and you are upgrading `mobx-react` to the MobX 5 compatible version (`mobx-react@5.2.0`) you will notice that `this.props` or `this.state` are not yet observable in the `constructor` or `componentWillMount`. This is for forward compatibility with React 16.3 where `componentWillMount` has been deprecated. In most cases using `componentDidMount` instead will suffice, especially when the goal is to setup reactions. For more info see [#478](https://github-redirect.dependabot.com/mobxjs/mobx-react/issues/478), [#477](https://github-redirect.dependabot.com/mobxjs/mobx-react/issues/477) and [#425](https://github-redirect.dependabot.com/mobxjs/mobx-react/issues/425). > * Jest `toEqual` might throw an error `allKeys[x].match is not a function` when trying to equal observable arrays. This is a bug in Jest [report](https://github-redirect.dependabot.com/facebook/jest/issues/6398). The simple work around for now is to slice (or `toJS` if the problem is recursive) the array first. > * Jest `toEqual` matcher might no longer corretly equal your class instances, complaining about differences in the MobX adminstration. This is due to a bug with the processing of symbols: [report](https://github-redirect.dependabot.com/facebook/jest/issues/6392). For now you might want to use a custom matcher if you are directly equalling observable objects. As a work around `toJS(object)` could be used before diffing. > > _Note June 7th, 2018:_ Both issues are already in Jest master and should be released soon. > > ### Migration guide > > * Make sure to not use any API that produces deprecation warnings in MobX 4. Beyond that MobX 5 should pretty well as drop-in replacement of MobX 4. > * You _could_ perform the following clean ups: > * Don't `slice()` arrays when passing them to external libraries. (Note you still shouldn't pass observable data structures to non-`observer` React components, which is an orthogonal concept) > * You could replace observable maps with observable objects if you are only using string-based keys. > * Don't call the `reverse` or `sort` operations directly on observableArray's anymore, as it's behavior slightly differed from the built-in implementations of those methods. Instead use `observableArray.slice().sort()` to perform the sort on a copy. This gives no additional performance overhead compared to MobX 4. (The reason behind this is that built-in `sort` updates the array in place, but the observable array implementation always performed the sort on a defensive copy, and this change makes that explicit). > > ... (truncated)
Commits - See full diff in [compare view](https://github.com/mobxjs/mobx/commits/5.0.0)


Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use (this|these) label[s]` will set the current labels as the default for future PRs for this repo and language - `@dependabot use (this|these) reviewer[s]` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use (this|these) assignee[s]` will set the current assignees as the default for future PRs for this repo and language Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Automerge options (never/patch/minor, and dev/runtime dependencies) - Pull request limits (per update run and/or open at any time) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired) Finally, you can contact us by mentioning @dependabot.
dependabot-preview[bot] commented 6 years ago

Superseded by #7.