Re: Prototype.js replacing JSON.stringify

2023-07-18 Thread Basil Crow
Many thanks to everyone who has contributed PRs to remove usages of
Prototype.

I did a more thorough search for usages of Prototype, this time scanning
every .jelly and .js file in the Update Center. I updated the spreadsheet

.

-- 
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/CAFwNDjrFD19B877mMhRQ7yM934fUMxXdBm382ScRcY2Vu2wX5Q%40mail.gmail.com.


Re: Prototype.js replacing JSON.stringify

2023-05-29 Thread Basil Crow
On Mon, May 29, 2023 at 3:40 PM 'Rahul Somasunderam' via Jenkins
Developers  wrote:
>
> Will that be a problem?

It will be. See https://github.com/jenkinsci/stapler/pull/452.

-- 
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/CAFwNDjoGKH2RzABnxnZzmeJYYzw4O%2BHcHFebYDyRe8kLcmunpA%40mail.gmail.com.


Re: Prototype.js replacing JSON.stringify

2023-05-29 Thread 'Rahul Somasunderam' via Jenkins Developers
It's got a conditional that checks if `$` evaluates to jQuery first. That
seems to be a similar check as the one for Object.toJSON. Will that be a
problem?

On Mon, May 29, 2023 at 3:37 PM Basil Crow  wrote:

> On Mon, May 29, 2023 at 3:33 PM 'Rahul Somasunderam' via Jenkins
> Developers  wrote:
> > I tested out uno-choice from the spreadsheet - it doesn't depend on
> prototype.
> > I think it's a false positive
>
> No. Active Choices calls Prototype's Ajax.Request. It is not a false
> positive.
>
> --
> 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/CAFwNDjoe71HgF69CktvzbAfGPQ-dem_-A1XrmQ2yF5EnWDY%3D-w%40mail.gmail.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/CAE4RbR57QsR_UTsBXE_KvKpT%2BZSXAkf45FH3idsJeGG6%2BSFSrA%40mail.gmail.com.


Re: Prototype.js replacing JSON.stringify

2023-05-29 Thread Basil Crow
On Mon, May 29, 2023 at 3:33 PM 'Rahul Somasunderam' via Jenkins
Developers  wrote:
> I tested out uno-choice from the spreadsheet - it doesn't depend on prototype.
> I think it's a false positive

No. Active Choices calls Prototype's Ajax.Request. It is not a false positive.

-- 
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/CAFwNDjoe71HgF69CktvzbAfGPQ-dem_-A1XrmQ2yF5EnWDY%3D-w%40mail.gmail.com.


Re: Prototype.js replacing JSON.stringify

2023-05-29 Thread 'Rahul Somasunderam' via Jenkins Developers
I tested out uno-choice from the spreadsheet - it doesn't depend on
prototype.
I think it's a false positive because jQuery also has a `.each`, `.show`,
and `.hide` method.
Do we want a different color for false positives?

On Thu, May 18, 2023 at 10:54 AM Basil Crow  wrote:

> 2.406 is on track to ship without any usages of Prototype. I have created
> a tracking spreadsheet
> 
> to cover Prototype usages in plugins and filed issues for any affected
> plugin with more than 100 installations. Please assign yourselves some of
> these issues and file PRs so that we can get the plugin ecosystem updated.
>
> --
> 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/CAFwNDjoa5fC6Lu7zCBzf%2Bvqv9W_pxybfiqV63N6wGdvLHyPWaw%40mail.gmail.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/CAE4RbR7oLJ20A3Tt-ARB3_JcZDDive8nv3-YGVDAk-Srs7B%2BuA%40mail.gmail.com.


Re: Prototype.js replacing JSON.stringify

2023-05-18 Thread Basil Crow
2.406 is on track to ship without any usages of Prototype. I have
created a tracking
spreadsheet

to cover Prototype usages in plugins and filed issues for any affected
plugin with more than 100 installations. Please assign yourselves some of
these issues and file PRs so that we can get the plugin ecosystem updated.

-- 
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/CAFwNDjoa5fC6Lu7zCBzf%2Bvqv9W_pxybfiqV63N6wGdvLHyPWaw%40mail.gmail.com.


Re: Prototype.js replacing JSON.stringify

2023-05-11 Thread Basil Crow
I filed pull requests to remove Prototype.js from about 25 or so
plugins. Please review, merge, and release these.

Here are some more plugins I identified that are still using
Prototype.js. Please file pull requests to remove Prototype.js from
these plugins:

matrix-auth 264461
blueocean 64506
git-parameter 59223
metrics 51938
uno-choice 33501
ivy 23035
translation 21443
github-pullrequest 15538
cloudbees-disk-usage-simple 11259
atlassian-bitbucket-server-integration 7260
extra-columns 7165
gitlab-logo 5368
categorized-view 4510
fortify 4287
azure-ad 4019
release 2971
scm-sync-configuration 2810
dockerhub-notification 1808
pollscm 1764
jira-ext 1680
synopsys-coverity 1451
qtest 1270
openstack-cloud 940
azure-app-service 886
jclouds-jenkins 612
oracle-cloud-infrastructure-compute 494
chatwork 327
azure-vmss 223
qualys-was 183
html-audio-notifier 174
collabnet 156
nsiqcollector 144
mentor-questa-vrm 84
wxwork-notification 76
testabilityexplorer 65
depbuilder 49
simpleupdatesite 36
simplify-qa-connector 3
gamekins 0

-- 
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/CAFwNDjqxXk-MX1qVi90pSBfXjQPqdbjd7OJh7Q%3DqD16Q%3D%3Dwp0w%40mail.gmail.com.


Re: Prototype.js replacing JSON.stringify

2023-05-07 Thread Tim Jacomb
I think pull requests are now open for all of the core usage of prototype.

and a PR for bom and ATH which removes prototype in
https://github.com/jenkinsci/jenkins/pull/7781

Basil has opened a PR with a feature flag that you can use to disable
prototype and do some more testing / developing of prototype removal fixes:
https://github.com/jenkinsci/jenkins/pull/7948

On Sat, 6 May 2023 at 00:43, Basil Crow  wrote:

> On Mon, Mar 13, 2023 at 3:27 PM 'Gavin Mogan' via Jenkins Developers
>  wrote:
> >
> > I think the first steps would be to remove as many of those references
> from core before detaching the plugin and making it optional
>
> Detaching Prototype to a plugin might work, but it is also likely to
> create problems in practice — plugins that update their core baseline
> to one after the detach point won't necessarily get test failures once
> Prototype is missing unless they have HtmlUnit tests for all portions
> of their UI (unlikely) and so their maintainers are unlikely to notice
> that they need to do anything until after the plugin is released and
> users start complaining. There are about 50 plugins that use
> Prototype, so I think the better solution is to proactively remove
> Prototype usages from all of them and then remove Prototype from core.
> This is a large amount of work, but it could be feasible if everyone
> in this thread participated in the effort.
>
> --
> 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/CAFwNDjrxgJ589zG9k%2BbXSgt_OJrHWq%2B3nrAPWUtt%2BtwHs2RQYA%40mail.gmail.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/CAH-3BidSye9zAqne%2BriavCJLL%2BtUT4f9M8cLV-EmsmKr5%3DhFHQ%40mail.gmail.com.


Re: Prototype.js replacing JSON.stringify

2023-05-05 Thread Basil Crow
On Mon, Mar 13, 2023 at 3:27 PM 'Gavin Mogan' via Jenkins Developers
 wrote:
>
> I think the first steps would be to remove as many of those references from 
> core before detaching the plugin and making it optional

Detaching Prototype to a plugin might work, but it is also likely to
create problems in practice — plugins that update their core baseline
to one after the detach point won't necessarily get test failures once
Prototype is missing unless they have HtmlUnit tests for all portions
of their UI (unlikely) and so their maintainers are unlikely to notice
that they need to do anything until after the plugin is released and
users start complaining. There are about 50 plugins that use
Prototype, so I think the better solution is to proactively remove
Prototype usages from all of them and then remove Prototype from core.
This is a large amount of work, but it could be feasible if everyone
in this thread participated in the effort.

-- 
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/CAFwNDjrxgJ589zG9k%2BbXSgt_OJrHWq%2B3nrAPWUtt%2BtwHs2RQYA%40mail.gmail.com.


Re: Prototype.js replacing JSON.stringify

2023-04-02 Thread Basil Crow
On Sat, Mar 11, 2023 at 3:37 PM Ullrich Hafner  wrote:
> But this JS code is so deeply nested in Jenkins UI code that I have no clue 
> on how to fix that...

You could open pull requests for one or more of the dozens of
currently unassigned subtasks in JENKINS-70906.

-- 
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/CAFwNDjoh7sJF5qXMvAJ_UQ4V%3Djg4yJ_YfvhYCCyLwCQ8--yhtQ%40mail.gmail.com.


Re: Prototype.js replacing JSON.stringify

2023-04-02 Thread Basil Crow
https://issues.jenkins.io/browse/JENKINS-70906 FTR

-- 
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/CAFwNDjpahcDHFEpwNL_kmwd48kifgrKHG_68fnqKOcPgb6airw%40mail.gmail.com.


Re: Prototype.js replacing JSON.stringify

2023-03-30 Thread Tim Jacomb
There's a draft PR open at https://github.com/jenkinsci/jenkins/pull/7781
It does almost all of core.

There were one or two more complicated ones I left for later.

This search shows the rest of the jenkinsci hosted plugins as well:
https://github.com/search?q=org%3Ajenkinsci+Ajax.Request++NOT+repo%3Ajenkinsci%2Fjenkins+=code=1

If anyone wants to help they could either test the above pull request or
submit some pull requests to other plugins.

Thanks
Tim

On Tue, 14 Mar 2023 at 08:06, Tim Jacomb  wrote:

> 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 <
> jenkinsci-dev@googlegroups.com> 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
>>  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 
>>> 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
>>>
>>> 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 
>>> 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
 

Re: Prototype.js replacing JSON.stringify

2023-03-14 Thread Tim Jacomb
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 <
jenkinsci-dev@googlegroups.com> 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 <
> jenkinsci-dev@googlegroups.com> 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 
>> 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
>>
>> 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 
>> 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
>> 

Re: Prototype.js replacing JSON.stringify

2023-03-13 Thread 'Gavin Mogan' via Jenkins Developers
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 <
jenkinsci-dev@googlegroups.com> 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 
> 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
>
> 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 
> 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 

Re: Prototype.js replacing JSON.stringify

2023-03-11 Thread 'Rahul Somasunderam' via Jenkins Developers
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  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 :I vaguely remember some _javascript_ code somewhere deleting Object.prototype.toJSON() or somethingA quick search found https://github.com/jenkinsci/jenkins/blob/e41aeaacf434b9ff93c8848f8eddbfcbb27ed462/war/src/main/js/util/jenkins.js#L20-L54In 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  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 DevToolsJSON.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.


Re: Prototype.js replacing JSON.stringify

2023-03-11 Thread Ullrich Hafner
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 
> :
> 
> 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  > 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 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/A41F2DC5-1DC0-406A-8E37-95A59C196381%40gmail.com.


Re: Prototype.js replacing JSON.stringify

2023-03-02 Thread 'Rahul Somasunderam' via Jenkins Developers
Thanks!

On Thu, Mar 2, 2023 at 2:15 PM 'Gavin Mogan' via Jenkins Developers <
jenkinsci-dev@googlegroups.com> wrote:

> 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 
> 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 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/CAG%3D_Duv8NOUT%2BzGfEoww2bf11kdNAkkT8HCwG%3DUoRuCB6J5ktQ%40mail.gmail.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/CAE4RbR4h3-TQoKf5y0e1VFkoKu6zwW5cUW6nJ7R%2BN0QQpamD3g%40mail.gmail.com.


Re: Prototype.js replacing JSON.stringify

2023-03-02 Thread 'Gavin Mogan' via Jenkins Developers
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 
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.


Re: Prototype.js replacing JSON.stringify

2023-03-02 Thread Ullrich Hafner
> 
> 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.