Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove JS API v2 #8076

Merged
merged 5 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
- Updated React to version 18. Updated many peer dependencies inlcuding Redux, React-Router, antd, and FlexLayout. [#8048](https://github.com/scalableminds/webknossos/pull/8048)

### Fixed
- The JS API v2 has been removed as it was deprecated by v3 in 2018. Please upgrade to v3 in case your scripts still use v2. [#8076](https://github.com/scalableminds/webknossos/pull/8076)
- Fixed that the precompute-meshfile button did not work in the segments tab. [#8077](https://github.com/scalableminds/webknossos/pull/8077)

### Removed
Expand Down
12 changes: 4 additions & 8 deletions frontend/javascripts/oxalis/api/api_loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import type { OxalisModel } from "oxalis/model";
import app from "app";
import createApiLatest, { type ApiInterface } from "./api_latest";
import createApiV2 from "./api_v2";
import WkDev from "./wk_dev";
const latestVersion = 3;

Expand Down Expand Up @@ -39,20 +38,17 @@ class ApiLoader {
if (!process.env.IS_TESTING) {
if (version !== latestVersion) {
console.warn(`
Attention! You requested api version: ${version} which is
deprecated. The latest version is ${latestVersion}. Please upgrade your
script to the latest API as soon as possible.
Attention! You requested api version ${version} which is
deprecated and not supported anymore. The latest version is ${latestVersion}.
Please upgrade your script to the latest API.
`);
} else {
console.log("Requested api version:", version, "which is the latest version.");
}
}

return this.readyPromise.then(() => {
if (version === 2) {
// @ts-ignore The old API does not support all entries from the newest api.
this.apiInterface = createApiV2(this.model);
} else if (version === latestVersion) {
if (version === latestVersion) {
this.apiInterface = createApiLatest(this.model);
} else {
throw new Error("You requested an API version which does not exist.");
Expand Down
Loading