typescript.el
typescript.el copied to clipboard
Adding mechanisms in place not to collide with in-tree typescript-mode
Hi!
This is just an issue to make sure that we put in place some mechanisms to not collide when typescript-mode
lands in core.
Maybe deprecation or some other guards is how best to do it?
@josteink You had some ideas here :)
I have some ideas which should be testable, sure.
I'm thinking about both compile-time and runtime-guards, depending on what is needed where.
A deprecation warning is probably not a bad idea either.
Great. You mean something like eval-and-compile and friends
shenanigans? I'll try to think about something, and also @monnier likely knows a great deal that could help us.
Seeing as ts-mode
now is in the feature/tree-sitter
branch, maybe we should just add an obsoletion warning for this mode sooner rather than later? I'm not completely sure where to put this warning, to be intrusive enough, but not chatting every time you open a typescript file. Maybe just create its own form similar to
(eval-and-compile
;; obsoletion message here
)
What do you think?
I can create such a pr if you want :)
Seeing as
ts-mode
now is in thefeature/tree-sitter
branch, maybe we should just add an obsoletion warning for this mode sooner rather than later? I'm not completely sure where to put this warning, to be intrusive enough, but not chatting every time you open a typescript file. Maybe just create its own form similar to
I'm obviously very much in favor. But I'll point out that the main
worry is to see people starting to work on this (instead of the new
ts-mode
) rather than to scare away users (who currently don't have
much elsewhere to go to).
So I'd start by a big and loud banner comment in the code (together with a similar message in the README.md), rather than emitting a warning.
That makes sense - I'll do that!
I think both are in place really.
Most typescript-mode users wont visit this repo unless they have a specific issue to file. As such we should place a warning both in this repo and to active users of typescript-mode, at least if they are on a version of emacs supporting ts-mode instead.
I suspect having such warning at compile-time only won't work, because it is more or less guaranteed to drown in all the other warnings users typically get when batch-updating 10+ packages from MELPA.
That means we'll have to push it runtime instead. And since we are (no longer) shadowing modes, I think the simplest way to do that would be a a basic:
(when (fboundp 'ts-mode)
(warn "This major-mode is now obsolete and unmaintained. Consider using the new ts-mode provided in Emacs core instead."))
Or at least, something like that, inside the main ts-mode activation-body.
This issue is old and has seen no activity in a year+.
Closing this issue. Typescript support is now included in Emacs core, so if you still have problems, open a new issue on the GNU Emacs bug-tracker 😄