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

Refactor the codebase #8

Closed
2 tasks done
sindresorhus opened this issue Dec 8, 2016 · 4 comments
Closed
2 tasks done

Refactor the codebase #8

sindresorhus opened this issue Dec 8, 2016 · 4 comments
Assignees

Comments

@sindresorhus
Copy link
Member

sindresorhus commented Dec 8, 2016

From ac3dcc4#commitcomment-20097149:

  • Pass JSON to the Swift binary
  • Cleanup
@StefMa
Copy link

StefMa commented Jan 25, 2017

What do we have to do here exactly? 🤔

As I understood the commitcomment right we have two options for releasing a new npm-package:
-> Update the main and recorder swift so we haven't breaking changes
TODOS:
Create a new init for recorder with 6 params
Create a new init for main with 6 params
Update index.js if display.id missing, use main as display.id

-> Otherwise we can publish breaking changes.
Then we can leave everything like it is now but add a little bit more functionality.
TODOS:
Rename main to aperture
Make all parameters optional (and set default value to smth)
update params to using unix style like -option OPTIONforTHAToption -anotherOption...

Or am I wrong?

What do you mean with Pass JSON to Swift binary❓ 🤔

@sindresorhus
Copy link
Member Author

The Swift binary is an implementation detail and not exposed to users, so none of your proposed TODOS are necessary. The idea of passing JSON to the binary is to simplify the communication. Right now it's just using a bunch of arguments. We could switch to use proper CLI flags, but since it's not exposed anyways, it would be simpler to just send all the options from Node.js as JSON and parse the JSON into an options dictionary on the Swift side. That way we don't have to do much on the communication side when adding new options.

@sindresorhus
Copy link
Member Author

@LarsJK Do you know any better way we could use to communicate between Swift and Node.js? We'll eventually want two-way communication, so the current method is not going to be very optimal. Maybe something like https://www.npmjs.com/package/node-ipc ?

@LarsJK
Copy link

LarsJK commented Feb 7, 2017

Sorry I don't really have any experience with this.
node-ipc and something like https://github.com/swiftsocket/SwiftSocket could probably be an option though..

Dont know if this can be useful: https://realm.io/news/thomas-goyne-fast-inter-process-communication/

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

3 participants