Skip to content

[Bridge] Pass __fbBatchedBridgeConfig into the bundle instead of making it global #62

Closed
@ide

Description

@ide

This is to reduce globals and encourage scoping. A specific approach I have in mind is to make the bundle produce a function that takes the bridge config as an argument:

(function(batchedBridgeConfig) {
// current bundle code here
});
// source map stuff

And when setting up ReactKit:

// get the js context from the executor -- API for this needs to be thought out
[[context evaluateScript:bundleScriptString] invokeWithArguments:@[configObject]]

Then the global goes away and you don't need -[RCTJavaScriptExecutor injectJSONText:asGlobalObjectNamed:callback:] either!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions