GithubHelp home page GithubHelp logo

Comments (4)

mitermayer avatar mitermayer commented on April 27, 2024

just found it on https://github.com/facebook/commoner

from fbjs.

sophiebits avatar sophiebits commented on April 27, 2024

commoner is an older project which I'm not sure we use at all any more. Right now I believe we have three open source solutions for handling these:

  1. fbjs rewrite-requires is intended to be used with copying all built files to a flat dir and requiring ./X instead of X. We use this for building projects like react and draft-js for npm.
  2. The RN packager supports @providesModule natively but isn't designed to be general purpose.
  3. jest-haste-map (part of jest) can shim the require function in node to implement this behavior at runtime. Despite its name, this can be used outside of jest and is not tied to testing.

We don't support any of these for external users though. We might even change our OSS projects to not use @providesModule at all over time since it's always an interop hassle.

from fbjs.

mitermayer avatar mitermayer commented on April 27, 2024

Thanks for the answer! I have to admit I like the idea of flat modules somehow since dealing with '../../' on imports is very painful

from fbjs.

vko-online avatar vko-online commented on April 27, 2024

+1 Up

from fbjs.

Related Issues (20)

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.