Skip to content
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

Dropping require-kernel and yajsml #4820

Open
webzwo0i opened this issue Feb 18, 2021 · 5 comments · May be fixed by #5150
Open

Dropping require-kernel and yajsml #4820

webzwo0i opened this issue Feb 18, 2021 · 5 comments · May be fixed by #5150

Comments

@webzwo0i
Copy link
Member

webzwo0i commented Feb 18, 2021

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: #3603
Some useful todo that should be covered: #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 #4714

Also related:

@jompu
Copy link

jompu commented Apr 3, 2021

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:
#2427
#3962

@webzwo0i
Copy link
Member Author

webzwo0i commented Apr 3, 2021

Not yet. We have seen your error before but it was a nginx misconfiguration. #4976

@jompu
Copy link

jompu commented Apr 4, 2021

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.

@webzwo0i
Copy link
Member Author

webzwo0i commented Apr 4, 2021

Thanks!! Would you be so kind and test if it works with #4990

And btw: Which version of chrome and what operating system? I wasn't able to reproduce this even with the imo latest version

@stale
Copy link

stale bot commented Jun 3, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants