Skip to content

Conversation

@Tug
Copy link
Contributor

@Tug Tug commented Dec 19, 2018

Addresses #398

This PR unregisters Code and More for the prod build.

Testing Instructions

  • Run locally using yarn start and yarn android or yarn ios and notice the Code and More blocks are visible
  • Run a Release build with node_modules/.bin/react-native run-ios --configuration Release and notice the Code and More blocks appear as unsupported blocks.

@Tug Tug self-assigned this Dec 19, 2018
@Tug Tug requested review from daniloercoli, koke and pinarol December 19, 2018 14:29
setUnregisteredTypeHandlerName( UnsupportedBlock.name );

// disable Code and More blocks for release
if ( ! __DEV__ ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does __DEV__ get set?

Copy link
Contributor Author

@Tug Tug Dec 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised by the fact that the react-native documentation only has a very succinct mention of this global variable.
Still though, it's provided by react-native to differentiate a development build from a release one.
I've updated the testing instructions :)

Copy link
Member

@koke koke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It took me a while to figure out how to test this in the app, but it works 🎉

@Tug Tug merged commit 8f22de9 into master Dec 19, 2018
@Tug Tug deleted the update/disable-code-more-blocks branch December 19, 2018 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants