Giter Club home page Giter Club logo

Comments (4)

cpojer avatar cpojer commented on May 3, 2024

We are using the inline-require transform for unit tests to do lazy mocking and to be able to use top-level requires in jest unit tests to be more consistent with how we write regular modules. We shouldn't be applying it to third-party code that doesn't need transforms to be applied, I'll fix the issue in react-native.

The issue is:

var A = require('A');

A = Foo;

gets transformed to

require('A') = Foo;

from fbjs.

nsimmons avatar nsimmons commented on May 3, 2024

Makes sense! That would be super weird. Thanks for the explanation.

from fbjs.

boourns avatar boourns commented on May 3, 2024

@cpojer I've found another case where this transform is being applied to vendored code. Trying to run xcode integration tests in react-native 0.12 or 0.13, on circle ci results in the following from the packager:

{"message":"TransformError: /Users/distiller/shopify-native/node_modules/react-native/node_modules/react-tools/src/shared/vendor/performance/performanceNow.js: /Users/distiller/shopify-native/node_modules/react-native/node_modules/react-tools/src/shared/vendor/performance/performanceNow.js: Cannot assign to a require(...) alias, performance. Line: 21","type":"TransformError","errors":[{}]}

from fbjs.

cpojer avatar cpojer commented on May 3, 2024

I don't know how the xcode integration tests are being run but they need to manually ignore performanceNow for now, just like the jest preprocessor in react-native does. @balpert will be upgrading react-native to react 0.14 soon, so this issue will go away. Also cc @ide in case he knows anything about circleci setup.

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.