realm-js icon indicating copy to clipboard operation
realm-js copied to clipboard

Using `declare` in class-based models in the integration tests

Open kraenhansen opened this issue 2 years ago • 1 comments
trafficstars

What, How & Why?

The update for the integration tests targeting es2022 the default for useDefineForClassFields changed to true, which breaks creating objects via the constructor of a class-based model.

kraenhansen avatar Mar 02 '23 15:03 kraenhansen

Is this a breaking change for users though?

I wouldn't say so. This is a breaking change introduced when targeting es2022. We should probably find a solution to work around it (which is why I created https://github.com/realm/realm-js/issues/5527). But for now, I wanted to just update the integration tests to use it.

We might want to update our documentation to use declare if that's important.

Yes - I think that would be a good change to make. But that will require users to apply our Babel preset (introduced in this PR). We should definitely document that .. if / when we choose to publish it on NPM.

kraenhansen avatar Mar 03 '23 10:03 kraenhansen

Closing as it's unlikely this will ever merge.

kraenhansen avatar Oct 03 '24 18:10 kraenhansen