HackMD
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Next-10 Mini-Summit 18 Nov 2021 **Mini-summit issue:** https://github.com/nodejs/next-10/issues/99 **Recording:** http://www.youtube.com/watch?v=TY5uirDq1SI **Minutes doc:** https://hackmd.io/mW7rTTYvREOwGRpOYkXc4w **Attendees** * Michael Dawson (@mhdawson) * Tierney Cyren (@bnb) * Michael Zasso (@targos) * Orta Therox (@orta) * Richard Lau (@richardlau) * Igor * Max Schmitt (@maxibanki) * Gireesh Punathil (@gireeshpunathil) * Joyee Cheung (@joyeecheung) * Joe Sepi (@joesepi) * Erick Wendel * Bethany Nicolle Griggs (@BethGriggs) * Simon Schick (@SimonSchick) * Ruben Bridgewater (@BridgeAR) * Steven (@Styfle) * Parris Lucas (@groovecs) * Jean Burellier (@sheplu) * Joyee Cheung (@igalia) **Agenda** * Quick introductions * Suitable types for end-users - 90 mins * Break 15 mins * Single Executable Applications - 90 mins * Break 15 mins * Wrap up and capture next actions ## Suitable types for end-users * Orta (@orta) * From [TypeScript](https://github.com/microsoft/TypeScript) team, advantages to being in [Definitely Typed](https://github.com/DefinitelyTyped) has advantages * Easier to make minor fixes * Changes to node types tested across the vast ecosystems for breaks * We can support multiple versions of TS and node in the same place * Automation could help improve things * Simon has something that extracts docs from Node.js * Simon (@SimonSchick) * A tool that tries to match types with documentation * Fairly incomplete * Pulls in docs tags, also help identify where types are missing * Orta (@orta) * Web, all have specs generated from that * Reach into Mozilla repos, using [JSON](https://www.json.org/json-en.html) data to extract doc, and append those to types * Maybe there is an excellent way to get a JSON dump of functions in Node.js to provide richer types inside the type system * Tierney (@bnb), the discussion is getting closer to my pref, which is to mirror what electron does. [Electron](https://github.com/electron) structure is sort of patterned on Node.js, they have [docparser](https://github.com/Docparser), which creates JSON rep, and they can generate types off that. Node.js dumps into a text property were as the Electron one is more structured. * Tierney (@bnb) spent some time getting docparser working with Node.js, which does not appear due to legacy. Json representation of APIs would be good. * Orta (@orta), one of the parts of the tension is that the more profound the integration, the more node maintainers need to know about typescript. Advanced TS syntax makes it hard, and we want to avoid maintainers having to understand how to make it all work in those more advanced cases. This work best left for contributors in DT. * Today's flow * API is added/documented in Node.js codebase * Node.js publish JSON content on doc site for example * [https://nodejs.org/.../console.json](https://nodejs.org/dist/latest-v17.x/docs/api/console.json) * Simon runs his tool manually. It tries to match documentation in JSON files published on the Node.js the site to the tree that already exists in DT. It checks for missing definitions, mostly output warnings. * The tool will actively pull docs for with a match and update the docs. * New methods require additional new APIs. * Pull Requests(PRs) reviewed and landed. * Ideal flow * API is added/documented in machine-consumable way to Node.js codebase. * An automated script in DT runs, generates new PR. * PRs reviewed and landed * Challenges with consuming existing data * Current JSON data is reasonably inaccurate, words are accurate, but struct is not. This function tries to match things up - [github.com/SimonSchick/DefinitelyTyped/.../node-doc-processing.ts#L112](https://github.com/SimonSchick/DefinitelyTyped/blob/master/types/node/scripts/generate-docs/node-doc-processing.ts#L112) * Often generated JSON docs do not represent actual documentation. * How do we model complex generics overload? * e.g., return types differ depending on argument values currently not modeled at doc assumes these functions return type unions. * Many methods in the child process module take the same types, but docs redefine. So we are just documenting function arguments. * Example of converting Node.js doc to work with electron parser * [github.com/bnb/node-docs-parser](https://github.com/bnb/node-docs-parser) * Info in comments and YAML would need need conversation to raw markdown (for example introduced in) style guide - [Electron Documentation Style Guide](https://github.com/electron/electron/blob/main/docs/styleguide.md) * Possible MVP * Discuss if we can use the electron style guide * Explore DocsParser, perform multiple exports fix allow generations for "enough stuff." * Would need to move metadata into markdown to be visible (type systems require this). * It would require a change to the HTML generator. * Actions, validation jobs for docs that have generated * Questions * Would it change how the existing markdown looks? * Do we have any commitments on the structure of that? * Is stuff used in comments/YAML used in types? * What issues around backporting to earlier versions exist? ## Single Executable Applications * Current solutions * [pkg](https://github.com/vercel/pkg) ![GitHub Repo stars](https://img.shields.io/github/stars/vercel/pkg?style=plastic) * [nexe](https://github.com/nexe/nexe) ![GitHub Repo stars](https://img.shields.io/github/stars/nexe/nexe?style=plastic) * [NectarJS](https://github.com/NectarJS/nectarjs) ![GitHub Repo stars](https://img.shields.io/github/stars/nectarjs/nectarjs?style=plastic) * [node-packer](https://github.com/pmq20/node-packer) ![GitHub Repo stars](https://img.shields.io/github/stars/pmq20/node-packer?style=plastic) * [BoxedNode](https://github.com/mongodb-js/boxednode) ![GitHub Repo stars](https://img.shields.io/github/stars/mongodb-js/boxednode?style=plastic) * Styfle * 3 different ways of bundling * pkg, bundles Node.js executable into a single binary, similar to what Deno does * [ncc](https://github.com/vercel/ncc), compiles all JavaScript into single file, distribute single JS filem with exectable directive at the top * [nft](https://github.com/vercel/nft), given single input file, find all dependent files which gives the list * Benefit is that those who are unfamiliar with Node.js ecosystem can easily run binary. cli is a good example * Easy to download, easy to run * Michael (@mhdawson) does size of binary matter? * Tierney (@bnb) all three might be interesting but for what we are discussing here pkg most related * Steven (@Styfle) - [Awesome Desktop JS > Packaging](https://github.com/styfle/awesome-desktop-js#packaging), list of implementations. * Tierny (@bnb) quite a few shows interest. * Today common challenges include: * Igor * compile time * traverse require calls, would be good if nft and pkg combined efforts. * runtime * how do we store the assets needed to run * pkg has its own binary format that indexes them * pkg attaches to the Node.js executable * Michael (@mhdawson) both pkg and BoxedNode require that you compile Node.js. * For pkg, hidden source code requires compilation * pkg required patches - [github.com/.../99#issuecomment-970674910](https://github.com/nodejs/next-10/issues/99#issuecomment-970674910) * Igor, self-extracting archive * Each platform has its own way of * Issues around adding signatures (ex OSX) * Obesfication, how impoortant is that? * Is one of the reasons people would want single binary verus just using script. * Signature issues * Executables have their own format on each platform * They have sections, one more section added to end with signature. * Cannot just blindly buffer contact, need to make their payload a proper section of the binary * Without signature os does not care if you have added to the binary, signature tools may strip out a section if it is a simple concat. * Packer would need to * Strip signature from Node.js * Add the new section in manner that complies with OS exe structure * Use signing tools to add new signature * Flow that might makes sense is * On startup Node.js checks for section in exe * Load options from known offset in section * Load JS file from known offset in section * Michael Z, be able to run single file in binary format. Then second feature is to bundle single file. * Joyee can you not already do that with bundlers like Webpack * Michael Z, Ideal if Node.js was its own bundler. * Joyee makes sense for Node.js to be able to patch itself, just the simple case of patching itself and staring binary js file. * Richard, Issue/PR already to provide framework to allow a virutal file system to be provide * Joyee, bundlers can generate single file * Michael Z, there are limitations, cannot support native modules, or include additional files * Michael, need to define more than just block of JS * Joyee, don't want to contrain what we put in section * Structure needs to have a least 3 sections * options (ex allow --js-flags) * arguments for Node.js (-e allows js to be specified) * data section to be passed to js file * Command line args, additional arg to add options to Node.js arguments (--js-flags). Force to be the first argument. * Still would not support native addons * pkg ended up placing native modules as dlls shipped along with binary * boxednode includes native addons, we should ask Anna how you do that. * Richard believes boxednode handles native addons by including them in like core modules * Approaches * Compile with node, into exe (boxnode) * Bundled onto exising Node.js exe (pkg approach) * Richard used to be `third party main`, I think we took that out, how do you start something else. Good prior art to consider. * Joyee we could add into list of conditions checked in startup for startup before others. `third_party_main.js` was implemented because it was easy (just checking for the existence of it). The bundling solution would be more sophisticated. * Michael Z, In which mode (esm or cjs) should we run the next section * Michael D, probaly need an option for that ## Next Steps and actions ### Single Executable Applications * Ask anna if there are things still needed in Node.js to support "Compile with node" approach * Write up an overview of what we discussed in terms of potential addition to Node.js * Share what we discussed with @jesec with respect to what we discussed to support bundled onto Node.js exe approach * Reach out to V8 team to see if it's possible to rely on the compilation cache (which includes the bytcode) for compilation and not require sources (Yang had previously said it was doable, prior art: https://chromium-review.googlesource.com/c/v8/v8/+/1462961). ## Suitable types for end-users * Document target flow for Node.js type generation * Staring discussion on adopting Electron style guide * Further explore Electron TypesParser to see if it can be used to generate JSON for Node.js project * Explore how we'd move metadata from comments/YAML to markdown as they are currenlty not rendered and it would also help exposing through TypesParser * Rethink how doc is structured with respect to API documentation versus other things. Should JavaScript API docs and other topics be more separated?

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully