Mechazawa / minidrone-js

🚁 Parrot Minidrone library
https://minidrone.js.org
MIT License
31 stars 6 forks source link

Implement lazy loading for xml files #4

Closed Mechazawa closed 6 years ago

Mechazawa commented 6 years ago

https://github.com/Mechazawa/minidrone-js/blob/624834c38a6440f34a0708db56de690845e0f9ea/src/CommandParser.js#L42-L52

Currently they are just bundled.

vvo commented 6 years ago

What's wrong with this approach do you think? require is always done only once, then it's cached

Mechazawa commented 6 years ago

Currently I just bundle the xml files instead of using the xml spec repo as a yarn dependency. If I do it that way then I'll be sure that I support every firmware version as long as they update the xml spec.

vvo commented 6 years ago

Per reading https://github.com/Mechazawa/minidrone-js/blob/6ea7a12a55118cc1baf4c98f38b034ea3622447d/package.json#L10 I thought you were directly declaring the dependency from a git repo, the reading the xml files. Which seems to be what you want to do.

Ultimately I would even tie the dependency to a specific git SHA, so that if they completely update their sdk, your library won't break.. wdyt?

Mechazawa commented 6 years ago

I don't think they'd change their XML specification over-night. So I'm not that worried about that. Would be a good idea to tie it to a SHA or commit hash to ensure that we have more control over the xml spec versioning.

vvo commented 6 years ago

👍