-
Notifications
You must be signed in to change notification settings - Fork 57
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
task 6 #74
Open
SuperSus
wants to merge
1
commit into
hardcode-dev:master
Choose a base branch
from
SuperSus:task6
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
task 6 #74
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: CI | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build-app: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: js budget check | ||
uses: docker://sitespeedio/sitespeed.io:latest | ||
with: | ||
args: https://8b1b-2a02-a310-c25a-f500-a479-5be6-50d3-1088.ngrok.io -n 1 --budget.configPath ./budget.json | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"budget": { | ||
"transferSize": { | ||
"javascript": 670000 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
### SETUP | ||
|
||
добавил `webpack-bundle-analyzer` в devDependencies | ||
и включил плагин в процесс сборки (development.js) | ||
|
||
```js | ||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer') | ||
.BundleAnalyzerPlugin; | ||
environment.plugins.append( | ||
'BundleAnalyzer', | ||
new BundleAnalyzerPlugin({ | ||
analyzerMode: 'static', | ||
openAnalyzer: true, | ||
}), | ||
); | ||
``` | ||
|
||
выполнил анализ исходной версии | ||
 | ||
vendor.js -> 1.35mb | ||
|
||
запустил sitespeed.io | ||
|
||
```shell script | ||
docker run --privileged --rm -v "$(pwd)":/sitespeed.io sitespeedio/sitespeed.io http://host.docker.internal:3000/ -n 1 --budget.configPath budget.json | ||
``` | ||
|
||
проверка фейлится | ||
|
||
```shell script | ||
Failing budget JavaScript Transfer Size for http://host.docker.internal:3000/ with value 3.2 MB max limit 459.0 KB | ||
``` | ||
|
||
закомментировал proChart.js | ||
|
||
```shell script | ||
Failing budget JavaScript Transfer Size for http://host.docker.internal:3000/ with value 521.9 KB max limit 459.0 KB | ||
``` | ||
|
||
объем js сильно уменьшился но в бюджеты еще не влазит (но близко) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. со временем npm-пакеты разбухли наверно, раньше влезало |
||
|
||
раскомментировал proChart.js но убрал chart.js и moment.js из vendor.js (environment.js) | ||
|
||
```js | ||
environment.plugins.append( | ||
'CommonsChunkVendor', | ||
new webpack.optimize.CommonsChunkPlugin({ | ||
name: 'vendor', | ||
minChunks: module => { | ||
// this assumes your vendor imports exist in the node_modules directory | ||
return ( | ||
module.context && | ||
module.context.indexOf('node_modules') !== -1 && | ||
module.context.indexOf('moment') === -1 && | ||
module.context.indexOf('chart.js') === -1 | ||
); | ||
}, | ||
}), | ||
); | ||
``` | ||
|
||
 | ||
|
||
```shell script | ||
Failing budget JavaScript Transfer Size for http://host.docker.internal:3000/ with value 634.4 KB max limit 459.0 KB | ||
``` | ||
|
||
бюджет все еще фейлится, но такой результат меня устраивает, я подниу бюджет до 650kb | ||
|
||
добавил sitespeed проверку в контур ci | ||
|
||
```yaml | ||
name: CI | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build-app: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: js budget check | ||
uses: docker://sitespeedio/sitespeed.io:latest | ||
with: | ||
args: https://8b1b-2a02-a310-c25a-f500-a479-5be6-50d3-1088.ngrok.io -n 1 --budget.configPath ./budget.json | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Плюсую всё latest, github ci и ngrok 👍