-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove dependency on jQuery #134
Comments
`MOJFrontend` requires this to initialise the Multi select component There's [an issue in moj-frontend](ministryofjustice/moj-frontend#134) to remove the jQuery dependency, but it's dependent on unit tests
`MOJFrontend` requires this to initialise the Multi select component There's [an issue in moj-frontend](ministryofjustice/moj-frontend#134) to remove the jQuery dependency, but it's dependent on unit tests
* Add `User()` endpoint to sirius package To get user details by ID * Add userPendingCases handler To show a user's pending cases, based on their ID * Link to user's pending cases from team dashboard * Add userPendingCases cypress tests And rename existing file * Add jQuery and expose on `window` `MOJFrontend` requires this to initialise the Multi select component There's [an issue in moj-frontend](ministryofjustice/moj-frontend#134) to remove the jQuery dependency, but it's dependent on unit tests * Restrict userPendingCases to Managers Other users shouldn't be able to see each others' dashboards * Add all caseworker info pages Adds all cases and tasks pages, with inter-linking and tests * Remove unused CSS classes * Expect API user details to include a team * Add back links to team * Re-enable codecov-action They claim to have fixed the issue now * Add `User()` endpoint to sirius package To get user details by ID * Add userPendingCases handler To show a user's pending cases, based on their ID * Link to user's pending cases from team dashboard * Add userPendingCases cypress tests And rename existing file * Add jQuery and expose on `window` `MOJFrontend` requires this to initialise the Multi select component There's [an issue in moj-frontend](ministryofjustice/moj-frontend#134) to remove the jQuery dependency, but it's dependent on unit tests * Restrict userPendingCases to Managers Other users shouldn't be able to see each others' dashboards * Bump cypress from 7.4.0 to 7.5.0 (#35) Bumps [cypress](https://github.com/cypress-io/cypress) from 7.4.0 to 7.5.0. - [Release notes](https://github.com/cypress-io/cypress/releases) - [Changelog](https://github.com/cypress-io/cypress/blob/develop/.releaserc.base.js) - [Commits](cypress-io/cypress@v7.4.0...v7.5.0) --- updated-dependencies: - dependency-name: cypress dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * VEGA-867 Sort pending cases by workedDate (#44) * Use CanRequestCase on all caseworker pages (#43) Wherever the "Request next cases" button appears, only show it to users with the "Self Allocation User" role * Show "Worked, Pending" status (#45) * Add status-tag template * Use status-tag template * Set "Worked, Pending" text explicitly * Use status-tag template So that we see "Worked, Pending" everywhere Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Joshua Hawxwell <[email protected]>
If this is going to take some time (it doesn't sound trivial) then in the meantime it would be nice to make the dependency on jQuery explicit. (I can't see it mentioned in the docs or the package.json) |
Good point @DanCorder, we should add it to the installing with NPM documentation. Edit: this has now been added in #187 |
As noted in #134, moj-frontend requires JavaScript but never mentions this in documentation. This change updates documentation to clarify that jQuery must be installed and included.
As noted in #134, moj-frontend requires JavaScript but never mentions this in documentation. This change updates documentation to clarify that jQuery must be installed and included. Also moves the "Installing via NPM" and "Supporting IE8" into the main application
As noted in #134, moj-frontend requires JavaScript but never mentions this in documentation. This change updates documentation to clarify that jQuery must be installed and included. Also moves the "Installing via NPM" and "Supporting IE8" into the main application
GDS are considering removing jQuery from the prototype kit, which would mean that (until we remove jQuery ourselves) we'd need to bundle jQuery in the package and add it to the extension config file. |
Does this need adding to the |
jQuery is listed as a peer dependency in |
As far as I can tell it didn't do that.
|
Summary
It would be nice to eliminate our dependency on jQuery, instead using native browser functionality (e.g.
setAttribute
instead ofattr
,querySelector
rather thanfind
).Motivation
There are a few reasons I think this is beneficial:
Describe alternatives you've considered
We can just keep using jQuery and accept the concerns above for now.
Additional context
We'll need to add polyfills for functionality that isn't available in all browsers > IE8. (e.g. Opera Mini and IE9/10 don't support
HTMLElement.dataset
) We may be able to detect and polyfill automatically as part of the build process.We may also need to bulk out the IE8 polyfill if that's not already done by the GOV.UK Design system polyfill.
We shouldn't attempt this without unit tests (#132) as it would be difficult to spot regressions.
The text was updated successfully, but these errors were encountered: