Migrating to JS Enhanced Mode


(Anthony) #1

I note that 5.1 is going to start the process of deprecating the old standard mode JSAPI, to support only enhanced mode going forwards, presumably from 5.2 or 5.3. Sadly, I have a ton of code that is all written using the standard mode! So I was thinking...

 

In the same way there are online services for .NET developers that let you paste in a chunk of VB.NET code and it has a fair stab at generating the equivalent in c#, how easily could someone produce a "conversion" utility that can parse a standard mode function and generate the equivalent in enhanced mode? I wouldn't expect it to be anything too amazing... even if you had to paste code in one call at a time and then it only got it perfect 80% of the time, it would still save a heck of lot of frustrating and error prone effort.

 

Thoughts anyone?


(Nic Hubbard) #2

Sounds to me like that would be quite a bit of development in itself. I would just opt for doing it manually as it would be less error prone.


(Anthony Barnes) #3

You could save yourself a copy of the old standard mode javascript while you re-factor your code in the interim. As long as the right post variables are sent to the JS API it doesn't really matter, although obviously for support reasons it's better to use the enhanced API.


(Anthony) #4

Whilst I wouldnt really want to rely on saving a copy of the current JS, that sounds like an excellent fall back plan in the event that standard mode gets deprecated sooner than expected and we have other more pressing reasons to upgrade before we have converted and restested everything (I have a feeling the end user testing will take longer than the technical work!).

 

So, just to confirm, you are anticipating that - initially at least - the deprecation of Standard mode will only involve removing support for it in the JS file that gets downloaded to the client whilst leaving the server side code that actually actions the POST unchanged? I think that would be a great plan for at least one release, then understandably there could be more far reaching changes in the future to tidy things up and rework the API more fundamentally on the back end without any "legacy" ties.

 

Sounds like I'll have a good 6 months to figure this out, so I might still have a dabble with conversion options and if I come up with anything useful - even if its just some written advice or feedback on the effort - I'll be sure to share. It would be good if other users of standard mode post up here so we can see how many are likely to be in the same boat.

 

Thanks

Anthony