Closed NULLx76 closed 4 years ago
I've had a very quick look at this, but getting the TypeScript definitions to play nicely with Webpack appears to be non-trivial. I've tried the following with no success:
declaration-bundler-webpack-plugin
, which doesn't build properly. I tried with this fix, which generates a declaration, but it doesn't appear to be validdts-bundle-webpack
which is a neater version of the above StackOverflow solutionI think this isn't working because we use default
exports, which don't work very well when being combined into a single d.ts
file. We could potentially move away from that, but it would be a breaking change, so I'd be inclined to leave it for if we want to make more big changes.
I probably don't have a lot of time to look into this, as it's a nice-to-have. Please feel free to raise a PR if you think you can crack it, though.
A trivial but ugly solution (until it is possible to move away from default exports) would be making a definition file by hand. As there are not that many methods this should be very easy and quick. Thoughts on that?
Making one by hand is a bit icky in my opinion. I think I'd rather remove our default
exports. I guess it's arguable that it's not a breaking change, because consumers shouldn't really have been trying to use anything other than the single point of entry into the module, and so long a that stays consistent, then it's fine. Or we just bump to v3 anyway. I guess it doesn't matter too much.
Or we just bump to v3 anyway. I guess it doesn't matter too much.
Yeap. If it can be breaking better to bump, IMO.
Should now hopefully be fixed by https://github.com/reedsy/quill-cursors/pull/54
Release coming soon.
@alecgibson, can't wait for release!
It would be great if the types were also generated upon build and added to the dist so that when using the plugin with TS people can make use of the typings