The eslint configuration and the admin script compress.py have been
updated for ES6.
The unused fallback of globals.django in jquery.init.js was removed. It
is always included before jsi18n-mocks.test.js and it always sets the
global value.
The script previously used the PyPI package closure, which is slightly
out of date and not maintained by Google.
The JavaScript contribution docs and the compress.py script now runs the
google-closure-compiler package in the recommended way. Google's
documentation on usage and installation can be found at:
https://github.com/google/closure-compiler-npm/tree/master/packages/google-closure-compiler#usage
This also makes the usage simpler as the package now runs through npm's
npx utility, which will automatically install google-closure-compiler to
a per-user cache.
The use of $(document).ready() was removed. The script is loaded at the
end of the document. Therefore, the referenced DOM elements are already
available and the script does not need to wait for the full DOM to be
ready before continuing.
Now that the script has no external dependencies, it can be loaded
asynchronously. As such, the async attribute was added to the script
element.
This allows the removal of its O(n) .get_field_by_name method and many
other awkward access patterns.
While fields were initially stored in a list to preserve the initial
model definiton field ordering the auto-detector doesn't take field
ordering into account and no operations exists to reorder fields of a
model.
This makes the preservation of the field ordering completely superflous
because field reorganization after the creation of the model state
wouldn't be taken into account.
Avoids inspecting the exception message, which is not considered a
stable API and can change across Python versions.
ModuleNotFoundError was introduced in Python 3.6. It is a subclass of
ImportError that is raised when the imported module does not exist. It
is not raised for other errors that can occur during an import. This
exception instance has the property "name" which holds the name of
module that failed to import.
The sql_flush() positional argument sequences is replaced by the boolean
keyword-only argument reset_sequences. This ensures that the old
function signature can't be used by mistake when upgrading Django. When
the new argument is True, the sequences of the truncated tables will
reset. Using a single boolean value, rather than a list, allows making a
binary yes/no choice as to whether to reset all sequences rather than a
working on a completely different set.