I've now also figured out why loading of chunks failed when running
using converse.js (but not when using converse.min.js or when running `make watch`).
When running `make dist`, first `converse.js` and `converse.min.js` were
built with `mode` set to `development` (via `webpack.dev.js`) and then
`converse.min.js` was again built with mode set to `production` (via
`webpack.prod.js`).
When running only one build or the other (either `webpack.dev.js` or
`webpack.prod.js`) then the loading of chunks didn't fail, so it had
something to do with running both builds back to back.
I've now removed the `.dev.js` webpack config files and instead build
the minimized and non-minimized from the same config file
`webpack.build.js`.
I did the same for the headless builds.
(Although they do load when using converse.min.js)
I wasn't able to figure out why exactly, but setting `mode` to
`production` for the `converse.js` build solved the issue.
Had to add `src/strophe-shims.js` as a webpack alias to the shims.js
file in Strophe because the usage of `require` to load Node.js packags
in shims.js is causing problems with Webpack 5.
Set postcss-clean to 1.2.0 to fix the build error `node.getIterator() is
not a function`
Upgrade to latest Webpack
insofar we have an `occupant_id`.
We do this by subclassing `create` on the `ChatRoomOccupants` collection
and `save` on the `ChatRoomOccupant` model, to make sure that whenever
an occupant is created or saved, that the `id` matches the `occupant_id`
value if it's available.
This lets us look up the occupant via `occupant_id` via dictionary lookup,
instead of array traversal.
Another change is to save `from_real_jid` when adding an occupant to a message
When there is a circular dependency between disco entities (via their
advertised `disco#items`), Converse went into an infinite loop because
even though there was a check whether an entity already existed, it
failed to add newly created entities to the global
`_converse.disco_entities` collection.