Fix up import paths and groups in new TypeScript code.
Review Request #13171 — Created Aug. 1, 2023 and submitted
Information | |
---|---|
david | |
Review Board | |
release-6.x | |
Reviewers | |
reviewboard | |
As we've defined how our JS codebase is going to work going forward,
we've not been terribly disciplined about how we do imports. This change
makes everything consistent with three import groups (3rd party, other
modules, and the current module) that kind of matches the way that our
Python code works. Where we can, this has been simplified to import
everything from the top-level indexes, which makes sorting things
alphabetically by module name much easier.
Ran js-tests.
Summary | |
---|---|
Description | From | Last Updated |
---|---|---|
This module is within this bundle, so it should use a relative import in a separate import group. |
|
|
Should reviewboard/common be before reviewboard/common/...? |
|
|
common should be before ui. |
|
|
reviewRequestEditorModel sorts before reviewablePageModel (R < a). |
|
|
This is in the same bundle, so it should use relative imports. |
|
|
common before ui. |
|
|
Isn't this one supposed to be a relative import since its in the same bundle? |
![]() |
|
Should we import this one from reviewboard/common like we do with ReviewReply? |
![]() |
-
-
-
reviewboard/static/rb/js/reviews/models/unifiedBannerModel.ts (Diff revision 1) Should
reviewboard/common
be beforereviewboard/common/...
? -
reviewboard/static/rb/js/reviews/views/reviewablePageView.ts (Diff revision 1) common
should be beforeui
. -
reviewboard/static/rb/js/reviews/views/reviewablePageView.ts (Diff revision 1) reviewRequestEditorModel
sorts beforereviewablePageModel
(R
<a
). -
reviewboard/static/rb/js/reviews/views/tests/diffViewerPageViewTests.ts (Diff revision 1) This is in the same bundle, so it should use relative imports.
-
Commits: |
|
|||||||||
---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+196 -190) |
Checks run (2 succeeded)

-
Thanks for standardizing these! Looking forward to having a document in Notion for this too.
-
reviewboard/static/rb/js/common/models/tests/userSessionModelTests.ts (Diff revision 2) Isn't this one supposed to be a relative import since its in the same bundle?
-
reviewboard/static/rb/js/reviews/models/unifiedBannerModel.ts (Diff revision 2) Should we import this one from
reviewboard/common
like we do withReviewReply
?
Commits: |
|
|||||||||
---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 3 (+198 -188) |