prototypejs / prototype

Prototype JavaScript framework
http://prototypejs.org/
Other
3.53k stars 639 forks source link

Prototype is no longer compatible with Vue.js #362

Open Sublime1 opened 8 months ago

Sublime1 commented 8 months ago

I know this project is no longer maintained, but who knows what the future holds? I'm creating this issue to gather thoughts on the fact that Prototype is no longer compatible with Vue.js since version 3.2.46

There is a workaround kindly provided by sodatea - putting the following lines before the first call to createApp fixes the issue:

const iframe = document.body.appendChild(document.createElement("iframe"));
const iframeArray = iframe.contentWindow.Array;
document.body.removeChild(iframe);
Array.from = iframeArray.from
jwestbrook commented 8 months ago

You should be able to simplify the workaround using this comment. Meaning no need to load an iframe just to get the browser Array.from.

Another way is to self host the prototype.js file and comment/delete line 1114. $A is used throughout the Prototype codebase versus using Array.from

(We might be able to convince @savetheclocktower to issue 1.7.3.1 that removes that line, but thats up to him)

Sublime1 commented 8 months ago

Hi Jason, thanks for the helpful response. In fact, you've convinced me that self hosting is probably a better way to go, because I see that there is also are a few PRs to fix a CVE issue. (I'm not actually sure which PR has the best fix.)

As I said to Thorsten over on the Vue issue, I was surprised to see how widely used Prototype still is. It's a real shame that the Prototype maintainers feel they can't bring out a new version (and I'm sure their reasons are solid). My Javascript skills are well below the level needed, but I'm sure there would be a big welcome for a new release.

Thanks!