-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Library modularization #6990
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
Closed
Closed
Library modularization #6990
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
8e5606e
Separate ES6 library feature-by-feature into smaller files
44aed7b
Feature-by-feature separate es7 library into smaller files
cbec78e
Rename core to es5
73534a4
Update building library files in JakeFile
00d619d
Separate iterable into its own file
1609c31
separate symbol into its own file
eb30193
separate well-known symbol into its own file
3b15eb0
remove iterable and symbol component from es6.string.d.ts
2f43778
remove iterable and symbol components from es6.array.d.ts
41e5b24
remove iterable and symbol components from es6.collection.d.ts
067fa12
remove symbol components from es6.math.d.ts
9fa06fd
remove iterable and symbol components from es6.object.d.ts
5200bf1
remove iterable and symbol components from es6.promise.d.ts
8616370
remove iterable and symbol component from es6.reflect.d.ts
16104a2
remove iterable and symbol components from es6.proxy.d.ts
f19bd4c
split function into its own file
005271e
split regexp into its own file
80f6920
remove unused file
37a7998
rename es7 array-include d.ts file
69e5045
Include new lib files into compilation
b461ab8
Move symbol.iterable to symbol.wellknown
08f1a77
Make iterable depends on symbol
4684313
Move functions/methods that use propertyKey back to its original inte…
6043a97
Rename dome.es6 to dom.iterable
1704059
Rename importcore.d.ts to importes5.d.ts
779ffe8
Add es6.d.ts and es7.d.ts that contain /// references to their associ…
8e902c2
Update library compilation
c33a7ac
Fix harness broken from renaming generated library files
fc42621
Update baselines
70f6969
Merge branch 'master' into breakinglibrary
8e20680
Remove intl.d.ts
3839898
Use lib.full.es6.d.ts instead of lib.es6.d.ts
c1290c1
Add intl.d.ts to es5.d.ts
77639de
Add missing WeakSet and Set to collection
b41009a
Remove unused RegexpConstructor interface
23cb32e
Separate generator into its own file
499b338
Update baselines
2d2bf11
Merge branch 'master' into breakinglibrary
4c89068
Update baseline from merging intl.d.ts into es5.d.ts
5509b48
Update Jakefile
3f5d374
Remove iterable-iterator dependence
f052835
Use lower case for lib filename
05fe71c
Merge branch 'master' into breakinglibrary
e5bbdec
Renaming scripthost file
8167317
Renaming scripthost file
fbb80ee
Merge branch 'breakinglibrary' of https://github.com/Microsoft/TypeSc…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -809,8 +809,9 @@ namespace Harness { | |
const lineFeed = "\n"; | ||
|
||
export const defaultLibFileName = "lib.d.ts"; | ||
export const defaultLibSourceFile = createSourceFileAndAssertInvariants(defaultLibFileName, IO.readFile(libFolder + "lib.core.d.ts"), /*languageVersion*/ ts.ScriptTarget.Latest); | ||
export const defaultES6LibSourceFile = createSourceFileAndAssertInvariants(defaultLibFileName, IO.readFile(libFolder + "lib.core.es6.d.ts"), /*languageVersion*/ ts.ScriptTarget.Latest); | ||
export const defaultLibSourceFile = createSourceFileAndAssertInvariants(defaultLibFileName, IO.readFile(libFolder + "lib.es5.d.ts"), /*languageVersion*/ ts.ScriptTarget.Latest); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i woudl use the es6.full instead |
||
// TODO (yuisu): we should not use the lib.full.es6.d.ts. We will fix this when all the work for library modularization is in | ||
export const defaultES6LibSourceFile = createSourceFileAndAssertInvariants(defaultLibFileName, IO.readFile(libFolder + "lib.full.es6.d.ts"), /*languageVersion*/ ts.ScriptTarget.Latest); | ||
|
||
// Cache these between executions so we don't have to re-parse them for every test | ||
export const fourslashFileName = "fourslash.ts"; | ||
|
@@ -1605,7 +1606,7 @@ namespace Harness { | |
} | ||
|
||
export function isLibraryFile(filePath: string): boolean { | ||
return (Path.getFileName(filePath) === "lib.d.ts") || (Path.getFileName(filePath) === "lib.core.d.ts"); | ||
return (Path.getFileName(filePath) === "lib.d.ts") || (Path.getFileName(filePath) === "lib.es5.d.ts"); | ||
} | ||
|
||
export function isBuiltFile(filePath: string): boolean { | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
interface Array<T> { | ||
/** | ||
* Returns the value of the first element in the array where predicate is true, and undefined | ||
* otherwise. | ||
* @param predicate find calls predicate once for each element of the array, in ascending | ||
* order, until it finds one where predicate returns true. If such an element is found, find | ||
* immediately returns that element value. Otherwise, find returns undefined. | ||
* @param thisArg If provided, it will be used as the this value for each invocation of | ||
* predicate. If it is not provided, undefined is used instead. | ||
*/ | ||
find(predicate: (value: T, index: number, obj: Array<T>) => boolean, thisArg?: any): T; | ||
|
||
/** | ||
* Returns the index of the first element in the array where predicate is true, and undefined | ||
* otherwise. | ||
* @param predicate find calls predicate once for each element of the array, in ascending | ||
* order, until it finds one where predicate returns true. If such an element is found, find | ||
* immediately returns that element value. Otherwise, find returns undefined. | ||
* @param thisArg If provided, it will be used as the this value for each invocation of | ||
* predicate. If it is not provided, undefined is used instead. | ||
*/ | ||
findIndex(predicate: (value: T) => boolean, thisArg?: any): number; | ||
|
||
/** | ||
* Returns the this object after filling the section identified by start and end with value | ||
* @param value value to fill array section with | ||
* @param start index to start filling the array at. If start is negative, it is treated as | ||
* length+start where length is the length of the array. | ||
* @param end index to stop filling the array at. If end is negative, it is treated as | ||
* length+end. | ||
*/ | ||
fill(value: T, start?: number, end?: number): T[]; | ||
|
||
/** | ||
* Returns the this object after copying a section of the array identified by start and end | ||
* to the same array starting at position target | ||
* @param target If target is negative, it is treated as length+target where length is the | ||
* length of the array. | ||
* @param start If start is negative, it is treated as length+start. If end is negative, it | ||
* is treated as length+end. | ||
* @param end If not specified, length of the this object is used as its default value. | ||
*/ | ||
copyWithin(target: number, start: number, end?: number): T[]; | ||
} | ||
|
||
interface ArrayConstructor { | ||
/** | ||
* Creates an array from an array-like object. | ||
* @param arrayLike An array-like object to convert to an array. | ||
* @param mapfn A mapping function to call on every element of the array. | ||
* @param thisArg Value of 'this' used to invoke the mapfn. | ||
*/ | ||
from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): Array<U>; | ||
|
||
|
||
/** | ||
* Creates an array from an array-like object. | ||
* @param arrayLike An array-like object to convert to an array. | ||
*/ | ||
from<T>(arrayLike: ArrayLike<T>): Array<T>; | ||
|
||
/** | ||
* Returns a new array from a set of elements. | ||
* @param items A set of elements to include in the new array object. | ||
*/ | ||
of<T>(...items: T[]): Array<T>; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about "dom.es6.d.ts"? i do not see this anywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I am planning to do that in later pass with lib.node.d.ts and lib.browser.d.ts