-
Notifications
You must be signed in to change notification settings - Fork 2k
更新負荷低減のために未使用ライブラリを整理する #5237
Comments
|
|
|
|
|
@tokyo-citizen まとめありがとうございます。 出典はこちらです。 #5061 の修正の目的は、
ですので、我々としては |
まとめありがとうございます!助かります 🙏
jestでやるかどうかは別として、自動テストは導入したいのですよね... |
jestの要否に関連するネタという理屈でここに付けます。 @kaizumaki ざっと読みながら、なんか似たネタのOpen Issueを垣間見たぞと思い出したので以下も参考として。
|
@tokyo-citizen リファレンスありがとうございます。 本題の「jestが必要かどうか」ですが、「必要そうだけどもテスト導入時に周辺ライブラリも含めて改めて検討」でよいような気がします。 |
@kaizumaki |
@goki90210 さんが挙げていたdependenciesとdevDependenciesのカテゴリ整理が残っていました。 カテゴリ整理について情報お持ちしております! |
さらに @shgtkshruch さんが挙げていた直接依存していないライブラリも こちらについても情報お待ちしております! |
公式ドキュメントにもあるとおり、Vue と Vue Meta は Nuxt.js に含まれています。
また TypeScript と ts-loader は Nuxt.js などのフレームワークを採用することのメリットの 1つは、ライブラリの管理や汎用的な処理を任せることで、プロジェクト固有の部分にリソースを割けることだと思います。 フレームワークに任せるよりも自分たちで管理したほうが保守性が上がる場合や新機能を使う場合は良いと思いますが、特別な理由がない限りフレームワークとプロジェクトで同じライブラリを二重管理するのはおすすめしません。 こちらにも書きましたがリソースやポリシーによるので、管理したい方がいらっしゃる場合はおまかせします 🙏 |
この点、私も同意です。それがエコシステムのいいところではないかと思っています。 そしてなにより保守の労力が軽減される方向に持っていきたいです。現在の体制(みなさんがご協力いただいている)がいつまでも続くとは限らないと思っているので...。 |
以下については、ドキュメントで明示的に指定されているのでdependenciesからdevDependenciesに |
ここまでをまとめると以下のようになります。
以下のように削除と移動を行った後でbuildやgenerateを行ってWebブラウザ(Safari)で tokyo-citizen@macos covid19 % node --version
v12.18.3
tokyo-citizen@macos covid19 % yarn --version
1.22.4
tokyo-citizen@macos covid19 % yarn remove @types/d3
tokyo-citizen@macos covid19 % yarn remove express
tokyo-citizen@macos covid19 % yarn remove vue
tokyo-citizen@macos covid19 % yarn remove vue-meta
tokyo-citizen@macos covid19 % yarn remove @vue/test-utils
tokyo-citizen@macos covid19 % yarn remove babel-jest
tokyo-citizen@macos covid19 % yarn remove jest
tokyo-citizen@macos covid19 % yarn remove nodemon
tokyo-citizen@macos covid19 % yarn remove rimraf
tokyo-citizen@macos covid19 % yarn remove ts-loader
tokyo-citizen@macos covid19 % yarn remove typescript
tokyo-citizen@macos covid19 % yarn remove vue-jest
tokyo-citizen@macos covid19 % grep \"@nuxtjs/dotenv\": package.json
"@nuxtjs/dotenv": "1.4.1",
tokyo-citizen@macos covid19 % yarn remove @nuxtjs/dotenv
tokyo-citizen@macos covid19 % yarn add -D @nuxtjs/[email protected]
tokyo-citizen@macos covid19 % grep \"axe-core\": package.json
"axe-core": "4.0.1",
tokyo-citizen@macos covid19 % yarn remove axe-core
tokyo-citizen@macos covid19 % yarn add -D [email protected]
tokyo-citizen@macos covid19 % grep \"cross-env\": package.json
"cross-env": "7.0.2",
tokyo-citizen@macos covid19 % yarn remove cross-env
tokyo-citizen@macos covid19 % yarn add -D [email protected] |
横道にそれますが、generateするときに、いつの日からか以下のエラーが出ているようです。 ERROR window is not defined 00:37:38
at a.setWidths (pages/index.js:23841:7)
at un.run (node_modules/vue/dist/vue.runtime.common.prod.js:6:27543)
at sn (node_modules/vue/dist/vue.runtime.common.prod.js:6:25554)
at Array.<anonymous> (node_modules/vue/dist/vue.runtime.common.prod.js:6:12260)
at Wt (node_modules/vue/dist/vue.runtime.common.prod.js:6:11661)
at runNextTicks (internal/process/task_queues.js:62:5)
at listOnTimeout (internal/timers.js:518:9)
at processTimers (internal/timers.js:492:7) どうもyarn.lockが腐っているようで、以下のようにして再生成したら解決したようです。 tokyo-citizen@macos covid19 % mv yarn.lock yarn.lock.bak
tokyo-citizen@macos covid19 % yarn install
tokyo-citizen@macos covid19 % diff -q yarn.lock.bak yarn.lock
Files yarn.lock.bak and yarn.lock differ
tokyo-citizen@macos covid19 % rm yarn.lock.bak
tokyo-citizen@macos covid19 % yarn build
tokyo-citizen@macos covid19 % yarn generate |
ライブラリ整理に伴う関連修正についてもまとめます。
|
こちら、実は本家 Vuetify に PR を上げたりしています。
|
@tokyo-citizen まとめありがとうございます!
ご提案の通りでいいのではないかと思いますが、みなさんいかがでしょう? |
私は、 再掲します。
理由はたとえフレームワーク側で依存しているからと言っても、 |
@goki90210 バレていると思いますが、私はJS/TSは全くもってド素人ですので、頓珍漢なことを言って tokyo-citizen@macos covid19 % egrep '(require\(|import.*from)' ./**/*.{js,ts,vue} | cut -d\' -f2 | sort -r | uniq
~/utils/monitoringStatusValueFormatters
~/components/ConfirmedCasesByMunicipalitiesTable.vue
vue/types/options
vue-spinner/src/ScaleLoader.vue
vue-scrollto
vue-meta
vue-i18n
vue-chartjs
vue-axe
vue
nuxt-i18n/types/nuxt-i18n
nuxt-i18n
dayjs/plugin/duration
dayjs/plugin/customParseFormat
dayjs
chart.js
axe-core/locales/ja.json
autoprefixer
@nuxt/types/app
@nuxt/types
@fullhuman/postcss-purgecss
@/utils/tab-event-bus.ts
@/utils/monitoringStatusValueFormatters
@/utils/i18nUtils
@/utils/formatTable
@/utils/formatMonitoringItems
@/utils/formatGraph
@/utils/formatDayBeforeRatio
@/utils/formatDate.ts
@/utils/formatDate
@/utils/formatConfirmedCases
@/utils/colors
@/utils/card-event-bus
@/static/selectmenu.svg
@/static/printer.svg
@/static/printer-white.svg
@/static/parent.svg
@/static/masktrash.svg
@/static/flow/phone.svg
@/static/flow/cond_sydr.svg
@/static/flow/cond_sy.svg
@/static/flow/cond_anx.svg
@/static/flow/bed.svg
@/static/earth.svg
@/static/covid.svg
@/static/antenna.svg
@/plugins/vue-chart
@/pages/flow.vue
@/data/tokyo_rule.json
@/data/tokyo_alert.json
@/data/positive_status.json
@/data/positive_rate.json
@/data/positive_by_diagnosed.json
@/data/positive_by_developed.json
@/data/patient.json
@/data/news.json
@/data/monitoring_items.json
@/data/metro.json
@/data/data.json
@/data/daily_positive_detail.json
@/data/consultation_about_fever.json
@/data/agency.json
@/components/cards/UntrackedRateCard.vue
@/components/cards/TokyoRulesApplicationNumberCard.vue
@/components/cards/TestedNumberCard.vue
@/components/cards/TelephoneAdvisoryReportsNumberCard.vue
@/components/cards/SevereCaseCard.vue
@/components/cards/PositiveRateCard.vue
@/components/cards/PositiveNumberByDiagnosedDateCard.vue
@/components/cards/PositiveNumberByDevelopedDateCard.vue
@/components/cards/MonitoringItemsOverviewCard.vue
@/components/cards/MonitoringConsultationDeskReportsNumberCard.vue
@/components/cards/MonitoringConfirmedCasesNumberCard.vue
@/components/cards/MetroCard.vue
@/components/cards/HospitalizedNumberCard.vue
@/components/cards/ConsultationAboutFeverNumberCard.vue
@/components/cards/ConfirmedCasesNumberCard.vue
@/components/cards/ConfirmedCasesDetailsCard.vue
@/components/cards/ConfirmedCasesByMunicipalitiesCard.vue
@/components/cards/ConfirmedCasesAttributesCard.vue
@/components/cards/CardRow.vue
@/components/cards/AgencyCard.vue
@/components/WhatsNew.vue
@/components/UntrackedRateMixedChart
@/components/TokyoAlertCard.vue
@/components/TimeStackedBarChart.vue
@/components/TimeBarChart.vue
@/components/StaticInfo.vue
@/components/StaticCard.vue
@/components/SiteTopUpper.vue
@/components/SideNavigation.vue
@/components/SevereCaseBarChart.vue
@/components/ScrollableChart.vue
@/components/PrinterButton.vue
@/components/PositiveRateMixedChart
@/components/PageHeader.vue
@/components/OpenDataLink.vue
@/components/NoScript.vue
@/components/MonitoringItemsOverviewTableValueWithTranslatableUnit.vue
@/components/MonitoringItemsOverviewTableMedicalSystem.vue
@/components/MonitoringItemsOverviewTableInfectionStatus.vue
@/components/MonitoringConsultationDeskReportChart.vue
@/components/MonitoringConfirmedCasesChart.vue
@/components/MonitoringCommentFrame.vue
@/components/MonitoringCommentCard.vue
@/components/MixedBarAndLineChart.vue
@/components/MetroBarChart.vue
@/components/MenuList.vue
@/components/LinkToInformationAboutEmergencyMeasure.vue
@/components/LanguageSelector.vue
@/components/ExternalLink.vue
@/components/DevelopmentModeMark.vue
@/components/DataViewShare.vue
@/components/DataViewExpantionPanel.vue
@/components/DataViewDataSetPanel.vue
@/components/DataViewCustomInfoPanel.vue
@/components/DataViewBasicInfoPanel.vue
@/components/DataView.vue
@/components/DataTable.vue
@/components/DataSelector.vue
@/components/DashedRectangleTimeBarChart.vue
@/components/ConfirmedCasesDetailsTable.vue
@/components/CardsReference.vue
@/components/CardsMonitoring.vue
@/components/AgencyBarChart.vue
@/components/ActiveTokyoAlert.vue
./nuxt-i18n.config
./chartjs-adapter-dayjs |
ここまでの検討で、 ちなみに、他の |
@goki90210 さんにコメント頂いた 過去の経緯を調べてみると、以下の趣旨で PR #4871 にて丁寧にご説明いただいたものでした。
|
@kaizumaki さん |
@tokyo-citizen まとめありがとうございます!助かります。 |
@kaizumaki さん Error:
Vue packages version mismatch:
- [email protected] (node_modules/vue/dist/vue.runtime.common.js)
- [email protected] (node_modules/vue-template-compiler/package.json)
This may cause things to work incorrectly. Make sure to use the same version for both.
If you are using vue-loader@>=10.0, simply update vue-template-compiler.
If you are using vue-loader@<10.0 or vueify, re-installing vue-loader/vueify should bump vue-template-compiler to the latest. |
@tokyo-citizen おっと、そのビルドエラーはRenovateのPR #5313 をマージすると解決しますか? |
@kaizumaki ちょっと前までは発生しなかったので、 |
@tokyo-citizen nuxtが依存しているvueのバージョンがまずいのでしょうか...? #5283 のマージあたりがあやしいですかね? |
@kaizumaki 今のところ GitHub Actions をみると、本番 deploy 等では |
@tokyo-citizen おお、情報ありがとうございます!しばらく様子をみますね。vueまわりのアップデートは注視しておきますね。 |
@tokyo-citizen Renovate関連でいろいろあった結果、 #5350 でyarn.lockをリフレッシュするに至りました。こちらのissueが進められるかなと思うのですが、どうですかね? |
こちらのissueは一旦クローズとします。 |
改善詳細 / Details of Improvement
package.json
にある未使用ライブラリが何かを整理します(分岐するのはよろしくないとのご意見があればはこのIssueはクローズ致します)
スクリーンショット / Screenshot
package.json
の変更履歴(参考)期待する見せ方・挙動 / Expected behavior
動作環境・ブラウザ / Environment
The text was updated successfully, but these errors were encountered: