-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
AsyncIterable still raises compile issue with 3.6.1 if target is not set to ES2018 #14029
Comments
Is this with 3.6.0 or 3.6.1? See previous discussion in #13913. |
It's with 3.6.1 |
To fix this in extension, see the migration note in the documentation: https://jupyterlab.readthedocs.io/en/stable/extension/extension_migration.html#asynciterable-support |
Thanks @fcollonval, I saw the migration guide but I'm still confused because it does say the target was reverted to ES2017 in JLab 3.6.1, which does not seem to be the case.
|
The target is changing the produced JS assets but not the typing files. Therefore the
|
We could try shipping our custom types patch in the future to avoid breaking the developer experience for extension developers. I used this approach when backporting content-visibility mode in lumino without switching target: jupyterlab/lumino#500 by patching up |
That is a good question. Looking at the typescript type definition: /// <reference lib="es2015.symbol" />
/// <reference lib="es2015.iterable" />
interface SymbolConstructor {
/**
* A method that returns the default async iterator for an object. Called by the semantics of
* the for-await-of statement.
*/
readonly asyncIterator: symbol;
}
interface AsyncIterator<T, TReturn = any, TNext = undefined> {
// NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places.
next(...args: [] | [TNext]): Promise<IteratorResult<T, TReturn>>;
return?(value?: TReturn | PromiseLike<TReturn>): Promise<IteratorResult<T, TReturn>>;
throw?(e?: any): Promise<IteratorResult<T, TReturn>>;
}
interface AsyncIterable<T> {
[Symbol.asyncIterator](): AsyncIterator<T>;
}
interface AsyncIterableIterator<T> extends AsyncIterator<T> {
[Symbol.asyncIterator](): AsyncIterableIterator<T>;
} it seems possible. But I have no idea if this will always be the case - I guess if some new fundamental type were to be defined it won't be possible. |
Seems to be caused by the following line:
https://github.com/jupyterlab/jupyterlab/blob/3.6.x/packages/services/src/event/index.ts#L183
The text was updated successfully, but these errors were encountered: