Skip to content

Node.js API cleanup ideas for feedback #9766

Description

@brody2consult
  • Version: 6.9.1/7.2.0/general
  • Platform: UNIX/general
  • Subsystem: src (general)

Considering that the node.h header is exported for both addons and embedders I see a few things that could be improved:

Will discuss the remaining ideas elsewhere (related to nodejs/api#31):

  • Break node.h into the smaller parts such as:
    • API for addons
    • external API for embedder(s)
    • type definitions

Other ideas:

  • Keep the definition of node_module internal
  • C API for Node embedders

I would be happy to submit PRs for whatever ideas may be desired by the community.

Activity

  1. added
    c++Issues and PRs that require attention from people who are familiar with C++.
    on Nov 23, 2016
  2. Fishrock123 commented on Nov 23, 2016

    @Fishrock123
    Contributor

    C API for Node embedders

    Please see nodejs/api#31 :)

  3. Fishrock123 commented on Nov 23, 2016

    @Fishrock123
    Contributor

    cc @nodejs/api @nodejs/addon-api

  4. bnoordhuis commented on Nov 23, 2016

    @bnoordhuis
    Member

    Cleanup or remove lines to define size_t/ssize_t for UNIX/Windows [...] Ideal may be node-specific size typedefs.

    I think we can simply replace that with a #include <stddef.h> because it's a workaround for old Visual Studio versions that we no longer support. No need for custom typedefs.

    Keep the definition of node_module internal

    Can you go into more detail?

  5. brody2consult commented on Nov 23, 2016

    @brody2consult
    Author

    Keep the definition of node_module internal
    Can you go into more detail?

    See PR #9767

    replace that with a #include <stddef.h>

    node.h includes v8.h which in turn includes stddef.h - PR #9767 is now updated to take the lines out - I hope this is good enough.

    C API for Node embedders
    Please see nodejs/api#31 :)

    Thanks @Fishrock123!

    Fixes are in PR #9767, other changes will be discussed in API/EPS issues. Closing this one, looking forward to getting #9767 reviewed.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    c++Issues and PRs that require attention from people who are familiar with C++.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions