emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 062369e: * etc/NEWS: Document new and improved JSX


From: Jackson Ray Hamilton
Subject: [Emacs-diffs] master 062369e: * etc/NEWS: Document new and improved JSX support in js-mode
Date: Tue, 9 Apr 2019 03:54:01 -0400 (EDT)

branch: master
commit 062369e3aebdbcf25538e71686208a2126d83619
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>

    * etc/NEWS: Document new and improved JSX support in js-mode
---
 etc/NEWS | 45 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/etc/NEWS b/etc/NEWS
index c7456c6..42e7a4f 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1259,6 +1259,51 @@ near the current column in Tabulated Lists (see variables
 This defcustom allows for the customization of the modifier key used
 in a terminal frame.
 
+** JS mode
+
+*** JSX syntax is now automatically detected and enabled.
+If a file imports Facebook's 'React' library, or if the file uses the
+extension '.jsx', then various features supporting XML-like syntax
+will be supported in 'js-mode' and derivative modes.  ('js-jsx-mode'
+no longer needs to be enabled.)
+
+*** New defcustom 'js-jsx-detect-syntax' disables automatic detection.
+
+*** New defcustom 'js-jsx-syntax' enables JSX syntax unconditionally.
+
+*** New variable 'js-jsx-regexps' controls JSX detection.
+
+*** JSX syntax is now highlighted like SGML.
+
+*** JSX code is properly indented in many more scenarios.
+Previously, JSX indentation usually only worked when an element was
+wrapped in parenthesis (e.g. in a 'return' statement or a function
+call).  It would also fail in many intricate cases.  Now, indentation
+should work anywhere without parenthesis; many more intricacies are
+supported; and, indentation conventions align more closely with those
+of the React developer community, otherwise still adhering to SGML
+conventions.
+
+*** Indentation uses 'js-indent-level' instead of 'sgml-basic-offset'.
+It was never really intuitive that JSX indentation would be controlled
+by an SGML variable.  JSX is a syntax extension of JavaScript, so it
+should be indented just like any other expression in JavaScript.  This
+is technically a breaking change, but it will probably align with how
+you would normally expect for this indentation to be controlled, and
+you probably won't need to change your config.
+
+*** New defcustom 'js-jsx-attribute-offset' for JSX attribute indents.
+
+*** New variable 'js-syntactic-mode-name' controls mode name display.
+Previously, the mode name was simply 'JavaScript'.  Now, when a syntax
+extension like JSX is enabled, the mode name is 'JavaScript[JSX]'.
+Setting this variable to nil can disable the new formatting.
+
+*** New function 'js-use-syntactic-mode-name' for deriving modes.
+Packages deriving from 'js-mode' with 'define-derived-mode' should
+call this function to add enabled syntax extensions to their mode
+name, too.
+
 
 * New Modes and Packages in Emacs 27.1
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]