-
Notifications
You must be signed in to change notification settings - Fork 6
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
Way to keep sdk5 and 4 branches in sync? #22
Comments
I'm thinking we could scratch using branches and have it all in one branch. Packages could be built conditionally, based on the build targets in package.json. I'm already doing something similar with version (to see version from package.json at runtime), using "prebuild" npm hook: Line 33 in 2001187
We could have an npm script, something like build-all-targets, which would replace the buildTargets in package.json, then make the buildTargets visible for the app, which could load modules (like UiManager) conditionally based on buildTargets. It will then call build, then again replace buildTargets for the second SDK version and build again. We'd probably need to also rename the resulting package so as not to overwrite it by the second build. This would probably prevent treeshaking of the unused modules (?) but I think we're talking a few kBs max. I'm not sure how the build tool handles when there's both widgets.gui & widget.defs, index.gui & index.view in the project at the same time but I guess it could be okay. |
We will need to define an interface however for the modules that will be different for different SDK levels. |
Yeah, I'm not a huge expert of the npm and package.json world, so I was imagining something like a pre-hook that does the thing. What I'm not sure how to handle is the fact that the package.json should contain different supported models, that should be instead a template. Could the package.json use an |
I'm not familiar with I'm not sure whether it could work from the |
I mean a |
Understand. Simple to do with some bash-fu. |
Damn, this wouldn't work - we'd need to have @fitbit/sdk in two versions at the same time, which I don't think is possible. I don't think we can build a v4 app with SDKv5 |
I just had a stream of consciousness at the fitbit discord, copying it here for reference as I think the build could be done this way: artaudToday at 11:26 |
Yeah, not really much different from having a build system that prepares the files first, but that seems something useful to have indeed :) |
There are some differences in the UI, but the backend can stay the same...
So not sure if we can use a git submodule, or probably we can even share the whole codebase, but use two different
uiManager
and stylesheet files.The only problem that would happen is having a way to dynamically set the
buildTargets
, and not sure how we can do it.The text was updated successfully, but these errors were encountered: