Skip to content

Commit

Permalink
Enable hooks by default for FB React Native renderer (#14435)
Browse files Browse the repository at this point in the history
* Enable hooks by default for FB React Native renderer
* Updated RN+FB feature flags to make some of the dynamic ones static
  • Loading branch information
bvaughn authored Dec 13, 2018
1 parent 7325ebe commit 2743fb7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
14 changes: 6 additions & 8 deletions packages/shared/forks/ReactFeatureFlags.native-fb.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,21 @@ import typeof * as FeatureFlagsType from 'shared/ReactFeatureFlags';
import typeof * as FeatureFlagsShimType from './ReactFeatureFlags.native-fb';

// Re-export dynamic flags from the fbsource version.
export const {
enableHooks,
debugRenderPhaseSideEffects,
debugRenderPhaseSideEffectsForStrictMode,
warnAboutDeprecatedLifecycles,
replayFailedUnitOfWorkWithInvokeGuardedCallback,
disableInputAttributeSyncing,
} = require('ReactFeatureFlags');
export const {debugRenderPhaseSideEffects} = require('ReactFeatureFlags');

// The rest of the flags are static for better dead code elimination.
export const enableHooks = true;
export const enableUserTimingAPI = __DEV__;
export const enableProfilerTimer = __PROFILE__;
export const enableSchedulerTracing = __PROFILE__;
export const enableSuspenseServerRenderer = false;
export const enableStableConcurrentModeAPIs = false;
export const warnAboutShorthandPropertyCollision = false;
export const enableSchedulerDebugging = false;
export const debugRenderPhaseSideEffectsForStrictMode = true;
export const disableInputAttributeSyncing = false;
export const replayFailedUnitOfWorkWithInvokeGuardedCallback = __DEV__;
export const warnAboutDeprecatedLifecycles = true;

// Only used in www builds.
export function addUserTimingListener() {
Expand Down
2 changes: 0 additions & 2 deletions scripts/rollup/shims/react-native-fb/ReactFeatureFlags.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

const ReactFeatureFlags = {
debugRenderPhaseSideEffects: false,
debugRenderPhaseSideEffectsForStrictMode: false,
warnAboutDeprecatedLifecycles: true,
};

module.exports = ReactFeatureFlags;

0 comments on commit 2743fb7

Please sign in to comment.