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

Upgrade typescript dependency version #368

Merged
merged 1 commit into from Oct 24, 2023
Merged

Conversation

Kit-p
Copy link
Contributor

@Kit-p Kit-p commented Oct 23, 2023

Fix typegen incorrectly outputs const for non-readonly fields.

Closes #361

Fix typegen incorrectly outputs const for non-readonly fields
@xenova
Copy link
Owner

xenova commented Oct 24, 2023

Great! Thanks so much! btw, do you have any links to typescript changelogs where they mention this bugfix?

@Kit-p
Copy link
Contributor Author

Kit-p commented Oct 24, 2023

@xenova I am not familiar with the typescript repo, can only confirm this is fixed in >=5.1.0.

With some investigations, I believe it was a magical side-effect of this PR, just a guess though.

@Kit-p
Copy link
Contributor Author

Kit-p commented Oct 24, 2023

@xenova just noticed there is a second bug (globalThis has no index signature) in #361, I am not sure if this solves that as well.

Let me get back to you later.

@Kit-p
Copy link
Contributor Author

Kit-p commented Oct 24, 2023

@xenova The globalThis problem is not related to this project, for details please refer to my comment on the issue.

This PR should be ready.

@xenova
Copy link
Owner

xenova commented Oct 24, 2023

I can confirm that this does mark env vars as non-constant (and should fix #361):

5.0.2: types/env.d.ts

export namespace env {
    export namespace backends {
        export { onnx_env as onnx };
        export const tfjs: {};
    }
    export { __dirname };
    export { VERSION as version };
    export const allowRemoteModels: boolean;
    export const remoteHost: string;
    export const remotePathTemplate: string;
    export const allowLocalModels: boolean;
    export { localModelPath };
    export { FS_AVAILABLE as useFS };
    export { WEB_CACHE_AVAILABLE as useBrowserCache };
    export { FS_AVAILABLE as useFSCache };
    export { DEFAULT_CACHE_DIR as cacheDir };
    export const useCustomCache: boolean;
    export const customCache: any;
}
declare const onnx_env: any;
declare const __dirname: any;
declare const VERSION: "2.7.0";
declare const localModelPath: any;
declare const FS_AVAILABLE: boolean;
declare const WEB_CACHE_AVAILABLE: boolean;
declare const DEFAULT_CACHE_DIR: any;
export {};

5.2.2: types/env.d.ts

export namespace env {
    export namespace backends {
        export { onnx_env as onnx };
        export let tfjs: {};
    }
    export { __dirname };
    export { VERSION as version };
    export let allowRemoteModels: boolean;
    export let remoteHost: string;
    export let remotePathTemplate: string;
    export let allowLocalModels: boolean;
    export { localModelPath };
    export { FS_AVAILABLE as useFS };
    export { WEB_CACHE_AVAILABLE as useBrowserCache };
    export { FS_AVAILABLE as useFSCache };
    export { DEFAULT_CACHE_DIR as cacheDir };
    export let useCustomCache: boolean;
    export let customCache: any;
}
declare const onnx_env: any;
declare const __dirname: any;
declare const VERSION: "2.7.0";
declare const localModelPath: any;
declare const FS_AVAILABLE: boolean;
declare const WEB_CACHE_AVAILABLE: boolean;
declare const DEFAULT_CACHE_DIR: any;
export {};

(notice difference between let and const)

@xenova xenova merged commit e457c4b into xenova:main Oct 24, 2023
4 checks passed
@Kit-p Kit-p deleted the fix/typegen branch October 25, 2023 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Env returns readonly in typescript
2 participants