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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more typedoc #1928

Merged
merged 10 commits into from
Jan 8, 2024
Merged

more typedoc #1928

merged 10 commits into from
Jan 8, 2024

Conversation

turadg
Copy link
Member

@turadg turadg commented Jan 8, 2024

Description

Enables typedoc for these packages:

  • ses
  • @endo/lockdown
  • @endo/bundle-source - this required fixing a realpathSync argument
  • @endo/marshal - this required hard-coding the any and string types that it was trying to import from pass-style but failing

Security Considerations

Scaling Considerations

Documentation Considerations

Testing Considerations

Upgrade Considerations

@turadg turadg requested review from kriskowal and erights January 8, 2024 20:48
@turadg turadg merged commit e85d8a7 into master Jan 8, 2024
14 checks passed
@turadg turadg deleted the ta/more-typedoc branch January 8, 2024 20:55
Copy link
Contributor

@mhofman mhofman left a comment

Choose a reason for hiding this comment

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

I am concerned something marked as "typedoc" is regressing types

@@ -4,16 +4,16 @@ export {};
/**
* @template Slot
* @callback ConvertValToSlot
* @param {import('@endo/pass-style').PassableCap} val
* @param {any} val a PassableCap
Copy link
Contributor

Choose a reason for hiding this comment

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

That seems like a terrible regression, possibly due to types not being built!

Copy link
Member Author

Choose a reason for hiding this comment

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

It's not a regression. PassableCap in master is any.
Screenshot 2024-01-08 at 1 10 49 PM

Copy link
Contributor

Choose a reason for hiding this comment

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

Then the issue is with the PassableCap definition, not this param definition.

Copy link
Member Author

Choose a reason for hiding this comment

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

There was indeed an issue with the PassableCap definition. It was any. The type is still any so there's no regression here.

Once we fix those types, I expect to return to this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fix in #1933

Comment on lines +3 to +5
import * as url from 'url';
import * as process from 'process';
import * as fs from 'fs';
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the significance of this change? Why didn't it cause anything else to change?

Copy link
Member Author

Choose a reason for hiding this comment

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

These Node modules have no default exports. Under CommonJS the set of named exports could be treated as an object but under ESM you have to bundle the named exports into an object if you want to access them that way.

@@ -6,6 +6,11 @@ import { makeMarshal } from '../src/marshal.js';

const { freeze, isFrozen, create, prototype: objectPrototype } = Object;

const harden = /** @type {import('ses').Harden & {isFake: boolean}} */ (
Copy link
Contributor

Choose a reason for hiding this comment

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

Would the following also work? If so, I think it better documents the runtime reality it describes. Likewise for the other occurrences of course

Suggested change
const harden = /** @type {import('ses').Harden & {isFake: boolean}} */ (
const harden = /** @type {import('ses').Harden & {isFake?: boolean}} */ (

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes it would. I'll see about adding tacking that onto another PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

turadg added a commit that referenced this pull request Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants