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

doc: add inheritance links and other changes #798

Closed

Conversation

gabrielschulhof
Copy link
Contributor

  • README.md:
    • Change indentation to reflect class hierarchy.
    • Link to new doc/hierarchy.md which shows full class hierarchy.
  • Add single sentence with link to parent class at the top of class doc.
  • doc/addon.md:
    • Replace Addon with Addon<T>.
    • Show templating in prototypes.
    • Move InstanceWrap<T> method documentation to its own file, because
      it is shared with ObjectWRap<T>, and link to said new file.
  • doc/array.md: Create the file from the Array-related contents of
    doc/basic_types.md.
  • Remove doc/basic_types.md, splitting its contents per-class into
    individual files.
  • Add doc/hierarchy.md, with full class hierarchy.
  • Add doc/instance_wrap.md for documenting InstanceMethod,
    InstanceAccessor, and InstanceValue.
  • Create doc/name.md from doc/basic_types.md, documenting Napi::Name.
  • doc/object_wrap.md:
    • Add templating notation Napi::ObjectWrap<T>.
    • Show templating in prototypes.
    • Wrap file to 80 columns.
    • Remove methods provided by InstanceWrap<T> and link to
      doc/instance_wrap.md.
  • doc/value.md:
    • Merge documentation from doc/basic_types.md.
    • Add namespacing.
    • Sort methods alphabetically.

Signed-off-by: @gabrielschulhof

* README.md:
  * Change indentation to reflect class hierarchy.
  * Link to new doc/hierarchy.md which shows full class hierarchy.
* Add single sentence with link to parent class at the top of class doc.
* doc/addon.md:
  * Replace `Addon` with `Addon<T>`.
  * Show templating in prototypes.
  * Move `InstanceWrap<T>` method documentation to its own file, because
    it is shared with `ObjectWRap<T>`, and link to said new file.
* doc/array.md: Create the file from the `Array`-related contents of
  doc/basic_types.md.
* Remove doc/basic_types.md, splitting its contents per-class into
  individual files.
* Add doc/hierarchy.md, with full class hierarchy.
* Add doc/instance_wrap.md for documenting `InstanceMethod`,
  `InstanceAccessor`, and `InstanceValue`.
* Create doc/name.md from doc/basic_types.md, documenting `Napi::Name`.
* doc/object_wrap.md:
  * Add templating notation `Napi::ObjectWrap<T>`.
  * Show templating in prototypes.
  * Wrap file to 80 columns.
  * Remove methods provided by `InstanceWrap<T>` and link to
    doc/instance_wrap.md.
* doc/value.md:
  * Merge documentation from doc/basic_types.md.
  * Add namespacing.
  * Sort methods alphabetically.

Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com>
Fixes: nodejs#796
Copy link
Member

@NickNaso NickNaso left a comment

Choose a reason for hiding this comment

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

Good work just some comments to address.

README.md Outdated
- [ObjectReference](doc/object_reference.md)
- [PropertyDescriptor](doc/property_descriptor.md)
- [Value](doc/value.md)
- [Name](doc/basic_types.md#name)
Copy link
Member

Choose a reason for hiding this comment

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

This link is broken the right one is:

README.md Outdated
- [Boolean](doc/boolean.md)
- [External](doc/external.md)
- [Object](doc/object.md)
- [Array](doc/basic_types.md#array)
Copy link
Member

Choose a reason for hiding this comment

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

This link is broken the right one is:

doc/array.md Outdated
Comment on lines 8 to 9
[`Napi::TypedArray`][] and [`Napi::ArrayBuffer`][] correspond to JavaScript data
types such as [`Int32Array`][] and [`ArrayBuffer`][], respectively, that can be
Copy link
Member

Choose a reason for hiding this comment

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

Missing the links for:

  • Napi::TypedArray
  • Napi::ArrayBuffer
  • Int32Array
  • ArrayBuffer

Comment on lines +3 to +11
This class serves as the base class for [`Napi::ObjectWrap<T>`][] and
[`Napi::Addon<T>`][].

In the case of [`Napi::Addon<T>`][] it provides the
methods for exposing functions to JavaScript on instances of an add-on.

As a base class for [`Napi::ObjectWrap<T>`][] it provides the methods for
exposing instance methods of JavaScript objects instantiated from the JavaScript
class corresponding to the subclass of [`Napi::ObjectWrap<T>`][].
Copy link
Member

Choose a reason for hiding this comment

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

Missing the link for:

  • Napi::ObjectWrap<T>
  • Napi::Addon<T>
  • Napi::ObjectWrap<T>

The `Napi::Addon` class can be used to define an entire add-on. Instances of
`Napi::Addon` subclasses become instances of the add-on, stored safely by
The `Napi::Addon<T>` class can be used to define an entire add-on. Instances of
`Napi::Addon<T>` subclasses become instances of the add-on, stored safely by
Copy link
Member

Choose a reason for hiding this comment

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

This is only available in the recent versions right. I'm wondering if we needed some versioning so that people can tell when new APIs are available.

@mhdawson
Copy link
Member

Overall it looks good one the links @NickNaso has mentioned are fixed up.

The only concern I have is around is the shift to the versions and people using older versions or the existing examples. Does the updated doc have enough explanation for those not using the templated version? Lets discuss in the N-API team meeting tomorrow.

@mhdawson
Copy link
Member

Discussed in the meeting today, these were always templated so this comment does not apply "updated doc have enough explanation for those not using the templated version", given that I think its good.

As a follow on we should probably introduce info about which versions introduce which APIs.

Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

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

LGTM once @NickNaso comments are addressed

@gabrielschulhof
Copy link
Contributor Author

@NickNaso I fixed the broken links.

Copy link
Member

@NickNaso NickNaso left a comment

Choose a reason for hiding this comment

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

LGTM.

gabrielschulhof pushed a commit that referenced this pull request Sep 16, 2020
* README.md:
  * Change indentation to reflect class hierarchy.
  * Link to new doc/hierarchy.md which shows full class hierarchy.
* Add single sentence with link to parent class at the top of class doc.
* doc/addon.md:
  * Replace `Addon` with `Addon<T>`.
  * Show templating in prototypes.
  * Move `InstanceWrap<T>` method documentation to its own file, because
    it is shared with `ObjectWRap<T>`, and link to said new file.
* doc/array.md: Create the file from the `Array`-related contents of
  doc/basic_types.md.
* Remove doc/basic_types.md, splitting its contents per-class into
  individual files.
* Add doc/hierarchy.md, with full class hierarchy.
* Add doc/instance_wrap.md for documenting `InstanceMethod`,
  `InstanceAccessor`, and `InstanceValue`.
* Create doc/name.md from doc/basic_types.md, documenting `Napi::Name`.
* doc/object_wrap.md:
  * Add templating notation `Napi::ObjectWrap<T>`.
  * Show templating in prototypes.
  * Wrap file to 80 columns.
  * Remove methods provided by `InstanceWrap<T>` and link to
    doc/instance_wrap.md.
* doc/value.md:
  * Merge documentation from doc/basic_types.md.
  * Add namespacing.
  * Sort methods alphabetically.

Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com>
Fixes: #796
PR-URL: #798
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Nicola Del Gobbo <nicoladelgobbo@gmail.com>
@gabrielschulhof
Copy link
Contributor Author

Landed in 8c9f180.

@gabrielschulhof gabrielschulhof deleted the doc-add-inheritance-links branch September 16, 2020 00:13
Superlokkus pushed a commit to Superlokkus/node-addon-api that referenced this pull request Nov 20, 2020
* README.md:
  * Change indentation to reflect class hierarchy.
  * Link to new doc/hierarchy.md which shows full class hierarchy.
* Add single sentence with link to parent class at the top of class doc.
* doc/addon.md:
  * Replace `Addon` with `Addon<T>`.
  * Show templating in prototypes.
  * Move `InstanceWrap<T>` method documentation to its own file, because
    it is shared with `ObjectWRap<T>`, and link to said new file.
* doc/array.md: Create the file from the `Array`-related contents of
  doc/basic_types.md.
* Remove doc/basic_types.md, splitting its contents per-class into
  individual files.
* Add doc/hierarchy.md, with full class hierarchy.
* Add doc/instance_wrap.md for documenting `InstanceMethod`,
  `InstanceAccessor`, and `InstanceValue`.
* Create doc/name.md from doc/basic_types.md, documenting `Napi::Name`.
* doc/object_wrap.md:
  * Add templating notation `Napi::ObjectWrap<T>`.
  * Show templating in prototypes.
  * Wrap file to 80 columns.
  * Remove methods provided by `InstanceWrap<T>` and link to
    doc/instance_wrap.md.
* doc/value.md:
  * Merge documentation from doc/basic_types.md.
  * Add namespacing.
  * Sort methods alphabetically.

Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com>
Fixes: nodejs#796
PR-URL: nodejs#798
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Nicola Del Gobbo <nicoladelgobbo@gmail.com>
kevindavies8 added a commit to kevindavies8/node-addon-api-Develop that referenced this pull request Aug 24, 2022
* README.md:
  * Change indentation to reflect class hierarchy.
  * Link to new doc/hierarchy.md which shows full class hierarchy.
* Add single sentence with link to parent class at the top of class doc.
* doc/addon.md:
  * Replace `Addon` with `Addon<T>`.
  * Show templating in prototypes.
  * Move `InstanceWrap<T>` method documentation to its own file, because
    it is shared with `ObjectWRap<T>`, and link to said new file.
* doc/array.md: Create the file from the `Array`-related contents of
  doc/basic_types.md.
* Remove doc/basic_types.md, splitting its contents per-class into
  individual files.
* Add doc/hierarchy.md, with full class hierarchy.
* Add doc/instance_wrap.md for documenting `InstanceMethod`,
  `InstanceAccessor`, and `InstanceValue`.
* Create doc/name.md from doc/basic_types.md, documenting `Napi::Name`.
* doc/object_wrap.md:
  * Add templating notation `Napi::ObjectWrap<T>`.
  * Show templating in prototypes.
  * Wrap file to 80 columns.
  * Remove methods provided by `InstanceWrap<T>` and link to
    doc/instance_wrap.md.
* doc/value.md:
  * Merge documentation from doc/basic_types.md.
  * Add namespacing.
  * Sort methods alphabetically.

Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com>
Fixes: nodejs/node-addon-api#796
PR-URL: nodejs/node-addon-api#798
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Nicola Del Gobbo <nicoladelgobbo@gmail.com>
Marlyfleitas added a commit to Marlyfleitas/node-api-addon-Development that referenced this pull request Aug 26, 2022
* README.md:
  * Change indentation to reflect class hierarchy.
  * Link to new doc/hierarchy.md which shows full class hierarchy.
* Add single sentence with link to parent class at the top of class doc.
* doc/addon.md:
  * Replace `Addon` with `Addon<T>`.
  * Show templating in prototypes.
  * Move `InstanceWrap<T>` method documentation to its own file, because
    it is shared with `ObjectWRap<T>`, and link to said new file.
* doc/array.md: Create the file from the `Array`-related contents of
  doc/basic_types.md.
* Remove doc/basic_types.md, splitting its contents per-class into
  individual files.
* Add doc/hierarchy.md, with full class hierarchy.
* Add doc/instance_wrap.md for documenting `InstanceMethod`,
  `InstanceAccessor`, and `InstanceValue`.
* Create doc/name.md from doc/basic_types.md, documenting `Napi::Name`.
* doc/object_wrap.md:
  * Add templating notation `Napi::ObjectWrap<T>`.
  * Show templating in prototypes.
  * Wrap file to 80 columns.
  * Remove methods provided by `InstanceWrap<T>` and link to
    doc/instance_wrap.md.
* doc/value.md:
  * Merge documentation from doc/basic_types.md.
  * Add namespacing.
  * Sort methods alphabetically.

Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com>
Fixes: nodejs/node-addon-api#796
PR-URL: nodejs/node-addon-api#798
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Nicola Del Gobbo <nicoladelgobbo@gmail.com>
wroy7860 added a commit to wroy7860/addon-api-benchmark-node that referenced this pull request Sep 19, 2022
* README.md:
  * Change indentation to reflect class hierarchy.
  * Link to new doc/hierarchy.md which shows full class hierarchy.
* Add single sentence with link to parent class at the top of class doc.
* doc/addon.md:
  * Replace `Addon` with `Addon<T>`.
  * Show templating in prototypes.
  * Move `InstanceWrap<T>` method documentation to its own file, because
    it is shared with `ObjectWRap<T>`, and link to said new file.
* doc/array.md: Create the file from the `Array`-related contents of
  doc/basic_types.md.
* Remove doc/basic_types.md, splitting its contents per-class into
  individual files.
* Add doc/hierarchy.md, with full class hierarchy.
* Add doc/instance_wrap.md for documenting `InstanceMethod`,
  `InstanceAccessor`, and `InstanceValue`.
* Create doc/name.md from doc/basic_types.md, documenting `Napi::Name`.
* doc/object_wrap.md:
  * Add templating notation `Napi::ObjectWrap<T>`.
  * Show templating in prototypes.
  * Wrap file to 80 columns.
  * Remove methods provided by `InstanceWrap<T>` and link to
    doc/instance_wrap.md.
* doc/value.md:
  * Merge documentation from doc/basic_types.md.
  * Add namespacing.
  * Sort methods alphabetically.

Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com>
Fixes: nodejs/node-addon-api#796
PR-URL: nodejs/node-addon-api#798
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Nicola Del Gobbo <nicoladelgobbo@gmail.com>
johnfrench3 pushed a commit to johnfrench3/node-addon-api-git that referenced this pull request Aug 11, 2023
* README.md:
  * Change indentation to reflect class hierarchy.
  * Link to new doc/hierarchy.md which shows full class hierarchy.
* Add single sentence with link to parent class at the top of class doc.
* doc/addon.md:
  * Replace `Addon` with `Addon<T>`.
  * Show templating in prototypes.
  * Move `InstanceWrap<T>` method documentation to its own file, because
    it is shared with `ObjectWRap<T>`, and link to said new file.
* doc/array.md: Create the file from the `Array`-related contents of
  doc/basic_types.md.
* Remove doc/basic_types.md, splitting its contents per-class into
  individual files.
* Add doc/hierarchy.md, with full class hierarchy.
* Add doc/instance_wrap.md for documenting `InstanceMethod`,
  `InstanceAccessor`, and `InstanceValue`.
* Create doc/name.md from doc/basic_types.md, documenting `Napi::Name`.
* doc/object_wrap.md:
  * Add templating notation `Napi::ObjectWrap<T>`.
  * Show templating in prototypes.
  * Wrap file to 80 columns.
  * Remove methods provided by `InstanceWrap<T>` and link to
    doc/instance_wrap.md.
* doc/value.md:
  * Merge documentation from doc/basic_types.md.
  * Add namespacing.
  * Sort methods alphabetically.

Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com>
Fixes: nodejs/node-addon-api#796
PR-URL: nodejs/node-addon-api#798
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Nicola Del Gobbo <nicoladelgobbo@gmail.com>
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.

3 participants