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

[V2][Docs] Add comments to parcel/packages/core/types/index.js #3926

Open
brillout opened this issue Dec 18, 2019 · 0 comments
Open

[V2][Docs] Add comments to parcel/packages/core/types/index.js #3926

brillout opened this issue Dec 18, 2019 · 0 comments

Comments

@brillout
Copy link

The idea here is to comment the typings file as a temporary doc. For example:

  // parcel/packages/core/types/index.js
  // ...
  export interface TransformerResult {
+   // `type` is the kind of asset ('js', 'css', etc.).
    type: string;
+   // One of the following `source`, `content`, or `ast` needs to be defined.
+   // The source code of the asset.
    code?: string;
    map?: ?SourceMap;
    content?: Blob;
    ast?: ?AST;
    dependencies?: $ReadOnlyArray<DependencyOptions>;
    includedFiles?: $ReadOnlyArray<File>;
+   // Whether the asset is ....
    isIsolated?: boolean;
+   // I'm explaining what `isInline` is..
    isInline?: boolean;
+   // Same here...
    isSource?: boolean;
    env?: EnvironmentOpts;
    meta?: Meta;
    pipeline?: ?string;
    symbols?: Map<Symbol, Symbol>;
    sideEffects?: boolean;
    uniqueKey?: ?string;
  }
  // ...

Such comments would dramatically help the usage of Parcel's Plugin API.

I would even say that I wouldn't need any additional docs beyond such comments. But my point is to add comments as a temporary quick-n-dirty way to help us understand things before a full-blown doc is written.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants