Commit graph

29 commits

Author SHA1 Message Date
Tiến Nguyễn Khắc
89e444ef85
fix(javascript): use top-level node_modules in monorepos 2023-07-24 17:52:24 +02:00
Henrik Lissner
d25ff46d46
perf(javascript): replace add-node-modules-path
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
2022-10-23 02:30:13 +02:00
Henrik Lissner
002969ee06
Guard skewer-*-mode checks in bound-and-true-p #3252
Make extra sure skewer-*-mode vars are defined before trying to read
them.
2020-05-31 22:34:42 -04:00
Henrik Lissner
2407db0508
Fix #3252: void-variable skewer-css-mode 2020-05-31 22:25:55 -04:00
Henrik Lissner
17dd1c6527
Add add-node-modules-path package to lang/javascript
And use it on json-mode.
2020-04-23 23:28:50 -04:00
Henrik Lissner
a3e262c7ac
💥 Refactor add-hook! macro & change arg order
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"))
2019-07-26 20:17:29 +02:00
Henrik Lissner
9a02bd8ac8
Minor refactors across the board
- when-let* -> when-let
- Fix projectile-locate-dominating-file for connected remote files
2019-06-26 14:31:06 +02:00
Henrik Lissner
3160b6342f
lang/javascript: fix +javascript/open/rpl
When opened through +eval/open-repl-other-window
2019-06-10 09:38:56 +02:00
Henrik Lissner
94b16cba6c
Standardize REPL commands & improve SPC o r
- SPC o r now prompts for a REPL to open when none was found for the
  current buffer.
- REPL handlers must now follow the naming convention "*/open*-repl".
  e.g. +python/open-ipython-repl, +emacs-lisp/open-repl, etc.
- +eval/open-repl has been split in two:
  - +eval/open-repl-other-window
  - +eval/open-repl-same-window
2019-02-18 01:59:56 -05:00
Henrik Lissner
63a5c4239a
lang/javascript: update tide project resolution
To match projectile changes upstream. Fixes an error when opening an
arbitrary JS file in a non-project root.
2018-10-15 00:50:39 -04:00
Henrik Lissner
7d3ffdff06
Remove third line in section headers
This is truly important stuff. We've saved many lives with this update.
2018-09-09 09:58:19 -04:00
Henrik Lissner
391ac1cae5
Leverage cache in tide-project-root advise 2018-08-13 21:47:56 +02:00
Henrik Lissner
12c5490a39
Add node_modules/.bin to exec-path regardless #798
Before, this was conditional to the directory's existence. Add it
anyway, in case the folder is created while the buffer is open.

This may cause a problem is the project root changes while the buffer is
open, but for that case there's M-x doom/reload-project.
2018-08-11 01:59:38 +02:00
Henrik Lissner
ffabd2687b
lang/javascript: refactor & document +javascript/cleanup-tide-processes 2018-05-09 12:49:09 +02:00
Henrik Lissner
595d6215d2
lang/javascript: general refactor
+ No need for some rjsx-mode hooks, when it is derived from js2-mode
  (thus, js2-mode hooks will run in rjsx-mode).
+ Reorganized package configs with major modes at the top.
+ Fix incorrect usage of add-hook! with three arguments for rjsx-mode.
2018-04-20 02:47:02 -04:00
Henrik Lissner
9e45ad670c
lang/javascript: add autoloaded cleanup & project-root functions
Forgot to add this to 605c897d
2018-04-19 01:14:01 -04:00
Henrik Lissner
cc5bfc6dc0
lang/javascript: conform to naming conventions; refactor tide config 2018-04-18 18:04:49 -04:00
taylor
8af94e8731 [*] Removes tern in favor of tide, adds node modules to path to execute things like flow, prettier, etc 2018-04-18 17:26:50 +00:00
Henrik Lissner
31a4244686
Rethink what Doom loads at startup and manually
Better to simply load what we need, when we need it, rather than set up
autoloads for every litte thing.
2018-01-07 00:15:57 -05:00
Henrik Lissner
76a4ae459d
Fix obsolete (when|if)-let messages in Emacs 26 2017-12-10 14:49:52 -05:00
Henrik Lissner
c7254e7bdc
Major optimization refactor, across the board
+ enable lexical-scope everywhere (lexical-binding = t): ~5-10% faster
  startup; ~5-20% general boost
+ reduce consing, function calls & garbage collection by preferring
  cl-loop & dolist over lambda closures (for mapc[ar], add-hook, and
  various cl-lib filter/map/reduce functions) -- where possible
+ prefer functions with dedicated opcodes, like assq (see byte-defop's
  in bytecomp.el for more)
+ prefer pcase & cond (faster) over cl-case
+ general refactor for code readability
+ ensure naming & style conventions are adhered to
+ appease byte-compiler by marking unused variables with underscore
+ defer minor mode activation to after-init, emacs-startup or
  window-setup hooks; a customization opportunity for users + ensures
  custom functionality won't interfere with startup.
2017-06-09 00:47:45 +02:00
Henrik Lissner
1062a15d8c lang/javascript: fix +javascript-npm-dep-p to accept symbols 2017-04-02 23:02:50 -04:00
Henrik Lissner
53b9e92fd7 lang/{web,javascript}: remove +web-bower-mode; refactor react, phaser & angular detection 2017-04-01 23:54:30 -04:00
Henrik Lissner
378469b15e lang/javascript: add skewer-mode 2017-03-24 15:01:03 -04:00
Henrik Lissner
3722f17808 lang/javascript: remove +javascript/install (replaced by bootstrap) 2017-03-20 03:47:59 -04:00
Henrik Lissner
3ac1d382be Fix project mode definitions 2017-03-02 18:28:46 -05:00
Henrik Lissner
e14e25ecb4 Update modules/lang/* 2017-02-20 00:26:08 -05:00
Henrik Lissner
5dc174f41c javascript: conform to v2 module format 2017-02-20 00:23:07 -05:00
Henrik Lissner
566fd39cf9 lang/javascript: update for v2.0 2017-02-20 00:23:03 -05:00