question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issues Upgrading to v8.0.0

See original GitHub issue

I’m attempting to update mobx-rest from v7.1.1 to v8.0.0 in a typescript project. Unfortunately, the upgrade has introduced some breaking changes. Namely, the Model / Collection inheritance structure breaks down. Within the project, we extend the Model / Collection classes with our own base classes, adding some custom logic / overrides. Say we have a Posts table in our db that we are interacting with. Our FE class hierarchy would look something like this:

import { Model, Collection } from 'mobx-rest'

class ModelBase extends Model {}
class CollectionBase extends Collection {}

class PostModel extends ModelBase {}
class PostCollection extends CollectionBase {}

This works as expected with v7.1.1. However, with v8.0.0 I’m seeing a bunch of TS2339: Property does not exist on type typescript errors. For example, TS2339: Property 'withRequest' does not exist on type 'PostModel'. Digging into node_modules/mobx-rest for v8.0.0, it looks like the type declaration files are no longer included in the npm package (I’ve confirmed that they are still present for v7.1.1). What is the reason for this change?

Also, when I was digging through the source code trying to find an explanation for the breakage, I noticed that package.json still has the version at 7.1.1 with no mention of a v8.0.0 release anywhere. I’m assuming that PR merge #96 (supporting mobx@6) bumped mobx-rest to v8.0.0, but it’s a little concerning that this is not transparent within the repo. It would be helpful to include v8.0.0 in the change log and keep package.json consistent with the latest release.

Thanks!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
maxschridde1494commented, Jun 10, 2021

@masylum Unfortunately, I don’t have much helpful input. I have the upgrade living on a branch that I haven’t looked at since my last comment on this thread, so I can’t say that I’ve really dug into it. As far as I remember, we experienced some friction related to a different implementation of the Model / Collection toJS methods. But everything else went pretty smoothly. Our inheritance structure is quite simple. We have custom ModelBase < Model, CollectionBase < Collection base classes that implement some overrides but these all fall within the scope of the acceptable overrides discussed in the documentation you linked. Sorry to not be of more help amigo.

1reaction
maxschridde1494commented, May 17, 2021

Can verify that the fix PR solved the issue. Thanks again!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Migrating to v8.0.0 - ESLint - Pluggable JavaScript Linter
To address: Make sure you upgrade to at least Node.js 12.22.0 when using ESLint v8.0.0. One important thing to double check is the...
Read more >
Static export failed when upgraded to v8.0.0 #6251 - GitHub
8.0.0(npm) Bug report Describe the bug next app stopped to work on client side after upgrading next to v8.0.0 Coming back to v7.0.3...
Read more >
Issue since upgrade to v8.0.0.54216: css troubles (bootstrap ...
Hello Dear All, I have some troubles with application "Task" kindly published on Mendix app store (https://appstore.home.mendix.com/link/app/ ...
Read more >
Cb Protection v8.0.0 - Release Notes - Carbon Black Community
Upgraded one of our consoles to P7 (from 6) and no issues. Upgraded about 15% of our endpoints so far, and no issues...
Read more >
You are having issues upgrading a running instance of BPM ...
You have a BPM v8.0.1.0 instance of a BPM pattern running on PureApplication System. You are attempting to upgrade this existing pattern instance...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found