Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Packager] RCTPOPAnimationManager.js - syntax error after conversion with babel #1526

Closed
johanneslumpe opened this issue Jun 5, 2015 · 11 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@johanneslumpe
Copy link
Contributor

In Libraries/BatchedBridge/BatchedBridgedModules/POPAnimation.js the following block is invalid after transpiling it with babel:

var RCTPOPAnimationManager = require('NativeModules').POPAnimationManager;
if (!RCTPOPAnimationManager) {
  // POP animation isn't available in the OSS fork - this is a temporary
  // workaround to enable its availability to be determined at runtime.
  // For Flow let's pretend like we always export POPAnimation
  // so all our users don't need to do null checks
  module.exports = ((null: any): typeof POPAnimation);
} else {
  /*...*/
}

It will turn to

'use strict';

var RCTPOPAnimationManager = require('NativeModules').POPAnimationManager;
if (!RCTPOPAnimationManager) {
  // POP animation isn't available in the OSS fork - this is a temporary
  // workaround to enable its availability to be determined at runtime.
  // For Flow let's pretend like we always export POPAnimation
  // so all our users don't need to do null checks
  module.exports = ;
} else {
  /* ... */
}

resulting in a syntax error because of the broken moule.exports assignment.

@brentvatne brentvatne changed the title RCTPOPAnimationManager.js - syntax error after conversion with babel [Packager] RCTPOPAnimationManager.js - syntax error after conversion with babel Jun 5, 2015
@brentvatne
Copy link
Collaborator

module.exports = ((null: any): typeof POPAnimation);

is this valid syntax or is the issue with the transformer?

@brentvatne
Copy link
Collaborator

Ran into this myself on facebook/react-native#8b93b9 installing from https://github.com/rnplay/rnplay-ios/tree/c97ebe51860abcc249a9cbbf754b3bc8e0ddaad0

@sebmck
Copy link
Contributor

sebmck commented Jun 7, 2015

Fixed via babel/babel@64f4209. This should have been reported on the babel/babel repo 😄

@brentvatne
Copy link
Collaborator

Thanks @sebmck!

@ide
Copy link
Contributor

ide commented Jun 8, 2015

@amasad looks like the next step is to upgrade babel

@sebmck
Copy link
Contributor

sebmck commented Jun 8, 2015

Why is the Babel version fixed 😨

@ide
Copy link
Contributor

ide commented Jun 8, 2015

I believe it has to do with how fb internally downloads npm packages. It'd be better for the external community for fb to use semver's caret in react-native's package.json, run npm shrinkwrap to generate npm-shrinkwrap.json to pin all dependencies for internal use, and then exclude npm-shrinkwrap.json from the external directory that is synced out to GitHub. cc @vjeux would this work for the team?

@amasad
Copy link
Contributor

amasad commented Jun 15, 2015

What @ide said re npm packages. Actually, since we are currently checking in the modules internal, I don't see any harm in unpinning the dependencies. Anyways, we want to update Babel anyways, to get the new perf wins.

@DmitrySoshnikov: I believe you were starting to update babel?

@amasad amasad removed their assignment Jun 15, 2015
@DmitrySoshnikov
Copy link
Contributor

@DmitrySoshnikov: I believe you were starting to update babel?

Yep.

@browniefed
Copy link
Contributor

Based on the docs Pop animation is no longer supported, deprecated in favor of Animated.
Not sure if we are concerned about the babel upgrade w/ POP no longer supported.
@brentvatne POP no longer supported.

@brentvatne
Copy link
Collaborator

Yeah, also we're not seeing this error anymore, thanks @browniefed

@facebook facebook locked as resolved and limited conversation to collaborators Jul 22, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

8 participants