planetfederal / sdk-apps

Base template for boundless sdk
Apache License 2.0
13 stars 14 forks source link

can we use npm link to link to sdk? #6

Closed bartvde closed 8 years ago

bartvde commented 8 years ago

https://docs.npmjs.com/cli/link

bartvde commented 8 years ago

I'm failing to understand when using this, a directory named sdk is copied in the app folder and the app behaves differently

bartvde commented 8 years ago

ah that dir contains the i18n messages

bartvde commented 8 years ago

the invalid ref seems to point to toggle-btn

bartvde commented 8 years ago

see also: http://stackoverflow.com/questions/31822593/import-a-module-from-node-modules-with-babel-but-failed

bartvde commented 8 years ago

see: https://github.com/webpack/webpack/issues/985

bartvde commented 8 years ago

the same React error occurs if we don't explicitly depend on react in the app's package.json

Uncaught Error: Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).
bartvde commented 8 years ago

maybe it's similar to this: https://github.com/npm/npm/issues/5875

"Helpers use Peer Dependencies (in my case because some helpers are also required via browserify, where it's important not to duplicate dependencies)"

bartvde commented 8 years ago

http://stackoverflow.com/questions/27931982/how-do-i-prevent-browserify-from-including-multiple-versions-of-sub-dependencies

bartvde commented 8 years ago

hmm but dedupe does not work for links

bartvde commented 8 years ago

okay figured this out and added it to the README

last glitch is that the react-intl babel plugin creates an sdk directory outside of the messagesDir setting

Barts-MacBook-Air:tabbed bartvandeneijnden$ ls sdk/js/components/
AddLayer.json       FeatureTable.json   GeocodingResults.json   HomeButton.json     LayerListItem.json  QGISLegend.json     QueryBuilder.json
Chart.json      Geocoding.json      Geolocation.json    ImageExport.json    Measure.json        QGISPrint.json      Select.son
bartvde commented 8 years ago

Filed as: https://github.com/yahoo/babel-plugin-react-intl/issues/23

Just going to resolve it with a .gitignore until it's fixed

bartvde commented 8 years ago

https://github.com/boundlessgeo/sdk-apps/commit/de640a90d9a7ab9b801e85246a28421ad1937b4d