Skip to content

Conversation

zashraf1985
Copy link
Collaborator

@zashraf1985 zashraf1985 commented Aug 3, 2020

Summary

Javascript SDK uses released versions of sub packages. This makes it difficult to work on features that need to change multiple sub packages. This PR consolidates all the sub packages to use local versions of each other. Additionally, we are also mobing React-SDK to this repo and make it dependent on the local version of Javascript-SDK.

Test plan

  • All the existing Unit tests should pass
  • All the existing FSC tests should pass

@zashraf1985 zashraf1985 changed the title refactor: Move React SDK to this repo and vonsolidate Javascript SDK packages to depend on local versions of each other refactor: Move React SDK to this repo and consolidate Javascript SDK packages to depend on local versions of each other Aug 4, 2020
Comment on lines 44 to 47
"@optimizely/js-sdk-datafile-manager": "file:../datafile-manager/optimizely-js-sdk-datafile-manager-0.7.0.tgz",
"@optimizely/js-sdk-event-processor": "file:../event-processor/optimizely-js-sdk-event-processor-0.6.0.tgz",
"@optimizely/js-sdk-logging": "file:../logging/optimizely-js-sdk-logging-0.1.0.tgz",
"@optimizely/js-sdk-utils": "file:../utils/optimizely-js-sdk-utils-0.4.0.tgz",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we reference the folders instead of adding packed archives.

@zashraf1985
Copy link
Collaborator Author

Instead of re-organizaing and moving packages. i am thinking along these lines.

  1. Keep the package structure of this repo as it is. Just change the references / dependencies to include event-processor, datafile-manager, logging and utils through relative path. Please do not use npm pack, simply refer to the folder path of the package in dependencies.
  2. Make build through lerna from root. This means running npm run build on the root folder should build all the packages in the sub folders.
  3. In react-sdk, instead of moving contents of react-sdk, simply add this repo as sub module and then use local copy of javascript SDK there as a dependency instead of released version.

@zashraf1985
Copy link
Collaborator Author

Looks Great!. Here are a few additional things to do,

  1. You have changed the dependencies in optimizely-sdk to relative paths which is correct. This also needs to be done in other packages. I believe all the other packages at least use utils and probably logging too. can you update those to relative paths too.
  2. Git Submodule should not be used in this repo. We should keep react SDK in its own repo and use git sub module there to include commit from javascript master and refer locally. Which means you should fork the react-sdk repo just like you did this one, add a branch, add javascript-sdk as submodule and refer it locally.
  3. When you did npm install, did it change the package-lock.json files? if yes, then please commit those too.

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

Successfully merging this pull request may close these issues.

1 participant