Skip to content

Commit 2d22a9a

Browse files
committed
Merge branch 'development' into sabr-pr
* development: (21 commits) Replace vue-portal dependency with Vue's built-in <Teleport> component (FreeTubeApp#8207) Update to Vue 3 (FreeTubeApp#8094) Translated using Weblate (Basque) Translated using Weblate (Hungarian) Translated using Weblate (Icelandic) Translated using Weblate (Turkish) Properly fix CORS in PO token web views (FreeTubeApp#8203) Translated using Weblate (Italian) Translated using Weblate (Norwegian Bokmål) Translated using Weblate (French) Configure nedb to always clean up corrupted data (FreeTubeApp#8202) Translated using Weblate (Portuguese (Brazil)) Add video paused check to frame shortcuts (FreeTubeApp#8200) Fix toast with timeout 0 will be displayed for default 3s (FreeTubeApp#8168) Translated using Weblate (Chinese (Simplified Han script)) Change containing text input limit (FreeTubeApp#8174) Translated using Weblate (Dutch) Add support for AppImageUpdate (FreeTubeApp#8153) Added New Window option to Tray (FreeTubeApp#7995) Translated using Weblate (Japanese) ...
2 parents ce9d37d + 4c72a23 commit 2d22a9a

File tree

124 files changed

+787
-825
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+787
-825
lines changed

.github/workflows/release.yml

Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,19 +87,50 @@ jobs:
8787
if: contains(matrix.runtime, 'arm64')
8888
run: yarn run build:arm64
8989

90-
- name: Convert X64 AppImage to static runtime
90+
- name: Convert X64 AppImage to static runtime and add update information
9191
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-x64')
9292
run: |
9393
sudo apt install desktop-file-utils
9494
cd build
9595
appimage="FreeTube-${{ steps.getPackageInfo.outputs.version }}.AppImage"
9696
wget "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage" -O ./appimagetool.AppImage
9797
chmod +x ./"$appimage" ./appimagetool.AppImage
98+
update_information="gh-releases-zsync|FreeTubeApp|FreeTube|latest-all|freetube-*-amd64.AppImage.zsync"
9899
./"$appimage" --appimage-extract && rm -f ./"$appimage"
99100
./appimagetool.AppImage --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 20 \
100-
-n ./squashfs-root ./"$appimage"
101+
-u "$update_information" -n ./squashfs-root ./"$appimage"
101102
rm -rf ./squashfs-root ./appimagetool.AppImage
102103
104+
- name: Convert ARMv7l AppImage to static runtime and add update information
105+
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-armv7l')
106+
run: |
107+
sudo apt install desktop-file-utils
108+
cd build
109+
appimage="FreeTube-${{ steps.getPackageInfo.outputs.version }}.AppImage"
110+
wget "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage" -O ./appimagetool.AppImage
111+
wget "https://github.com/AppImage/type2-runtime/releases/download/continuous/runtime-x86_64" -O runtime
112+
chmod +x ./"$appimage" ./appimagetool.AppImage ./runtime
113+
update_information="gh-releases-zsync|FreeTubeApp|FreeTube|latest-all|freetube-*-armv7l.AppImage.zsync"
114+
TARGET_APPIMAGE=$appimage" ./runtime --appimage-extract && rm -f ./"$appimage"
115+
ARCH=armhf ./appimagetool.AppImage --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 20 \
116+
-u "$update_information" -n ./squashfs-root ./"$appimage"
117+
rm -rf ./squashfs-root ./appimagetool.AppImage ./runtime
118+
119+
- name: Convert ARM64 AppImage to static runtime and add update information
120+
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-arm64')
121+
run: |
122+
sudo apt install desktop-file-utils
123+
cd build
124+
appimage="FreeTube-${{ steps.getPackageInfo.outputs.version }}.AppImage"
125+
wget "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage" -O ./appimagetool.AppImage
126+
wget "https://github.com/AppImage/type2-runtime/releases/download/continuous/runtime-x86_64" -O runtime
127+
chmod +x ./"$appimage" ./appimagetool.AppImage ./runtime
128+
update_information="gh-releases-zsync|FreeTubeApp|FreeTube|latest-all|freetube-*-arm64.AppImage.zsync"
129+
TARGET_APPIMAGE=$appimage" ./runtime --appimage-extract && rm -f ./"$appimage"
130+
ARCH=aarch64 ./appimagetool.AppImage --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 20 \
131+
-u "$update_information" -n ./squashfs-root ./"$appimage"
132+
rm -rf ./squashfs-root ./appimagetool.AppImage ./runtime
133+
103134
- name: Upload Linux .zip x64 Release
104135
uses: actions/upload-release-asset@v1
105136
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-x64')
@@ -210,6 +241,17 @@ jobs:
210241
asset_path: build/FreeTube-${{ steps.getPackageInfo.outputs.version }}.AppImage
211242
asset_content_type: application/vnd.appimage
212243

244+
- name: Upload AppImage .zsync x64 Release
245+
uses: actions/upload-release-asset@v1
246+
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-x64')
247+
env:
248+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
249+
with:
250+
upload_url: https://uploads.github.com/repos/FreeTubeApp/FreeTube/releases/${{ inputs.releaseId }}/assets{?name,label}
251+
asset_name: freetube-${{ steps.getPackageInfo.outputs.version }}-beta-amd64.AppImage.zsync
252+
asset_path: build/FreeTube-${{ steps.getPackageInfo.outputs.version }}.AppImage.zsync
253+
asset_content_type: application/x-zsync
254+
213255
- name: Upload AppImage ARMv7l Release
214256
uses: actions/upload-release-asset@v1
215257
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-armv7l')
@@ -221,6 +263,17 @@ jobs:
221263
asset_path: build/FreeTube-${{ steps.getPackageInfo.outputs.version }}-armv7l.AppImage
222264
asset_content_type: application/vnd.appimage
223265

266+
- name: Upload AppImage .zsync ARMv7l Release
267+
uses: actions/upload-release-asset@v1
268+
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-armv7l')
269+
env:
270+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
271+
with:
272+
upload_url: https://uploads.github.com/repos/FreeTubeApp/FreeTube/releases/${{ inputs.releaseId }}/assets{?name,label}
273+
asset_name: freetube-${{ steps.getPackageInfo.outputs.version }}-beta-armv7l.AppImage.zsync
274+
asset_path: build/FreeTube-${{ steps.getPackageInfo.outputs.version }}-armv7l.AppImage.zsync
275+
asset_content_type: application/x-zsync
276+
224277
- name: Upload AppImage ARM64 Release
225278
uses: actions/upload-release-asset@v1
226279
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-arm64')
@@ -232,6 +285,17 @@ jobs:
232285
asset_path: build/FreeTube-${{ steps.getPackageInfo.outputs.version }}-arm64.AppImage
233286
asset_content_type: application/vnd.appimage
234287

288+
- name: Upload AppImage .zsync ARM64 Release
289+
uses: actions/upload-release-asset@v1
290+
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-arm64')
291+
env:
292+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
293+
with:
294+
upload_url: https://uploads.github.com/repos/FreeTubeApp/FreeTube/releases/${{ inputs.releaseId }}/assets{?name,label}
295+
asset_name: freetube-${{ steps.getPackageInfo.outputs.version }}-beta-arm64.AppImage.zsync
296+
asset_path: build/FreeTube-${{ steps.getPackageInfo.outputs.version }}-arm64.AppImage.zsync
297+
asset_content_type: application/x-zsync
298+
235299
- name: Upload Linux .rpm x64 Release
236300
uses: actions/upload-release-asset@v1
237301
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-x64')

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ Please follow these guidelines before sending your pull request and making contr
1616
* Stick to a similar style of code already in the project. Please look at current code to get an idea on how to do this.
1717
* Follow [ES6](https://rse.github.io/es6-features/) standards in your code. Ex: Use `let` and `const` instead of `var`. Do not use `function(response){//code}` for callbacks, use `(response) => {//code}`.
1818
* Comment your code when necessary. Follow the [JavaScript Documentation and Comments Standard](https://www.drupal.org/docs/develop/standards/javascript/javascript-api-documentation-and-comment-standards) for functions.
19-
* Please follow proper Vue structure when creating new code / components. Use existing code as well as the [Vue.js Guide](https://vuejs.org/v2/guide/) for reference.
19+
* Please follow proper Vue structure when creating new code / components. Use existing code as well as the [Vue.js Guide](https://vuejs.org/guide/introduction.html) for reference.
2020
* Please test your code. Make sure new features work as well as existing core features such as watching videos or loading subscriptions. New features need to work with both the Local API as well as the Invidious API
21-
* Please make sure your code does not violate any standards set by our linter. It's up to you to make fixes whenever necessary. You can run `npm run lint` to check locally and `npm run lint-fix` to automatically fix smaller issues.
21+
* Please make sure your code does not violate any standards set by our linter. It's up to you to make fixes whenever necessary. You can run `yarn run lint` to check locally and `yarn run lint-fix` to automatically fix smaller issues.
2222
* Please limit the amount of Node Modules that you introduce into the project. Only include them when **absolutely necessary** for your code to work (Ex: Using nedb for databases) or if a module provides similar functionality to what you are trying to achieve (Ex: Using autolinker to create links to outside URLs instead of writing the functionality myself).
2323
* Please try to stay involved with the community and maintain your code. We are only a handful of developers working on FreeTube in our spare time. We do not have time to work on everything, and it would be nice if you can maintain your code when necessary.
2424

_scripts/webpack.renderer.config.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const path = require('path')
22
const { readFileSync, readdirSync } = require('fs')
33
const webpack = require('webpack')
44
const HtmlWebpackPlugin = require('html-webpack-plugin')
5-
const VueLoaderPlugin = require('vue-loader/lib/plugin')
5+
const { VueLoaderPlugin } = require('vue-loader')
66
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
77
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin')
88
const ProcessLocalesPlugin = require('./ProcessLocalesPlugin')
@@ -56,7 +56,7 @@ const config = {
5656
loader: 'vue-loader',
5757
options: {
5858
compilerOptions: {
59-
whitespace: 'condense',
59+
isCustomElement: (tag) => tag === 'swiper-container' || tag === 'swiper-slide'
6060
}
6161
}
6262
},
@@ -133,6 +133,12 @@ const config = {
133133
'process.env.IS_ELECTRON': true,
134134
'process.env.IS_ELECTRON_MAIN': false,
135135
'process.env.SUPPORTS_LOCAL_API': true,
136+
__VUE_OPTIONS_API__: 'true',
137+
__VUE_PROD_DEVTOOLS__: 'false',
138+
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: 'false',
139+
__VUE_I18N_LEGACY_API__: 'true',
140+
__VUE_I18N_FULL_INSTALL__: 'false',
141+
__INTLIFY_PROD_DEVTOOLS__: 'false',
136142
'process.env.LOCALE_NAMES': JSON.stringify(processLocalesPlugin.localeNames),
137143
'process.env.GEOLOCATION_NAMES': JSON.stringify(readdirSync(path.join(__dirname, '..', 'static', 'geolocations')).map(filename => filename.replace('.json', ''))),
138144
'process.env.SWIPER_VERSION': `'${swiperVersion}'`,
@@ -180,9 +186,6 @@ const config = {
180186
],
181187
resolve: {
182188
alias: {
183-
vue$: 'vue/dist/vue.runtime.esm.js',
184-
'portal-vue$': 'portal-vue/dist/portal-vue.esm.js',
185-
186189
DB_HANDLERS_ELECTRON_RENDERER_OR_WEB$: path.resolve(__dirname, '../src/datastores/handlers/electron.js'),
187190

188191
'youtubei.js$': 'youtubei.js/web',

_scripts/webpack.web.config.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const path = require('path')
22
const fs = require('fs')
33
const webpack = require('webpack')
44
const HtmlWebpackPlugin = require('html-webpack-plugin')
5-
const VueLoaderPlugin = require('vue-loader/lib/plugin')
5+
const { VueLoaderPlugin } = require('vue-loader')
66
const CopyWebpackPlugin = require('copy-webpack-plugin')
77
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
88
const JsonMinimizerPlugin = require('json-minimizer-webpack-plugin')
@@ -46,7 +46,7 @@ const config = {
4646
loader: 'vue-loader',
4747
options: {
4848
compilerOptions: {
49-
whitespace: 'condense',
49+
isCustomElement: (tag) => tag === 'swiper-container' || tag === 'swiper-slide',
5050
}
5151
}
5252
},
@@ -129,6 +129,12 @@ const config = {
129129
'process.env.IS_ELECTRON': false,
130130
'process.env.IS_ELECTRON_MAIN': false,
131131
'process.env.SUPPORTS_LOCAL_API': false,
132+
__VUE_OPTIONS_API__: 'true',
133+
__VUE_PROD_DEVTOOLS__: 'false',
134+
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: 'false',
135+
__VUE_I18N_LEGACY_API__: 'true',
136+
__VUE_I18N_FULL_INSTALL__: 'false',
137+
__INTLIFY_PROD_DEVTOOLS__: 'false',
132138
'process.env.SWIPER_VERSION': `'${swiperVersion}'`
133139
}),
134140
new webpack.ProvidePlugin({
@@ -159,9 +165,6 @@ const config = {
159165
],
160166
resolve: {
161167
alias: {
162-
vue$: 'vue/dist/vue.runtime.esm.js',
163-
'portal-vue$': 'portal-vue/dist/portal-vue.esm.js',
164-
165168
DB_HANDLERS_ELECTRON_RENDERER_OR_WEB$: path.resolve(__dirname, '../src/datastores/handlers/web.js'),
166169

167170
// change to "shaka-player.ui.debug.js" to get debug logs (update jsconfig to get updated types)

eslint.config.mjs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ export default [
3333
ts: false,
3434
}),
3535
js.configs.recommended,
36-
...eslintPluginVue.configs['flat/vue2-recommended'],
36+
...eslintPluginVue.configs['flat/recommended'],
3737
...vuejsAccessibility.configs["flat/recommended"],
38-
...intlifyVueI18N.configs['flat/recommended'],
38+
...intlifyVueI18N.configs['recommended'],
3939
{
4040
files: [
4141
'**/*.{js,vue}',
@@ -63,7 +63,7 @@ export default [
6363
settings: {
6464
'vue-i18n': {
6565
localeDir: `./static/locales/{${activeLocales.join(',')}}.yaml`,
66-
messageSyntaxVersion: '^8.0.0',
66+
messageSyntaxVersion: '^11.0.0',
6767
},
6868
},
6969

@@ -79,7 +79,6 @@ export default [
7979
'no-unused-vars': 'warn',
8080
'no-undef': 'warn',
8181
'object-shorthand': 'off',
82-
'vue/no-template-key': 'warn',
8382
'vue/multi-word-component-names': 'off',
8483

8584
'vuejs-accessibility/label-has-for': ['error', {
@@ -119,8 +118,6 @@ export default [
119118
ignoreText: ['-', '•', '/', 'YouTube', 'Invidious', 'FreeTube'],
120119
}],
121120

122-
'@intlify/vue-i18n/no-deprecated-tc': 'off',
123-
'vue/require-explicit-emits': 'error',
124121
'vue/no-unused-emit-declarations': 'error',
125122

126123
'jsdoc/check-alignment': 'error',
@@ -166,7 +163,7 @@ export default [
166163
settings: {
167164
'vue-i18n': {
168165
localeDir: `./static/locales/{${activeLocales.join(',')}}.yaml`,
169-
messageSyntaxVersion: '^8.0.0',
166+
messageSyntaxVersion: '^11.0.0',
170167
},
171168
},
172169
},
@@ -191,7 +188,7 @@ export default [
191188
settings: {
192189
'vue-i18n': {
193190
localeDir: `./static/locales/{${activeLocales.join(',')}}.yaml`,
194-
messageSyntaxVersion: '^8.0.0',
191+
messageSyntaxVersion: '^11.0.0',
195192
},
196193
},
197194
},
@@ -210,7 +207,7 @@ export default [
210207
settings: {
211208
'vue-i18n': {
212209
localeDir: `./static/locales/{${activeLocales.join(',')}}.yaml`,
213-
messageSyntaxVersion: '^8.0.0',
210+
messageSyntaxVersion: '^11.0.0',
214211
},
215212
},
216213
},

jsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"vueCompilerOptions": {
3-
"target": 2.7
3+
"target": 3.5
44
},
55
"compilerOptions": {
66
"module": "esnext",

package.json

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,30 +58,29 @@
5858
"@fortawesome/free-brands-svg-icons": "^6.7.2",
5959
"@fortawesome/free-regular-svg-icons": "^6.7.2",
6060
"@fortawesome/free-solid-svg-icons": "^6.7.2",
61-
"@fortawesome/vue-fontawesome": "^2.0.10",
61+
"@fortawesome/vue-fontawesome": "^3.0.8",
6262
"@seald-io/nedb": "^4.1.2",
6363
"autolinker": "^4.1.5",
6464
"bgutils-js": "^3.2.0",
6565
"electron-context-menu": "^4.1.1",
6666
"googlevideo": "^4.0.4",
6767
"marked": "^16.4.1",
68-
"portal-vue": "^2.1.7",
6968
"process": "^0.11.10",
7069
"shaka-player": "^4.16.6",
7170
"swiper": "^12.0.3",
72-
"vue": "^2.7.16",
73-
"vue-i18n": "^8.28.2",
74-
"vue-observe-visibility": "^1.0.0",
75-
"vue-router": "^3.6.5",
76-
"vuex": "^3.6.2",
71+
"vue": "^3.5.22",
72+
"vue-i18n": "^11.1.12",
73+
"vue-observe-visibility": "^2.0.0-alpha.1",
74+
"vue-router": "^4.6.3",
75+
"vuex": "^4.1.0",
7776
"youtubei.js": "^16.0.1"
7877
},
7978
"devDependencies": {
8079
"@babel/core": "^7.28.5",
8180
"@babel/preset-env": "^7.28.5",
8281
"@double-great/stylelint-a11y": "^3.4.0",
8382
"@eslint/js": "^9.38.0",
84-
"@intlify/eslint-plugin-vue-i18n": "^3.2.0",
83+
"@intlify/eslint-plugin-vue-i18n": "^4.1.0",
8584
"babel-loader": "^10.0.0",
8685
"copy-webpack-plugin": "^13.0.1",
8786
"css-loader": "^7.1.2",
@@ -113,9 +112,8 @@
113112
"stylelint-high-performance-animation": "^1.11.0",
114113
"stylelint-use-logical-spec": "^5.0.1",
115114
"tree-kill": "1.2.2",
116-
"vue-devtools": "^5.1.4",
117115
"vue-eslint-parser": "^10.2.0",
118-
"vue-loader": "^15.10.0",
116+
"vue-loader": "^17.4.2",
119117
"webpack": "^5.102.1",
120118
"webpack-cli": "^6.0.1",
121119
"webpack-dev-server": "^5.2.2",

src/datastores/index.js

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,21 @@ if (process.env.IS_ELECTRON_MAIN) {
2222
dbPath = (dbName) => `${dbName}.db`
2323
}
2424

25-
export const settings = new Datastore({ filename: dbPath('settings'), autoload: !process.env.IS_ELECTRON_MAIN })
26-
export const profiles = new Datastore({ filename: dbPath('profiles'), autoload: !process.env.IS_ELECTRON_MAIN })
27-
export const playlists = new Datastore({ filename: dbPath('playlists'), autoload: !process.env.IS_ELECTRON_MAIN })
28-
export const history = new Datastore({ filename: dbPath('history'), autoload: !process.env.IS_ELECTRON_MAIN })
29-
export const searchHistory = new Datastore({ filename: dbPath('search-history'), autoload: !process.env.IS_ELECTRON_MAIN })
30-
export const subscriptionCache = new Datastore({ filename: dbPath('subscription-cache'), autoload: !process.env.IS_ELECTRON_MAIN })
25+
/**
26+
* @param {string} name
27+
*/
28+
function createDatastore(name) {
29+
return new Datastore({
30+
filename: dbPath(name),
31+
autoload: !process.env.IS_ELECTRON_MAIN,
32+
// Automatically clean up corrupted data, instead of crashing
33+
corruptAlertThreshold: 1
34+
})
35+
}
36+
37+
export const settings = createDatastore('settings')
38+
export const profiles = createDatastore('profiles')
39+
export const playlists = createDatastore('playlists')
40+
export const history = createDatastore('history')
41+
export const searchHistory = createDatastore('search-history')
42+
export const subscriptionCache = createDatastore('subscription-cache')

0 commit comments

Comments
 (0)