WebReflection / hyperHTML

A Fast & Light Virtual DOM Alternative
ISC License
3.07k stars 113 forks source link

defaultState is now declared as a getter in the declaration file #409

Closed yuretz closed 2 years ago

yuretz commented 2 years ago

This is a tiny change to the .d.ts file that solves the issue described here with defaultState not being declared exactly the same way it was implemented and upsetting the type checker when e.g. overridden in a class derived from the Component.

get/set declarations in d.ts files should be supported since 3.6 release of TypeScript, which was 3 years ago. So, while in theory someone using hyperHTML with an older TS version is most likely to get unexpected type checking errors because of this change, but in practice there wouldn't be many people like this, I assume. I don't quite know what's your policy regarding breaking changes in the type declarations file, but now you know about it's potential effect.

Maybe TS compatibility warrants a note in the Readme somewhere, what do you think?

coveralls commented 2 years ago

Pull Request Test Coverage Report for Build 2832464441


Totals Coverage Status
Change from base Build 1315038057: 0.0%
Covered Lines: 314
Relevant Lines: 347

💛 - Coveralls
yuretz commented 2 years ago

Thanks for merging it Andrea, very much appreciated! 🙏 Do you think you would be able to publish a new version to npm sometime soon?

WebReflection commented 2 years ago

@yuretz apologies I'm on vacation it took your reminder to remind me to do that ... which I did now 👋