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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: remove implicit 'any' and 'Object' types from the docs #19585

Merged
merged 3 commits into from Aug 5, 2019

Conversation

@MarshallOfSound
Copy link
Member

commented Aug 2, 2019

Previously if the typescript generator saw a type it didn't understand, was incomplete or was invalid it just defaulted to "any". This was good for a while but it results in worse docs over time, a recent change to the parser (included in this PR) now enforces every single type is valid and will throw an error if anything is wrong rather than falling back to any.

The PR explicitly types a few things to fix these new errors 馃憤

Notes: no-notes

@MarshallOfSound MarshallOfSound force-pushed the stricter-types branch from 05f39ba to f7f9d76 Aug 2, 2019

@ckerr

ckerr approved these changes Aug 2, 2019

@ckerr ckerr referenced this pull request Aug 2, 2019
4 of 4 tasks complete

@electron-cation electron-cation bot removed the new-pr 馃尡 label Aug 3, 2019

@@ -1381,7 +1381,7 @@ win.loadURL('http://localhost:8000/post', {

* `filePath` String
* `options` Object (optional)
* `query` Object (optional) - Passed to `url.format()`.
* `query` Record<String, String> (optional) - Passed to `url.format()`.

This comment has been minimized.

Copy link
@nornagon

nornagon Aug 3, 2019

Contributor

string or String? let's be consistent

@zcbenz

zcbenz approved these changes Aug 5, 2019

spec failures

@codebytere

This comment has been minimized.

Copy link
Member

commented Aug 5, 2019

Changes themselves look good but seeing:

Running: Main process specs
[1060:0801/181037.232967:INFO:content_main_runner_impl.cc(978)] Chrome is running in full browser mode.
[1063:0801/181037.753821:ERROR:vt_video_encode_accelerator_mac.cc(517)]  VTCompressionSessionCreate failed: -12908
Unhandled exception in main spec runner: electron/spec-main/api-browser-window-spec.ts(1717,11): error TS2532: Object is possibly 'undefined'.
electron/spec-main/api-browser-window-spec.ts(1745,11): error TS2532: Object is possibly 'undefined'.
electron/spec-main/api-browser-window-spec.ts(1803,11): error TS2532: Object is possibly 'undefined'.
electron/spec-main/api-browser-window-spec.ts(1820,11): error TS2532: Object is possibly 'undefined'.
electron/spec-main/api-browser-window-spec.ts(1821,11): error TS2532: Object is possibly 'undefined'.
electron/spec-main/api-browser-window-spec.ts(1821,34): error TS2339: Property 'foo' does not exist on type 'WebPreferences'.
electron/spec-main/api-browser-window-spec.ts(1838,11): error TS2532: Object is possibly 'undefined'.
electron/spec-main/api-browser-window-spec.ts(1839,29): error TS2339: Property 'webContents' does not exist on type 'BrowserWindowConstructorOptions'.
electron/spec-main/api-browser-window-spec.ts(1957,11): error TS2532: Object is possibly 'undefined'.
electron/spec-main/api-browser-window-spec.ts(2122,11): error TS2532: Object is possibly 'undefined'.
electron/spec-main/api-browser-window-spec.ts(2131,11): error TS2532: Object is possibly 'undefined'.
electron/spec-main/api-browser-window-spec.ts(2132,11): error TS2532: Object is possibly 'undefined'.
electron/spec-main/api-browser-window-spec.ts(2132,34): error TS2339: Property 'foo' does not exist on type 'WebPreferences'.
electron/spec-main/api-browser-window-spec.ts(2188,13): error TS2532: Object is possibly 'undefined'.
electron/spec-main/api-browser-window-spec.ts(2208,13): error TS2532: Object is possibly 'undefined'.

@MarshallOfSound MarshallOfSound merged commit cfd230d into master Aug 5, 2019

13 of 14 checks passed

Artifact Comparison Changes Detected
Details
Backportable? - 7-0-x Clean Backport
Details
Semantic Pull Request ready to be squashed
Details
WIP Ready for review
Details
appveyor: win-ia32-testing AppVeyor build succeeded
Details
appveyor: win-ia32-testing-pr AppVeyor build succeeded
Details
appveyor: win-x64-testing AppVeyor build succeeded
Details
appveyor: win-x64-testing-pr AppVeyor build succeeded
Details
build-linux Workflow: build-linux
Details
build-mac Workflow: build-mac
Details
electron-arm-testing Build #20190805.28 succeeded
Details
electron-arm64-testing Build #20190805.28 succeeded
Details
lint Workflow: lint
Details
release-notes Release notes found
@release-clerk

This comment has been minimized.

Copy link

commented Aug 5, 2019

No Release Notes

@MarshallOfSound MarshallOfSound deleted the stricter-types branch Aug 5, 2019

@trop

This comment has been minimized.

Copy link
Contributor

commented Aug 5, 2019

I have automatically backported this PR to "7-0-x", please check out #19630

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can鈥檛 perform that action at this time.