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

fix: support Object as model value type #263

Merged
merged 5 commits into from
Sep 9, 2024

Conversation

StanleySathler
Copy link
Contributor

@StanleySathler StanleySathler commented Feb 2, 2023

Copy link
Member

@kettanaito kettanaito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, @StanleySathler! Thank you so much for proposing this. I really appreciate your feedback and ideas on the library, it's simply fantastic.

I left a few comments around this change, mainly about reusing existing utilities. Please let me know what you think about that.

@kettanaito kettanaito changed the title Allow passing Object constructor to a field definition - useful for JSON columns fix: support "Object" as model value type Feb 3, 2023
@MarcLopezAvila
Copy link

MarcLopezAvila commented Sep 10, 2023

Hi! I think this feature has been asked for a while and some people are looking forward to it, if this pr makes it work it doesn't seem like a very big change. @kettanaito is it possible to inlcude this in a further release (before the all rewrite I think it is being done)? We, as well as other people, are blocked by this feature and would be so great to have it supported. Thanks!

@StanleySathler
Copy link
Contributor Author

Hey @MarcLopezAvila 👋

I believe all changes Artem suggested should be pretty straightforward, which I'll take some time today to address. Then @kettanaito can decide the best way to release this. 🚀

@MarcLopezAvila
Copy link

Sounds great, thank you so much!

@StanleySathler
Copy link
Contributor Author

@kettanaito your feedback should be addressed now 🚀 Can you recheck?

@@ -1,10 +1,13 @@
import isObjectLike from 'lodash/isObjectLike'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch - turns out we had a test set as .only too, which is also fixed now 🚀

@MarcLopezAvila
Copy link

Hi @kettanaito, could you check if we can merge this change pls? Thank you very much!

@Eadroma
Copy link

Eadroma commented Jul 16, 2024

can we have an update about this please ?

@kalilovsky
Copy link

Hello, we are using msw-data, but we really need this feature, can you please update us ?

@kettanaito
Copy link
Member

Slow as they are, the tests seem passing.

Test Suites: 2 skipped, 49 passed, 49 of 51 total
Tests:       6 skipped, 343 passed, 349 total
Snapshots:   1 passed, 1 total
Time:        75.745 s

Copy link
Member

@kettanaito kettanaito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on this, @StanleySathler 👏

@kettanaito kettanaito changed the title fix: support "Object" as model value type fix: support Object as model value type Sep 9, 2024
@kettanaito kettanaito merged commit 22fc298 into mswjs:main Sep 9, 2024
1 check passed
@kettanaito
Copy link
Member

Released: v0.16.2 🎉

This has been released in v0.16.2!

Make sure to always update to the latest version (npm i @mswjs/data@latest) to get the newest features and bug fixes.


Predictable release automation by @ossjs/release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can we store a literal object to an entity's field?
5 participants