Skip to content

Separate prepare of JavaScript from preparation of native code #2968

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

Closed
rosen-vladimirov opened this issue Jul 11, 2017 · 0 comments
Closed
Assignees
Labels
Milestone

Comments

@rosen-vladimirov
Copy link
Contributor

Currently the prepare of a project includes the following:

  • prepare files from <projectDir>/app directory - i.e. copies them to <project dir>/platforms/... and renames the platform specific ones. For example in case you have app.android.js and the project is prepared for android, you should have app.js in the <project_dir>/platforms/android/src/main/assets/app directory.
  • prepares .js files from plugins - each package, defined as a dependency, has .js files that should be included in the final project. During project preparation they are copied to <project dir>/platforms/... directory and the platform specific ones are processed (similar to the files in app dir).
  • prepares the App_Resources of a project - the files from <project dir>/app/App_Resources/<platform> should be placed on a specific location in <project dir>/platforms... directory. Whenever they are changed, CLI should rebuild the application.
  • prepares the native part of plugins - each dependency in node_modules might have a native code in <plugins dir>/platforms/<platform>. During project preparation the native part is processed and added to a specified location in the project inside <project dir>/platforms/.... NOTE: For iOS we do not copy all of the native files, we just update the references in the native project inside <project dir>/platforms/ios/....
  • In cases where the native part of plugins is modified, CLI calls clean of the native resources (i.e. gradle clean ).

The idea is to split the prepare on two steps:

  1. Prepare .js resources - this prepare will not require the local environment to be setup for specific platform.
  2. Prepare native resource - App_Resources, native part of plugins, calling clean of resources - this part will require local setup for specified platform.

Once we split the operations, we'll be able to use different ways of preparing the .js files, for example in some cases we may want to use webpack.

The other benefit is to split the operations between CLI and native project builder, i.e. gradle, Xcode. More information is available here

NOTE: Current command and prepare method should be kept. We just need to update our internal logic to be separated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants