Flatten the Djblets.Config.* namespace.

Review Request #13849 — Created May 10, 2024 and submitted — Latest diff uploaded

Information

Djblets
release-5.x

Reviewers

TypeScript gets unhappy if you're mixing what it considers to be a
"namespace" with ES modules, and can end up discarding a lot of type
checking as a result. Their recommendation is that everything these days
should be modules.

Before we switched to modules, we were starting to try to namespace our
code more thoroughly, and therefore everything inside the Djblets
configForms bundle was namespaced into Djblets.Config.*.

This change makes it so we export two names for each top-level item,
Djblets.Config.* and Djblets.Config*. This allows us to import the
ConfigForms* names from djblets/configForms without getting any warnings.

  • Ran js-tests.
  • Verified that the compiled configForms index.js file only had one copy
    of the definitions for the classes but was exporting them under both
    names.

Diff Revision 2 (Latest)

orig
1
2

Commits

First Last Summary ID Author
Flatten the Djblets.Config.* namespace.
TypeScript gets unhappy if you're mixing what it considers to be a "namespace" with ES modules, and can end up discarding a lot of type checking as a result. Their recommendation is that everything these days should be modules. Before we switched to modules, we were starting to try to namespace our code more thoroughly, and therefore everything inside the Djblets configForms bundle was namespaced into `Djblets.Config.*`. This change makes it so we export two names for each top-level item, `Djblets.Config.*` and `Djblets.Config*`. This allows us to import the `Config*` names from `djblets/configForms` without getting any warnings. Testing Done: - Ran js-tests. - Verified that the compiled configForms index.js file only had one copy of the definitions for the classes but was exporting them under both names.
3c7425c5ef7d2924195d410d7ffe8cad82bccbf5 David Trowbridge
djblets/static/djblets/js/configForms/index.ts
djblets/static/djblets/js/configForms/collections/listItemsCollection.ts
djblets/static/djblets/js/configForms/models/tests/listItemModelTests.ts
djblets/static/djblets/js/configForms/views/listView.ts
djblets/static/djblets/js/configForms/views/tests/listItemViewTests.ts
djblets/static/djblets/js/configForms/views/tests/listViewTests.ts
djblets/static/djblets/js/configForms/views/tests/tableItemViewTests.ts
djblets/static/djblets/js/configForms/views/tests/tableViewTests.ts
djblets/static/djblets/js/extensionsAdmin/views/extensionManagerView.ts
Loading...