We are starting to retire Script Compatibility Mode

We will continue to make changes to the frontend as Wanikani evolves. Some of these changes will impact third party scripts. The best I can do is provide posts like this one to notify you of the new features/changes but it is too difficult for me to speculate which scripts will be affected and how. It is a tough challenge trying to deliver new features and balancing that with breaking scripts which arenā€™t under our control. I can only promise to try my best to keep you informed. I hope that is okay?!

4 Likes

Sorry, I think we are still not together yet :cold_sweat:
What I would like to know is: Are there any parts of the frontend that have not been switched to React yet? And if so, when are you planning to switch them over?
Maybe I missed the news but I havenā€™t heard anything along the lines of ā€œWeā€™re now done with the React transitionā€, and so Iā€™m still waiting and not changing my scripts, because I donā€™t want to change them over and over again. So if you could shed some light on that question, that would be very much appreciated!

As I said before, of course you will evolve WK and make changes to the frontend. And thatā€™s totally fine (itā€™s the nature of software development, after all). But the shotgun-surgery switch to React was a bit of a different beast regarding the impact for the script devs as it simply affected everything.

Thanks for your patience :blush:

3 Likes

Yes there are parts of the frontend that are not using React. I recently updated all subject and level pages away from React and back to server side rendered pages using BEM. Hopefully BEM will provide some stability to blocks of HTML even as they move around the page. Although I cannot make any guarantees that BEM blocks wonā€™t disappear and be replaced with new and better functionality in future.

In terms of the plan to switch more over to React, that is not our plan moving forward. I donā€™t want say too much at the moment as we are still working out what the future path looks like and I donā€™t want to promise anything that may or may not happen.

When or if you choose to update your scripts is completely up to you. I canā€™t promise that a month or two from now we donā€™t add a new feature that will break one of your scripts, but like I said I can do my best to keep you updated. Unfortunately this is the nature of injecting scripts into pages you donā€™t control. We do make guarantees with our API but we donā€™t make any guarantees about the structure of our pages.

I hope that you understand this point of view, and I will continue to help however I can.

7 Likes

Hey Scott,

Do you see legacy reviews getting pulled before the end of the year or is it still to be determined?

The /user endpoint of the API is currently returning a wanikani_compatibility_mode property under preferences. Will that be removed at/around the time legacy reviews are pulled?

Thanks!

Yes I hope that this will be gone a few weeks from now all going well.

Thanks for pointing that out. I am not yet sure whether I will remove the wanikani_compatibility_mode key from the preferences object or whether I will always have it return false. This was done before my time, so the key may have been intentionally left out of our API contract as documented here. My preference would be to remove it as it is an undocumented API feature, and realistically the value is only intended to be used by our codebase.

1 Like

Thank you for the heads up, Scott. If all the scripts Iā€™m using break, I will cry. At least I have almost a week to prepare mentally. :crabigator: :crabigator: :crabigator:

Iā€™m hoping new features would be things like having a Recent Burned Mistakes Items under Burned Items and maybe some custom Graded Readers for WaniKani users. Like a Graded Reader section for levels 1-10, 11-20, etc.

3 Likes

This seems totally reasonable. Maintaining legacy code is extremely painful, especially for a relatively small team. The fact that you guys have tried to be conscientious about it for so long is very kind.

Any user scripts that depend on a specific DOM structure or selector queries are always going to be brittle. You canā€™t expect otherwise, as the developers need to be free to make changes.

Itā€™s really the backend APIs that need to be stable. Ideally they should be versioned, with each version being entirely stable.

Anyways, since youā€™re moving to React (rather slowly, it seems), Iā€™m wondering if youā€™re eventually planning on a React Native app? I was planning on making one myself. The main benefit of this to me is having app notification reminders, and maybe better text-to-speech input (so I can speak my answers sometimes if I choose).

1 Like

I personally wonā€™t miss the script compatibility mode. On the one hand it was useful for keeping old scripts alive, but on the other hand it burdened userscript authors (and WK developers) with having to maintain/test against two versions of WaniKani. Or maybe even three versions if we include https://preview.wanikani.com ā€“ I donā€™t remember if the preview server was ever used during the lifetime of the script compatibility mode.

Much more important to me would be notifications whenever something changed on WaniKani so that I know when I have to update my scripts. There is a mailing list, the forum, and there was https://knowledge.wanikani.com/wanikani/script-compatibility-mode, but none of these communication channels were used for the recent changes. Since I donā€™t actively use WaniKani anymore, I had to rely on users eventually reporting problems with the scripts.

So thatā€™s why the HTML/CSS structure was once again different from the structure in lessons. I was hoping that the change to React would make everything a bit more consistent. So, if I understand correctly, the transition to React is now discontinued? Now Iā€™m wondering if another batch of breaking changes to the lesson screen is just around the corner or if the lesson screen will keep using React for a while :sweat_smile:

5 Likes

BEM has nothing to do with React. Itā€™s just a CSS naming structure that can reduce or eliminate selector specificity issues, making the code more modular and the styles less affected by where they appear in the DOM. I seriously doubt they would abandon React.

1 Like

Iā€™m not sure, since they said

3 Likes

My apologies, I didnā€™t catch that. What an odd choice.

Sorry about not posting about the changes to the subject and level pages earlier. I was/am still learning the ropes.

I am trying my best not to talk too much about what the future might look like and when that future may or may not occur. I donā€™t want to get caught promising something that may not happen, so I feel it is safer and more socially responsible to only talk about new features and changes when they are closer to being released. That said I will be continuing to migrate pages away from React and in the course of that work, updating the pages to use BEM. The subject and level pages now use Hotwire and the plan is for more pages to follow suit. Hopefully this will bring some consistency that you are after.

3 Likes

I am not sure what cause Script Compatibility Mode notification to show (i.e. considering turning on script compatibility mode, when it is now off).

Anyway, so far, the scripts I am using arenā€™t broken (for practical usage and in console).

WK has a short list of scripts that they check for, if they find one of them they show the notification. Though I think they only show it once?

1 Like

Hi All,

This change is now live. I will keep you updated on further changes to compatibility mode in new topic postings.

Thanks for the feedback so far :+1:

7 Likes

For anyone still following this post, there is a new update here: Removing Legacy Reviews

Would like my jitai backā€¦

Time to learn JS :wink:

1 Like

image

Yeah, I want to know whatā€™s in the list. Also, itā€™s not fair if the script gets updated anyway.