Files
notifications-admin/package.json
Tom Byers 77f7d1453c Replace domdiff library with morphdom
We added domdiff to replace the DiffDOM library
here:

87f54d1e88

DiffDOM had updated its code to be written to the
ECMAScript 6 (ES6) standard and so needed extra
work to work with the older browsers in our
support matrix. This was recorded as an issue
here:

https://www.pivotaltracker.com/n/projects/1443052/stories/165380360

Domdiff didn't work (see below for more details)
so this replaces it with the morphdom library.
Morphdom supports the same browsers as us and is
relied on by a range of large open source
projects:

https://github.com/patrick-steele-idem/morphdom#what-projects-are-using-morphdom

It was tricky to find alternatives to DiffDOM so
if we have to source alternatives in future, other
options could be:
- https://github.com/choojs/nanomorph
- https://diffhtml.org/index.html (using its
  outerHTML method)

Why domdiff didn't work

Turns out that domdiff was replacing the page HTML
with the HTML from the AJAX response every time,
not just when they differed. This isn't a bug.
Domdiff is bare bones enough that it compares old
DOM nodes to new DOM nodes with ===. With our
code, this always results to false because our new
nodes are made from HTML strings from AJAX
response so are never the same node as the old
one.
2022-01-27 11:37:53 +00:00

63 lines
1.7 KiB
JSON

{
"name": "notifications-admin",
"version": "0.0.1",
"description": "Admin front end for GOV.UK Notify",
"engines": {
"node": ">=10.15.3"
},
"scripts": {
"test": "gulp lint && jest --config tests/javascripts/jest.config.js tests/javascripts",
"test-watch": "jest --watch --config tests/javascripts/jest.config.js tests/javascripts",
"build": "gulp",
"watch": "gulp watch"
},
"repository": {
"type": "git",
"url": "git+https://github.com/alphagov/notifications-admin.git"
},
"author": "Government Digital Service",
"license": "MIT",
"homepage": "https://github.com/alphagov/notifications-admin#readme",
"dependencies": {
"@babel/core": "7.4.0",
"@babel/preset-env": "7.4.2",
"cbor-js": "0.1.0",
"del": "5.1.0",
"govuk_frontend_toolkit": "8.1.0",
"govuk-elements-sass": "3.1.2",
"govuk-frontend": "2.13.0",
"gulp": "4.0.2",
"gulp-add-src": "1.0.0",
"gulp-babel": "8.0.0",
"gulp-better-rollup": "4.0.1",
"gulp-clean-css": "4.3.0",
"gulp-concat": "2.6.1",
"gulp-include": "2.4.1",
"gulp-sass": "5.0.0",
"gulp-uglify": "3.0.2",
"hogan": "1.0.2",
"jquery": "3.5.0",
"leaflet": "1.6.0",
"morphdom": "2.6.1",
"query-command-supported": "1.0.0",
"rollup": "1.23.1",
"sass": "1.32.7",
"streamqueue": "1.1.2",
"textarea-caret": "3.1.0",
"timeago": "1.6.5"
},
"devDependencies": {
"gulp-css-url-adjuster": "0.2.3",
"gulp-jshint": "2.1.0",
"gulp-prettyerror": "2.0.0",
"gulp-sass-lint": "1.4.0",
"jest": "24.7.1",
"jest-date-mock": "^1.0.8",
"jest-each": "^25.3.0",
"jshint": "2.10.2",
"jshint-stylish": "2.2.1",
"rollup-plugin-commonjs": "10.1.0",
"rollup-plugin-node-resolve": "5.2.0"
}
}