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.
Firefox does not include shorthand properties, such as "border", in the
computed CSS properties object. This is documented at MDN:
https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle
> The returned CSSStyleDeclaration object contains active values for CSS
> property longhand names. For example, border-bottom-width instead of
> the border-width and border shorthand property names. It is safest to
> query values with only longhand names like font-size. Shorthand names
> like font will not work with most browsers.
This difference between Firefox and Chrome is also discussed in the
stackoverflow thread at:
https://stackoverflow.com/a/32296604
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.
Using unittest.TestCase doesn't work properly when we perform db
queries. Moreover introspection is extremely slow on Oracle without
limiting models to a "backends" app.
Follow up to 8bcca47e83.
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.
Avoid partial string construction and make use of ``ngettext`` to show
example of how to handle plural variants with translations. Also make
use of ``messages.SUCCESS`` to highlight customizing the style of the
message - in this case it better fits what the message is conveying.