Skip to content

Prototype is no longer compatible with Vue.js #362

Open

Description

@Sublime1

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

Activity

  1. jwestbrook commented on Nov 2, 2023

    @jwestbrook
    Collaborator

    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)

  2. Sublime1 commented on Nov 3, 2023

    @Sublime1
    Author

    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!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions