Skip to content

Commit

Permalink
API tech ref update
Browse files Browse the repository at this point in the history
  • Loading branch information
kerrishotts committed Jun 25, 2019
1 parent bd1aa2e commit ea99eb2
Show file tree
Hide file tree
Showing 82 changed files with 7,376 additions and 6,217 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"_cp-uxp": "cp -r ../../torq-native/torq-native/build/docs/js/* ./reference/uxp",
"book:install": "gitbook install . $@",
"book:build": "gitbook --timing --log=debug --debug build . $@",
"book:build:epub": "gitbook --log=debug --debug epub . $@",
Expand Down
Loading

1 comment on commit ea99eb2

@ericdrobinson
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kerrishotts Oh man. This commit removed the return type annotations which are super important.

Previous:

#### entry.getMetadata() ⇒ `Promise.<EntryMetadata>`

Current:

#### entry.getMetadata()

Without this information, users may expect that an EntryMetadata instance is directly returned, rather than a Promise instance that will eventually evaluate to one!

It does appear that type information is maintained in the Returns: sections of each API. However, some of those sections do not currently exist in the documentation making it appear that they will return void or undefined.

HOWEVER, with respect to the entry.getMetadata() method mentioned in the example above, the JS example was further updated from:

const metadata = await aFile.getMetadata();

to:

const metadata = aFile.getMetadata();

The removal of the await indicates that a value (presumably an EntryMetadata instance...) is returned directly. Testing with XD 20.0.12.10 shows that a call to Entry.getMetadata() still returns a Promise instance! So unless something changes about this API in the next version then a bug was just introduced here and the documentation actually got less specific with this commit!

Please sign in to comment.