Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear getting started documentation #60

Closed
kristianmandrup opened this issue Jan 25, 2017 · 16 comments
Closed

Unclear getting started documentation #60

kristianmandrup opened this issue Jan 25, 2017 · 16 comments

Comments

@kristianmandrup
Copy link

kristianmandrup commented Jan 25, 2017

"Go ahead and copy the files from the examples in your React Native app directory now."
Where exactly do I copy the examples files to? I assume I copy a directory from examples with all its files into the React app root folder created by react init ??
Please make this clearer in the docs and include a concrete example for setting up one of these example projects. Thanks!

@kristianmandrup
Copy link
Author

So I copied all the files from the Counter example into my ReactNative app folder, overwriting the index files for ios and android:

screenshot 2017-01-25 13 55 07

$ npm run compile

> Counter@0.0.1 precompile /Users/kristianmandrup/repos/elm-projs/MyAppName
> rm -f elm.js


> Counter@0.0.1 compile /Users/kristianmandrup/repos/elm-projs/MyAppName
> elm-make Main.elm --output elm.js

sh: elm-make: command not found

@dbanck
Copy link

dbanck commented Jan 25, 2017

Might be a silly question, but did you install Elm? Binaries like elm and elm-make should be in your $PATH.

Have a look at the Elm docs for how to install it.

@kristianmandrup
Copy link
Author

kristianmandrup commented Jan 25, 2017

I had it installed. But my elm installation was corrupted when I tried to update my node and npm using brew, so I had to reinstall node and elm from .pkg files. Now elm is working again.

But now is using Elm Platform 0.16, not sure this is compatible? Hate all this config stuff!!

14:08 $ elm-package install
Packages configured successfully!
✔ ~/repos/elm-projs/MyAppName 
14:10 $ npm run compile

> Counter@0.0.1 precompile /Users/kristianmandrup/repos/elm-projs/MyAppName
> rm -f elm.js


> Counter@0.0.1 compile /Users/kristianmandrup/repos/elm-projs/MyAppName
> elm-make Main.elm --output elm.js

Could not find package elm-lang/core.

Maybe your elm-stuff/ directory has been corrupted? You can usually fix stuff
like this by deleting elm-stuff/ and rebuilding your project.

@kristianmandrup
Copy link
Author

Now I installed elm 0.18 via npm i -g elm

@kristianmandrup
Copy link
Author

This is more like it!

$ elm-package install
Some new packages are needed. Here is the upgrade plan.

  Install:
    elm-lang/core 5.1.1
    elm-lang/html 2.0.0
    elm-lang/virtual-dom 2.0.4

Do you approve of this plan? [Y/n] Y
Starting downloads...

  ● elm-lang/html 2.0.0
  ● elm-lang/virtual-dom 2.0.4
  ● elm-lang/core 5.1.1

Packages configured successfully!

Now I get native package problems!?

 $ npm run compile

> Counter@0.0.1 precompile /Users/kristianmandrup/repos/elm-projs/MyAppName
> rm -f elm.js


> Counter@0.0.1 compile /Users/kristianmandrup/repos/elm-projs/MyAppName
> elm-make Main.elm --output elm.js

I cannot find module 'NativeUi'.

Module 'Main' is trying to import it.

Potential problems could be:
  * Misspelled the module name
  * Need to add a source directory or new dependency to elm-package.json

@kristianmandrup
Copy link
Author

If we could use Exponent (created by core team members of RN) with Elm it would make this path much easier as per #59

@cem2ran
Copy link

cem2ran commented Jan 25, 2017

Exponent wouldn't solve the above problem.

@dbanck
Copy link

dbanck commented Jan 25, 2017

To which path did you clone elm-native-ui to?
Have a look at the elm-package.json and modify this block:

    "source-directories": [
        ".",
        "../../src"
    ],

that ../../src matches the elm-native-ui/src folder.

@kristianmandrup
Copy link
Author

Thanks, will do. When I manage to get it working I will update the guide to include proper nOOb setup, config, install and run instructions ;)

@kristianmandrup
Copy link
Author

Also would love if one or more of you guys would help me out integrating with Expedient. Then I might create a project generator as well to avoid this manual config process.

@kristianmandrup
Copy link
Author

@dbanck Cool ;)

Changed it to:

    "source-directories": [
        ".",
        "../elm-native-ui/src"
    ],
$ npm run compile

> Counter@0.0.1 precompile /Users/kristianmandrup/repos/elm-projs/MyAppName
> rm -f elm.js


> Counter@0.0.1 compile /Users/kristianmandrup/repos/elm-projs/MyAppName
> elm-make Main.elm --output elm.js

Success! Compiled 43 modules.                                       
Successfully generated elm.js

@kristianmandrup
Copy link
Author

Now I'm not sure about this part:

Edit the `index.*.js` files' last lines in case your React Native app is not called 'MyAppName' at this point. You may also need to rename the project in the `package.json` file.

I copied the files from examples/Counter into MyAppName folder, so I have

AppRegistry.registerComponent('Counter', () => component); in index.ios.js, so in this case I rename it to: AppRegistry.registerComponent('MyAppName', () => component); ??

How do I use/install this elm_self_publish in my project? or do I install globally via pip? It is unclear!

We will then use elm_self_publish to publish the Elm Native UI package into our project.

Assuming we're in the parent directory where elm-native-ui reside:

$ python path/to/elm_self_publish.py ./elm-native-ui ./MyAppName

@kristianmandrup
Copy link
Author

I'm guessing I need to copy the raw code/file at https://raw.githubusercontent.com/NoRedInk/elm-ops-tooling/master/elm_self_publish.py ??

@kristianmandrup
Copy link
Author

Now I get error:

$ npm run compile

> Counter@0.0.1 precompile /Users/kristianmandrup/repos/elm-projs/MyAppName
> rm -f elm.js


> Counter@0.0.1 compile /Users/kristianmandrup/repos/elm-projs/MyAppName
> elm-make Main.elm --output elm.js

I found multiple modules named 'NativeUi'.

Module 'Main' is trying to import it.

Modules with that name were found in the following locations:

    directory ./../elm-native-ui/src/NativeUi.elm
    package ohanhi/elm-native-ui

Fuck! Someone please write a proper guide for how to get this shit running! :)
Thanks!

@ohanhi
Copy link
Owner

ohanhi commented Jan 26, 2017

I am sorry you are experiencing problems, but this is a very experimental technology. You are expected to get problems during development, too, and there will likely be no documentation at all concerning those issues. For now, I feel like the "Getting started" guide is clear enough for most people who are interested in contributing to this project. Those people are definitely the target group at the moment.

@ohanhi
Copy link
Owner

ohanhi commented Mar 23, 2017

Closing this now, after two months of inactivity. :)

@ohanhi ohanhi closed this as completed Mar 23, 2017
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

No branches or pull requests

4 participants