Skip to content
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

remove duplicate plugins data #5563

Merged
merged 2 commits into from
Aug 23, 2021
Merged

remove duplicate plugins data #5563

merged 2 commits into from
Aug 23, 2021

Conversation

farfromrefug
Copy link
Contributor

This happens when multiple deps have another common dependencies.
This fix has one direct consequences which makes app build faster.
Before this native plugins where built multiple times.
As an example for this app using my material components.
Before this commit :

pluginsData 37 [
  '@nativescript-community/css-theme',
  '@nativescript-community/text',
  '@nativescript-community/ui-material-activityindicator',
  '@nativescript-community/ui-material-bottom-navigation',
  '@nativescript-community/ui-material-bottomnavigationbar',
  '@nativescript-community/ui-material-bottomsheet',
  '@nativescript-community/ui-material-button',
  '@nativescript-community/ui-material-cardview',
  '@nativescript-community/ui-material-core',
  '@nativescript-community/ui-material-dialogs',
  '@nativescript-community/ui-material-floatingactionbutton',
  '@nativescript-community/ui-material-progress',
  '@nativescript-community/ui-material-ripple',
  '@nativescript-community/ui-material-slider',
  '@nativescript-community/ui-material-snackbar',
  '@nativescript-community/ui-material-speeddial',
  '@nativescript-community/ui-material-tabs',
  '@nativescript-community/ui-material-textfield',
  '@nativescript-community/ui-material-textview',
  '@nativescript/core',
  '@nativescript/iqkeyboardmanager',
  '@nativescript/theme',
  'nativescript-vue',
  '@nativescript-community/ui-material-core',
  '@nativescript-community/ui-material-core',
  '@nativescript-community/ui-material-core',
  '@nativescript-community/ui-material-core',
  '@nativescript-community/text',
  '@nativescript-community/ui-material-core',
  '@nativescript-community/ui-material-core',
  '@nativescript-community/ui-material-core',
  '@nativescript-community/ui-material-textfield',
  '@nativescript-community/ui-material-core',
  '@nativescript-community/ui-material-core',
  '@nativescript-community/text',
  '@nativescript-community/ui-material-core',
  '@nativescript-community/text'
]

After this plugin:

pluginsData 23 [
  '@nativescript-community/css-theme',
  '@nativescript-community/text',
  '@nativescript-community/ui-material-activityindicator',
  '@nativescript-community/ui-material-bottom-navigation',
  '@nativescript-community/ui-material-bottomnavigationbar',
  '@nativescript-community/ui-material-bottomsheet',
  '@nativescript-community/ui-material-button',
  '@nativescript-community/ui-material-cardview',
  '@nativescript-community/ui-material-core',
  '@nativescript-community/ui-material-dialogs',
  '@nativescript-community/ui-material-floatingactionbutton',
  '@nativescript-community/ui-material-progress',
  '@nativescript-community/ui-material-ripple',
  '@nativescript-community/ui-material-slider',
  '@nativescript-community/ui-material-snackbar',
  '@nativescript-community/ui-material-speeddial',
  '@nativescript-community/ui-material-tabs',
  '@nativescript-community/ui-material-textfield',
  '@nativescript-community/ui-material-textview',
  '@nativescript/core',
  '@nativescript/iqkeyboardmanager',
  '@nativescript/theme',
  'nativescript-vue'
]

It means the native build of the app plugins got reduced by 60%

PR Checklist

What is the current behavior?

What is the new behavior?

Fixes/Implements/Closes #[Issue Number].

This happens when multiple deps have another common dependencies.
This fix has one direct consequences which makes app build faster. 
Before this native plugins where built multiple times.
As an example for [this](https://github.com/nativescript-community/ui-material-components/tree/master/demo-vue) app using my material components.
Before this commit :
```js
pluginsData 37 [
  '@nativescript-community/css-theme',
  '@nativescript-community/text',
  '@nativescript-community/ui-material-activityindicator',
  '@nativescript-community/ui-material-bottom-navigation',
  '@nativescript-community/ui-material-bottomnavigationbar',
  '@nativescript-community/ui-material-bottomsheet',
  '@nativescript-community/ui-material-button',
  '@nativescript-community/ui-material-cardview',
  '@nativescript-community/ui-material-core',
  '@nativescript-community/ui-material-dialogs',
  '@nativescript-community/ui-material-floatingactionbutton',
  '@nativescript-community/ui-material-progress',
  '@nativescript-community/ui-material-ripple',
  '@nativescript-community/ui-material-slider',
  '@nativescript-community/ui-material-snackbar',
  '@nativescript-community/ui-material-speeddial',
  '@nativescript-community/ui-material-tabs',
  '@nativescript-community/ui-material-textfield',
  '@nativescript-community/ui-material-textview',
  '@nativescript/core',
  '@nativescript/iqkeyboardmanager',
  '@nativescript/theme',
  'nativescript-vue',
  '@nativescript-community/ui-material-core',
  '@nativescript-community/ui-material-core',
  '@nativescript-community/ui-material-core',
  '@nativescript-community/ui-material-core',
  '@nativescript-community/text',
  '@nativescript-community/ui-material-core',
  '@nativescript-community/ui-material-core',
  '@nativescript-community/ui-material-core',
  '@nativescript-community/ui-material-textfield',
  '@nativescript-community/ui-material-core',
  '@nativescript-community/ui-material-core',
  '@nativescript-community/text',
  '@nativescript-community/ui-material-core',
  '@nativescript-community/text'
]
```
After this plugin:
```js
pluginsData 23 [
  '@nativescript-community/css-theme',
  '@nativescript-community/text',
  '@nativescript-community/ui-material-activityindicator',
  '@nativescript-community/ui-material-bottom-navigation',
  '@nativescript-community/ui-material-bottomnavigationbar',
  '@nativescript-community/ui-material-bottomsheet',
  '@nativescript-community/ui-material-button',
  '@nativescript-community/ui-material-cardview',
  '@nativescript-community/ui-material-core',
  '@nativescript-community/ui-material-dialogs',
  '@nativescript-community/ui-material-floatingactionbutton',
  '@nativescript-community/ui-material-progress',
  '@nativescript-community/ui-material-ripple',
  '@nativescript-community/ui-material-slider',
  '@nativescript-community/ui-material-snackbar',
  '@nativescript-community/ui-material-speeddial',
  '@nativescript-community/ui-material-tabs',
  '@nativescript-community/ui-material-textfield',
  '@nativescript-community/ui-material-textview',
  '@nativescript/core',
  '@nativescript/iqkeyboardmanager',
  '@nativescript/theme',
  'nativescript-vue'
]
```
It means the native build of the app plugins  got reduced by 60%
@cla-bot cla-bot bot added the cla: yes label Aug 19, 2021
@rigor789 rigor789 merged commit 7d80902 into NativeScript:master Aug 23, 2021
@farfromrefug farfromrefug deleted the patch-6 branch August 23, 2021 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants