You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/decisions/0007-patch-package.rst
+5-5
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ Accepted (November 2023)
9
9
Context
10
10
*******
11
11
12
-
The ``frontend-app-admin-portal`` repository is currently blocked on upgrading to the latest version of ``@edx/paragon`` until the React, React Router, ``@edx/frontend-platform``, etc. packages are upgraded first. Given this, we cannot rely on upstream fixes to ``@edx/paragon`` for bugs or security issues.
12
+
The ``frontend-app-admin-portal`` repository is currently blocked on upgrading to the latest version of ``@openedx/paragon`` until the React, React Router, ``@edx/frontend-platform``, etc. packages are upgraded first. Given this, we cannot rely on upstream fixes to ``@openedx/paragon`` for bugs or security issues.
13
13
14
14
There is at least one opportunity identified where there is a bug within Paragon's ``DataTable`` component, where the "Select all X" label's count is inaccurate when one or more rows are selected, with or without filters applied, using the ``DataTable.ControlledSelect*`` sub-components. A separate bug issue was filed upstream to the Paragon repository, but given ``frontend-app-admin-portal`` is blocked on a Paragon upgrade, we can turn to ``patch-package`` to temporarily fix the issue locally within this repository itself.
15
15
@@ -18,25 +18,25 @@ There is at least one opportunity identified where there is a bug within Paragon
18
18
19
19
``patch-package`` is an NPM package that allows one to modify third-party dependencies' code within ``node_modules``, and persist the patch so it's applied for other developers and within CI (i.e., anytime ``npm install`` is executed).
20
20
21
-
By creating a temporary, committed patch file for ``@edx/paragon``, we can resolve the aforementioned "Select all X" label's inaccurate count without needing an upstream fix or upgrading to the latest version of ``@edx/paragon``.
21
+
By creating a temporary, committed patch file for ``@openedx/paragon``, we can resolve the aforementioned "Select all X" label's inaccurate count without needing an upstream fix or upgrading to the latest version of ``@openedx/paragon``.
22
22
23
23
Decisions
24
24
*********
25
25
26
26
We will use ``patch-package`` to temporarily create a patch of Paragon's ``DataTable`` component to shows the correct number in the "Select all X" label count until we can upgrade to the latest version of Paragon containing a fix for this issue.
27
27
28
-
We will keep the ``patch-package`` devDependency installed and running in the ``postinstall`` NPM script. However, we should only reach for ``patch-package`` when necessary, and should not use it as a crutch for not upgrading to the latest version of a dependency or making a contribution to the upstream third-party dependency (e.g., ``@edx/paragon``).
28
+
We will keep the ``patch-package`` devDependency installed and running in the ``postinstall`` NPM script. However, we should only reach for ``patch-package`` when necessary, and should not use it as a crutch for not upgrading to the latest version of a dependency or making a contribution to the upstream third-party dependency (e.g., ``@openedx/paragon``).
29
29
30
30
Consequences
31
31
************
32
32
33
-
* The generated patch file is versioned to the currently installed version of the patched dependency. If the installed version of the patched dependency changes, the patch file's version may need to be updated as well by ensuring the local package changes still function as expected and then generating the patch file (i.e., ``npx patch-package @edx/paragon``).
33
+
* The generated patch file is versioned to the currently installed version of the patched dependency. If the installed version of the patched dependency changes, the patch file's version may need to be updated as well by ensuring the local package changes still function as expected and then generating the patch file (i.e., ``npx patch-package @openedx/paragon``).
34
34
* Because code changes made in a generated patch are applied after ``npm install``, the changes in the patch should apply to unit and integration tests within this repository (i.e., the patch changes should be testable).
35
35
36
36
37
37
Alternatives Considered
38
38
***********************
39
39
40
-
* Implement a fix upstream in ``@edx/paragon`` and then upgrade to the latest versions of React, React Router, ``@edx/frontend-platform``, etc. in order to unblock the upgrade to the latest Paragon version. This was rejected because it would take focus off of the critical path of feature release with an impending deadline.
40
+
* Implement a fix upstream in ``@openedx/paragon`` and then upgrade to the latest versions of React, React Router, ``@edx/frontend-platform``, etc. in order to unblock the upgrade to the latest Paragon version. This was rejected because it would take focus off of the critical path of feature release with an impending deadline.
41
41
* Replicate a large portion of the Paragon code (i.e., ``SelectionStatusComponent``) into ``frontend-app-admin-portal`` to temporarily remove the "Select all X" label from the ``DataTable``. This was rejected because the "Select all X" functionality is intended to be there to make it easier to work with bulk actions on the table. Without "Select all X" functionality, users would need to manually paginate and select through each individual page which is not a good user experience.
42
42
* Do nothing. This was rejected as the state of the world without a fix leaves a known bug fix that causes usability issues and user confusion.
0 commit comments