I've made a start: https://github.com/jenkinsci/jenkins/pull/7727
This PR is also removing some prototype as well: https://github.com/jenkinsci/jenkins/pull/7718 On Mon, 13 Mar 2023 at 22:27, 'Gavin Mogan' via Jenkins Developers < [email protected]> wrote: > My knowledge of core is pretty out dated, but as far as I know, a lot of > the behaviors are defined using YUI and Prototypejs > I think the first steps would be to remove as many of those references > from core before detaching the plugin and making it optional > > For example, the Ajax.Request would need to be re-written > > https://github.com/jenkinsci/jenkins/blob/a4447db3d88fd883b99ff3925a5ea90864794367/core/src/main/resources/lib/form/link/link.js#L15 > > https://github.com/jenkinsci/jenkins/blob/a4447db3d88fd883b99ff3925a5ea90864794367/core/src/main/resources/lib/layout/breadcrumbs.js#L168 > > I'm sure there's lots of other legacy items left behind. > > Talking about it is good, but unless people actually make PRs, it'll never > actually get replaced. > > On Sat, Mar 11, 2023, 8:01 PM 'Rahul Somasunderam' via Jenkins Developers < > [email protected]> wrote: > >> Is it possible to turn it into its own plugin and treat it as an implicit >> dependency for plugins relying on older versions of Jenkins, but remove it >> later? >> >> >> On Mar 11, 2023, at 15:37, Ullrich Hafner <[email protected]> >> wrote: >> >> I think I also have some problems with this ugly dependency. Seems that >> other JS libraries that rely on JSON stringify (datatables, echarts) break >> in some places as well :-( >> >> But this JS code is so deeply nested in Jenkins UI code that I have no >> clue on how to fix that... >> >> >> Am 02.03.2023 um 23:15 schrieb 'Gavin Mogan' via Jenkins Developers < >> [email protected]>: >> >> I vaguely remember some javascript code somewhere deleting >> Object.prototype.toJSON() or something >> >> A quick search found >> https://github.com/jenkinsci/jenkins/blob/e41aeaacf434b9ff93c8848f8eddbfcbb27ed462/war/src/main/js/util/jenkins.js#L20-L54 >> In theory that makes JSON.stringify work again, but would make the other >> prototype js fail, so would have to be done temporarily. >> >> >> On Thu, Mar 2, 2023 at 1:59 PM Ullrich Hafner <[email protected]> >> wrote: >> >>> >>> Hi! >>> I was looking at some javascript that was behaving differently on >>> Jenkins than it does on other apps. I boiled it down to the simplest >>> reproducible test case. >>> It turned out that serialization was behaving differently when calling >>> JSON.stringify. >>> >>> This is the sample code you can run on the Chrome DevTools >>> >>> JSON.stringify({ a: [1, 2, 3] }); >>> >>> On Jenkins, this is the behavior >>> >>> '{"a":"[1, 2, 3]"}' >>> >>> On other apps, this is the behavior >>> >>> '{"a":[1, 2, 3]}' >>> >>> When I attempt to debug the code, stepping into `JSON.stringify` on >>> Jenkins takes me to prototype.js. >>> >>> I've seen some threads here attempting not to rely on prototype.js for >>> functionality, but how far are we from removing it? >>> >>> >>> Very far. A couple of years ago I even tried to upgrade prototype.js to >>> the latest version but failed, since some plugins are depending on >>> prototype.js as well. All UI stuff is tightly coupled to prototype.js, this >>> will be very hard to remove. >>> >>> >>> - Rahul >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Jenkins Developers" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/jenkinsci-dev/708c6498-e0d4-481e-9ad7-e0a8e5af65ffn%40googlegroups.com >>> <https://groups.google.com/d/msgid/jenkinsci-dev/708c6498-e0d4-481e-9ad7-e0a8e5af65ffn%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >>> >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Jenkins Developers" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/jenkinsci-dev/76FFAC15-B00C-4528-8AB1-68ED0E6D7055%40gmail.com >>> <https://groups.google.com/d/msgid/jenkinsci-dev/76FFAC15-B00C-4528-8AB1-68ED0E6D7055%40gmail.com?utm_medium=email&utm_source=footer> >>> . >>> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Jenkins Developers" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/jenkinsci-dev/CAG%3D_Duv8NOUT%2BzGfEoww2bf11kdNAkkT8HCwG%3DUoRuCB6J5ktQ%40mail.gmail.com >> <https://groups.google.com/d/msgid/jenkinsci-dev/CAG%3D_Duv8NOUT%2BzGfEoww2bf11kdNAkkT8HCwG%3DUoRuCB6J5ktQ%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> >> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "Jenkins Developers" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/jenkinsci-dev/DR9Rr08fd0Y/unsubscribe. >> To unsubscribe from this group and all its topics, send an email to >> [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/jenkinsci-dev/A41F2DC5-1DC0-406A-8E37-95A59C196381%40gmail.com >> <https://groups.google.com/d/msgid/jenkinsci-dev/A41F2DC5-1DC0-406A-8E37-95A59C196381%40gmail.com?utm_medium=email&utm_source=footer> >> . >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Jenkins Developers" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/jenkinsci-dev/80E76615-4607-4DA0-B4F3-32FE56558EF3%40netflix.com >> <https://groups.google.com/d/msgid/jenkinsci-dev/80E76615-4607-4DA0-B4F3-32FE56558EF3%40netflix.com?utm_medium=email&utm_source=footer> >> . >> > -- > You received this message because you are subscribed to the Google Groups > "Jenkins Developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jenkinsci-dev/CAG%3D_Dusx27en4HpM1ku6pmqCWWbaBWZ%2BGOJFmaMfE3BBN%3DTw8w%40mail.gmail.com > <https://groups.google.com/d/msgid/jenkinsci-dev/CAG%3D_Dusx27en4HpM1ku6pmqCWWbaBWZ%2BGOJFmaMfE3BBN%3DTw8w%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAH-3BifwOJ_JK9aBAZE1mkz_0%2Bf%3DFVFxbGC1pAi5MzH1chfL9g%40mail.gmail.com.
