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 <ullrich.haf...@gmail.com> 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 <jenkinsci-dev@googlegroups.com>:

I vaguely remember some _javascript_ code somewhere deleting Object.prototype.toJSON() or something

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 <ullrich.haf...@gmail.com> 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 jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/708c6498-e0d4-481e-9ad7-e0a8e5af65ffn%40googlegroups.com.


--
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 jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/76FFAC15-B00C-4528-8AB1-68ED0E6D7055%40gmail.com.

--
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 jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAG%3D_Duv8NOUT%2BzGfEoww2bf11kdNAkkT8HCwG%3DUoRuCB6J5ktQ%40mail.gmail.com.

--
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 jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/A41F2DC5-1DC0-406A-8E37-95A59C196381%40gmail.com.

--
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 jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/80E76615-4607-4DA0-B4F3-32FE56558EF3%40netflix.com.

Reply via email to