Dropping require-kernel and yajsml
This is intended as a collection of useful information/discussion re migration to a better bundler like webpack or snowpack.
Old PoC for removing require-kernel: https://github.com/ether/etherpad-lite/pull/3603 Some useful todo that should be covered: https://github.com/ether/etherpad-lite/issues/3505
Maintained plugin for bundling plugins: https://github.com/storytouch/ep_webpack
imo it's best if we'd integrate bundling directly into core and cover plugins. Rebundling should only happen on the first start of core, after updating core or changing files in ./src, or after installing/deinstalling plugins. I'm not sure if we should support minify:false any longer. I think proper support for source maps would be enough.
We need to decide if we want a separate build step (it could be run on start/restart from within etherpad) or if we bundle files on demand. It needs to be investigated if the bundler in non-cli mode is as comprehensive as it's cli counterpart.
imo we should also think about moving to ESM. I imagine this to be unrelated to bundlin, ie move from CommonJS to ESM first, then think about bundling (hopefully the bundler comes with a transpiler to optionally support browser that don't support ESM yet - however only IE seems to be affected). The goal should be to enable plugin devs to easily migrate to ESM, maybe an automated script, or ESM wrapper and it would be cool if /admin/plugin would support something like "show/install the most recent compatible version of this plugin". Best would be, if core would support legacy plugins for a longer period. This needs investigation. Because we probably need to rethink what we want to export to make this happen, there is a relation to https://github.com/ether/etherpad-lite/issues/4714
Also related:
- removing globals from client-side code
- refactor/ease the page load process (onload/documentReady)
- less inline javascript (#4401)
Is there any ETA for fixing this? I have etherpad inside an iframe (different origins) and then it doesn't work on Chrome. Though it works with same origins, but for my particular case it is not option.
Related error:
require-kernel.js?v=e42393b5:10 Uncaught (in promise) DOMException: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'https://etherpad.domain.com/javascripts/lib/ep_etherpad-lite/static/js/ace2_inner.js?callback=require.define&v=e42393b5'.
at M (https://etherpad.domain.com/static/js/require-kernel.js?v=e42393b5:10:2299)
at X (https://etherpad.domain.com/static/js/require-kernel.js?v=e42393b5:10:2895)
at k (https://etherpad.domain.com/static/js/require-kernel.js?v=e42393b5:10:3669)
at i (https://etherpad.domain.com/static/js/require-kernel.js?v=e42393b5:10:4295)
at L (https://etherpad.domain.com/static/js/require-kernel.js?v=e42393b5:10:4316)
at https://etherpad.domain.com/static/js/require-kernel.js?v=e42393b5:10:5034
at H (https://etherpad.domain.com/static/js/require-kernel.js?v=e42393b5:10:5081)
at https://etherpad.domain.com/static/js/require-kernel.js?v=e42393b5:10:5482
at G (https://etherpad.domain.com/static/js/require-kernel.js?v=e42393b5:10:5504)
at e (https://etherpad.domain.com/static/js/require-kernel.js?v=e42393b5:10:6354)
Related issues: https://github.com/ether/etherpad-lite/issues/2427 https://github.com/ether/etherpad-lite/issues/3962
Not yet. We have seen your error before but it was a nginx misconfiguration. https://github.com/ether/etherpad-lite/issues/4976
Thank you that seems to solve the issue!
As a note for others with the same problem, put the Feature-Policy: "sync-xhr <allowlist>" header on the main frame.
Thanks!! Would you be so kind and test if it works with https://github.com/ether/etherpad-lite/pull/4990
And btw: Which version of chrome and what operating system? I wasn't able to reproduce this even with the imo latest version
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.