-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
DataView
and other interfaces missing from lib.d.ts
#2953
Comments
shouldn't they either exist in both or not exist in either.
I still see it in http://people.mozilla.org/~jorendorff/es6-draft.html#sec-dataview-constructor and I still see it in my IE (v11). Using these API is not the same as targeting ES6 as far as I understand. But then again I'm not the one suffering here, just channelling :) |
My understanding is it is only defined in ES6 spec. And to clarify, the "not used in IE" bit I mentioned is referring to that according to the new IE spec files, these types won't be used by any other dom types in the next version of IE. @mhegazy, do we separate "using ES6 APIs" with "targeting ES6"? |
The definition in lib.es6.d.ts for matches the ES6 spec. it does not match the definition in existing engines today. Nothing stops us from moving them to lib.d.ts instead. but that still means that IE11 users will get errors. The issue is with TypedArrays (Int32Array for instance), i believe ArrayBuffer and DataView should be safe to put back. As a work around, you can either copy the definition from https://github.com/Microsoft/TypeScript/blob/release-1.4/bin/lib.d.ts in a local file in your project. or copy the whole library and include it in your project. |
Fix #2953: Put DataView definition back into lib.d.ts
should be in master now. |
@mhegazy Thanks. But as I said in the title there are |
fyi - just finished deleting ~360 lines in i copied i copied |
@mhegazy basically he's needed to copy https://github.com/cmichaelgraham/aurelia-typescript-atom/blob/master/skel-nav-ts/typings/lib.dom.d.ts.xxx into the project. Is this desirable? I think this stuff belongs in Specially since its in |
@cmichaelgraham what were the types you needed from lib.es6.d.ts and were not in lib.d.ts? do you have a list? @basarat We can move ones that are known to work in pre-ES6 world, so any thing that has symbols for instance can not move. similarly, promises, proxy, reflect..etc.. |
@cmichaelgraham it does not have to be complete. we can start by some errors :) |
ok, sounds great !! to make sure i understand the ask, this is the typings folder in my repo. if i understand, i should remove the |
Definitely typed has massive errors (DefinitelyTyped/DefinitelyTyped#4101 (comment)). bringing in @vvakame : Node:For
|
This is because the new dom.generated.d.ts has added many types that were previously defined in DefinitelyTyped already. From the error log it seems |
I want to writing es6, and emitting by es5. |
The reason they were split is that we got feedback that the library contains definitions for things that are guaranteed not to work in the wild, unless you have a pollifill (e.g. promises and symbols). I would like to get your feedback as well, do you think its better to have one library? |
Beginning to feel like any form of global namespace in JS is a bad idea. Don't have a good answer :D |
transpolar is returning error partly because of implementation and partly because of typescript regression see microsoft/TypeScript#2953
Map, Set, WeakMap are still missing. |
I like to unified default library. |
Its making its way to stackoverflow http://stackoverflow.com/a/30020614/390330 |
I agree. A single |
The core type definitions have been reshuffled a bit so some ES6 definitions (Map for example) that were previously available when targeting ES5 with TypeScript 1.4 can no longer be resolved with TypeScript 1.5.0-beta. This broke the NodeJS definitions, amongst other things (e.g. <microsoft/TypeScript#2953>), so as a temporary workaround I've included the ES6 type definitions (lib.es6.d.ts) that ship with TypeScript 1.5.0-beta in the project. This way the ES6 definitions in the project are used instead of the ES5 definitions that would otherwise be used by TypeScript when targeting ES5. es6-promise.d.ts has been removed from the project because lib.es6.d.ts already contains a definition for Promise, which caused naming conflicts.
I think this reason is simply invalid, because:
So I think even if it is desirable for some users to disable ES6+ APIs in ES5 mode of TS, there should be an option in tsc to get them back. See also discussion here #3211 .
This is another issue that TS should address, see #3215 . |
@duanyao please see my comment in #3211, and i think we need to keep the discussion in one issue, just to avoid duplicating comments across issues. now for your comment.
That is absolutely true, and this is why we do not want to be in the business of telling you what works and what does not. All what TypeScript compiler needs is type definitions, which are available as per ES6 spec in lib.es6.d.ts, the question is should we included by default in every compilation, and in editors like VS, sublime, VS code, atom, etc.. when you open a new file? we did that in TypeScript 1.3, and got feedback that ppl have found that confusing, so we kept them out. Nothing stops you from adding the file your self, adding a totally different file because you have some custom definitions, augmenting them...etc.. issue #3215 should make that even easier when fixed. I believe a solution that would give everyone what they want, is a new |
Sounds like a plan 👍 |
So where is the new flag or when should it be expected? I'm getting compile issues for DataView, Map, Set, and WeakMap from the node.d.ts TSD typings file. What is the workaround? |
Put a copy of |
I don't see a |
@wholroyd https://github.com/Microsoft/TypeScript/blob/master/bin/lib.es6.d.ts |
Looking at history : https://github.com/Microsoft/TypeScript/commits/master/bin/lib.d.ts
Was there on April 11 : https://github.com/Microsoft/TypeScript/blob/6f1feffe6710a3201fb46a0b01e16051bfc18a29/bin/lib.d.ts#L1689
Isn't there on April 18: https://github.com/Microsoft/TypeScript/blob/b8ebf561f94ea27ecfc6af3c2b20661e6fcd79ed/bin/lib.d.ts
Report by Atom-TypeScript user @vaughnroyko
The following code now fails (source from : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView):
The text was updated successfully, but these errors were encountered: