GithubHelp home page GithubHelp logo

loaders's Introduction

Loaders Team

Purpose

The Node.js Loaders Team maintains and actively develops the ECMAScript Modules Loaders implementation in Node.js core.

History

This team is spun off from the Modules team. We aim to implement the use cases that went unfulfilled by the initial ES modules implementation that can be achieved via loaders.

Project

Status

Milestone 1: Parity with CommonJS

Before extending into new frontiers, we need to improve the loaders API enough that users can do just about everything they could do in CommonJS with ESM + loaders. (Outside of loaders scope, but related to the goal of parity between CommonJS and ESM, is finishing and stabilizing --experimental-vm-modules.)

Milestone 2: Stability

Milestone 3: Usability improvements

  • Provide a way to register loaders via configuration, for example via adding support for .env files to Node.js or having node read configuration from a new field in package.json or other configuration file. See nodejs/node#46826, #98, nodejs/node#43973 (comment). nodejs/node#48890.

  • Integrated support for external formats.

    • Phase 1: Support identifying external modules (eg typescript); see nodejs/node#49704.
    • Phase 2: Support guided remediation via package manager search (eg npm search … typescript).
    • Phase 3: Automatically configure Node.
  • First-class support for import maps that doesn’t require a custom loader.

  • Add helper/utility functions to reduce boilerplate in user-defined hooks.

    • Start with helpers for retrieving the closest parent package.json associated with a specifier string; and for retrieving the package.json for a particular package by name (which is not necessarily the same result).

    • Potentially include all the functions that make up the ESM resolution algorithm as defined in the spec. Create helper functions for each of the functions defined in that psuedocode: esmResolve, packageImportsResolve, packageResolve, esmFileFormat, packageSelfResolve, readPackageJson, packageExportsResolve, lookupPackageScope, packageTargetResolve, packageImportsExportsResolve, patternKeyCompare. (Not necessarily all with these exact names, but corresponding to these functions from the spec.)

    • Follow up with similar helper functions that make up what happens within Node’s internal load. (Definitions to come.)

  • Helper/utility functions to allow access to the CommonJS named exports discovery algorithm (cjs-module-lexer).

  • Hooks for customizing the REPL, including transpilation and tab completion. Support users pasting TypeScript (or CoffeeScript or whatever) into the REPL and having just as good an experience as with plain JavaScript.

    • Support top-level await in the REPL API, if possible.
  • Allow customizing string inputs: --eval CLI flag, Worker constructor, stdin, etc.

  • Hooks for customizing the stack trace (in other words, a hook version of Error.prepareStackTrace). This would allow transpiled languages to improve the output.

  • Hooks for customizing filesystem calls, for allowing things like virtual filesystems or archives treated as volumes.

  • Inherit configuration blob to worker threads and child processes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.