The add-node-modules-path package calls `npm bin` to locate the
node_modules/.bin, and does so while invoking the user's $SHELL, which
can be very expensive depending on the user's shell configuration,
possibly adding seconds to the startup time of any JS/TS file.
To mitigate this, I replace the package with a much faster, and in-house
heuristic. Folks with more complex needs should be using direnv anyway.
Fix: #6878
featurep! will be renamed modulep! in the future, so it's been
deprecated. They have identical interfaces, and can be replaced without
issue.
featurep! was never quite the right name for this macro. It implied that
it had some connection to featurep, which it doesn't (only that it was
similar in purpose; still, Doom modules are not features). To undo such
implications and be consistent with its namespace (and since we're
heading into a storm of breaking changes with the v3 release anyway),
now was the best opportunity to begin the transition.
Moved add-hook calls (for tree-sitter initialization) into their
respective modes' config blocks, or nearby, to be consistent with how
other, similar tools (like lsp!) are initialized, and does so at
runtime, rather than at expansion/compile time, which eval-when! caused.
BREAKING CHANGE: break the global nature of the tree sitter
module by adding a +tree-sitter flag to every applicable module
In the background this hooks turn-on-tree-sitter-mode
to the major-mode-hook of the language.
This may also solve the eager loading of tree sitter
Caused when you have :lang web disabled, but :lang javascript enabled.
This is a stopgap until I decide what to do with typescript-tsx-mode.
Fix: #6243
lsp-mode doesn't detect the correct indentation, since it treats the
derived tsx-mode as a web-mode. This change modifies the lsp-mode
internal alist to recognize tsx-mode correctly. Ideally lsp-mode would
have a better way to modify its known mode lists but I couldn't see it.
Ref: emacs-lsp/lsp-mode#3308
+ Use rjsx-mode for all javascript files. It degrades gracefully and is
less maintenance.
+ Rethink flycheck + JS integration. You should get eslint and tslint
support in web-mode, typescript-mode, and typescript-tsx-mode now (as
well as rjsx-mode, of course).
Tide doesn't work with rjsx-mode after changing to *-mode-local-vars-hook.
Fixed by adding +javascript-init-lsp-or-tide-maybe-h for
rjsx-mode-local-vars-hook as well.
Signed-off-by: Huy Duong <huy.duong@employmenthero.com>
This package isn't hooked up to anything and has no keybinds. Its config
is so trivial that users can install it themselves, so I decided it
won't be included with the module by default.
And fix an issue where +javascript-init-lsp-or-tide-maybe-h would
reference lsp-mode in the rare case where lsp-mode isn't defined (likely
because the user forgot to run `doom refresh` after enabling the :tools
lsp module).
This update may potentially break your usage of add-hook! if you pass
the :local or :append properties to it. This is how they used to work:
(add-hook! :append 'some-mode-hook #'do-something)
Thsoe properties must now follow the hooks, e.g.
(add-hook! 'some-mode-hook :append #'do-something)
Other changes:
- Various add-hook calls have been renamed to add-hook! because I
incorrectly assumed `defun` always returned its definition's symbol,
when in fact, its return value is "undefined" (so sayeth the
documentation). This should fix#1597.
- This update adds the ability to add multiple functions to hooks
without a list:
(add-hook! 'some-mode-hook
#'do-something
#'do-something-else)
- The indentation logic has been changed so that consecutive function
symbols at indented at the same level as the first argument, but forms
are indent like a defun.
(add-hook! 'some-mode-hook
#'do-something
#'do-something-else)
(add-hook! 'some-mode-hook
(message "Hello"))
Calling this pivotal macro "def-package!" has frequently been a source
of confusion. It is a thin wrapper around use-package, and it should be
obvious that it is so. For this reason, and to match the naming
convention used with other convenience macros/wrappers, it is now
use-package!.
Also changes def-package-hook! -> use-package-hook!
The old macros are now marked obsolete and will be removed when straight
integration is merged.