mjmeintjes / boot-react-native

Better development experience with ClojureScript and React Native
117 stars 14 forks source link

Re-enable sourcemaps #58

Open pesterhazy opened 8 years ago

pesterhazy commented 8 years ago

In https://github.com/pesterhazy/boot-react-native/tree/develop, source maps seem to be broken. Anytime there's an exception, I get a message in the logs:

[6:27:58 PM] <END>   symbolicate (1140ms)
Error: Found a source and line, but no column
    at SourceMapConsumer_parseMappings [as _parseMappings] (/Users/pe/fy/boot-react-native/example/app/node_modules/source-map/lib/source-map/source-map-consumer.js:473:21)
    at SourceMapConsumer.Object.defineProperty.get (/Users/pe/fy/boot-react-native/example/app/node_modules/source-map/lib/source-map/source-map-consumer.js:72:14)
    at SourceMapConsumer_originalPositionFor [as originalPositionFor] (/Users/pe/fy/boot-react-native/example/app/node_modules/source-map/lib/source-map/source-map-consumer.js:599:13)
    at SourceMapConsumer.IndexedSourceMapConsumer_originalPositionFor [as originalPositionFor] (/Users/pe/fy/boot-react-native/example/app/node_modules/source-map/lib/source-map/source-map-consumer.js:932:31)
    at /Users/pe/fy/boot-react-native/example/app/node_modules/react-native/packager/react-packager/src/Server/index.js:481:37
    at Array.map (native)
    at /Users/pe/fy/boot-react-native/example/app/node_modules/react-native/packager/react-packager/src/Server/index.js:474:22
    at tryCallOne (/Users/pe/fy/boot-react-native/example/app/node_modules/promise/lib/core.js:37:12)
    at /Users/pe/fy/boot-react-native/example/app/node_modules/promise/lib/core.js:123:15
    at flush (/Users/pe/fy/boot-react-native/example/app/node_modules/asap/raw.js:50:29)

As a result I disabled cljs-rn-transformer.js in the branch temporarily, but it'd be nice to get it back.

pesterhazy commented 8 years ago

Also disabled sourcemap support in setup-links-for-dependency-map. The step of adding sourcemaps caused boot to recognize all files as changed (because of updated mtimes). For details, see https://github.com/mjmeintjes/boot-react-native/issues/57

To re-enable sourcemaps, we'll need to check if javascript file contents actually change before writing a new file to the tmp-dir, and only spit the file if it has updated

pesterhazy commented 8 years ago

Idea: when putting it back in, hide sourcemaps behind a feature flag so we can turn it off if it breaks things