Skip to content
This repository was archived by the owner on Nov 17, 2022. It is now read-only.

docs(webpack): add custom application and activity section #1254

Merged
merged 4 commits into from
Jul 17, 2018

Conversation

vchimev
Copy link
Contributor

@vchimev vchimev commented Jul 10, 2018

PR Checklist

What is the new state of the documentation article?

Add custom application and activity configuration information.

Describes NativeScript/nativescript-dev-webpack#564 (comment).

Copy link
Contributor

@etabakov etabakov left a comment

Choose a reason for hiding this comment

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

Some minor issues ...


### Extend Android Application

If your project extends android application, it should be added as an [entry](https://github.com/NativeScript/nativescript-dev-webpack/blob/master/demo/AngularApp/webpack.config.js#L71) to the `webpack.config.js` file.
Copy link
Contributor

Choose a reason for hiding this comment

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

  • "extends android application" should be "extends an Android application"


In this way, the source code of [`application.android.ts`](https://github.com/NativeScript/nativescript-dev-webpack/blob/master/demo/AngularApp/app/application.android.ts) is bundled separately as `application.js` file which is loaded from the native `Application.java` class on launch.

The `application.js` bundle file is independent of the `bundle.js` and `vendor.js` files and the reason for it is that they are not loaded so early in the application launch. That's why the logic in `application.android.ts` is needed to be bundled separately in order to be loaded by the native `Application.java` as early as needed on launch.
Copy link
Contributor

Choose a reason for hiding this comment

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

  • "the reason for it" would sound better as "the reason for this/that"


### Extend Android Activity

If your project extends android activity, it should be added to the [`appComponents`](https://github.com/NativeScript/nativescript-dev-webpack/blob/master/demo/AngularApp/webpack.config.js#L19) array by an absolute path.
Copy link
Contributor

Choose a reason for hiding this comment

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

  • again "extends an Android activity"

];
```

In this way and With the default config, these components [get](https://github.com/NativeScript/nativescript-dev-webpack/blob/master/demo/AngularApp/webpack.config.js#L109-L116) in the common *vendor.js* chunk and are required by the [`android-app-comopnents-loader`](https://github.com/NativeScript/nativescript-dev-webpack/blob/master/demo/AngularApp/webpack.config.js#L146-L149).
Copy link
Contributor

Choose a reason for hiding this comment

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

  • not sure why "With" is capitalized
  • a typo in "android-app-comopnents-loader"

@vchimev vchimev requested review from sis0k0 and NickIliev July 16, 2018 11:36
Copy link
Contributor

@sis0k0 sis0k0 left a comment

Choose a reason for hiding this comment

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

I think these sections should be part of the docs article for extending application and activity. The webpack article can link to the sections in the other article.

vchimev added 2 commits July 17, 2018 09:44
Move custom application and activity webpack configuration information to the `extend-application-activity.md` article.
@vchimev vchimev merged commit 14224dd into master Jul 17, 2018
@vchimev vchimev deleted the vchimev/extend branch July 17, 2018 15:44
@lock
Copy link

lock bot commented Aug 26, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Aug 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants