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 API Client from the tree #1007

Merged
merged 17 commits into from
May 7, 2020
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions .ci/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ jobs:
inputs:
versionSpec: '12.x'

- task: Cache@2
displayName: 'Check Cache'
inputs:
key: 'yarn | yarn.lock'
path: 'node_modules'
cacheHitVar: CACHE_RESTORED
#- task: Cache@2
# displayName: 'Check Cache'
# inputs:
# key: 'yarn | yarn.lock'
# path: 'node_modules'
# cacheHitVar: CACHE_RESTORED

- script: 'yarn install --frozen-lockfile'
displayName: 'Install Dependencies'
condition: ne(variables.CACHE_RESTORED, 'true')
# condition: ne(variables.CACHE_RESTORED, 'true')

- script: 'yarn build:development'
displayName: 'Build Development'
Expand Down Expand Up @@ -87,16 +87,16 @@ jobs:
inputs:
versionSpec: '12.x'

- task: Cache@2
displayName: 'Check Cache'
inputs:
key: 'yarn | yarn.lock'
path: 'node_modules'
cacheHitVar: CACHE_RESTORED
#- task: Cache@2
# displayName: 'Check Cache'
# inputs:
# key: 'yarn | yarn.lock'
# path: 'node_modules'
# cacheHitVar: CACHE_RESTORED

- script: 'yarn install --frozen-lockfile'
displayName: 'Install Dependencies'
condition: ne(variables.CACHE_RESTORED, 'true')
# condition: ne(variables.CACHE_RESTORED, 'true')

- script: 'yarn run lint --quiet'
displayName: 'Run ESLint'
Expand Down
4 changes: 3 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ module.exports = {
'one-var': ["error", "never"],
'quotes': ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": false }],
'semi': ["error"],
'space-before-blocks': ["error"]
'space-before-blocks': ["error"],
// Disable while it's buggy
'compat/compat': ["off"]
},
overrides: [
{
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
"headroom.js": "^0.11.0",
"hls.js": "^0.13.1",
"howler": "^2.1.3",
"intersection-observer": "^0.7.0",
"jellyfin-apiclient": "https://github.com/jellyfin/jellyfin-apiclient-javascript#v1.1.0",
"intersection-observer": "^0.10.0",
"jellyfin-apiclient": "^1.1.1",
"jellyfin-noto": "https://github.com/jellyfin/jellyfin-noto",
"jquery": "^3.5.0",
"jstree": "^3.3.7",
Expand All @@ -92,13 +92,14 @@
"src/components/autoFocuser.js",
"src/components/cardbuilder/cardBuilder.js",
"src/components/filedownloader.js",
"src/components/playback/mediasession.js",
"src/components/images/imageLoader.js",
"src/components/lazyloader/lazyloader-intersectionobserver.js",
"src/components/playback/mediasession.js",
"src/components/sanatizefilename.js",
"src/components/scrollManager.js",
"src/scripts/dfnshelper.js",
"src/scripts/dom.js",
"src/scripts/filesystem.js",
"src/scripts/imagehelper.js",
"src/scripts/inputManager.js",
"src/scripts/keyboardnavigation.js",
Expand Down
18 changes: 9 additions & 9 deletions src/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ _define('page', function() {
});

// core-js
var polyfill = require("@babel/polyfill/dist/polyfill");
_define("polyfill", function () {
var polyfill = require('@babel/polyfill/dist/polyfill');
_define('polyfill', function () {
return polyfill;
});

Expand Down Expand Up @@ -155,24 +155,24 @@ _define('headroom', function () {
});

// apiclient
var apiclient = require("jellyfin-apiclient");
var apiclient = require('jellyfin-apiclient');

_define("apiclient", function () {
_define('apiclient', function () {
return apiclient.apiclient;
})
});

_define("events", function () {
_define('events', function () {
return apiclient.Events;
});

_define("credentialprovider", function () {
_define('credentialprovider', function () {
return apiclient.Credentials;
});

_define("connectionManagerFactory", function () {
_define('connectionManagerFactory', function () {
return apiclient.ConnectionManager;
});

_define("appStorage", function () {
_define('appStorage', function () {
return apiclient.AppStorage;
});
2 changes: 1 addition & 1 deletion src/scripts/librarymenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ define(['dom', 'layoutManager', 'inputManager', 'connectionManager', 'events', '

renderHeader();

events.on(connectionManager, "localusersignedin", function (e, user) {
events.on(connectionManager, 'localusersignedin', function (e, user) {
var currentApiClient = connectionManager.getApiClient(user.ServerId);

currentDrawerType = null;
Expand Down
77 changes: 39 additions & 38 deletions src/scripts/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ var AppInfo = {};
}

function onRequireJsError(requireType, requireModules) {
throw new Error("error loading " + requireModules);
console.error('RequireJS error: ' + (requireType || 'unknown') + '. Failed modules: ' + (requireModules || []).join(','));
}

function defineResizeObserver() {
Expand All @@ -378,10 +378,8 @@ var AppInfo = {};
define('lazyLoader', [componentsPath + '/lazyloader/lazyloader-intersectionobserver'], returnFirstDependency);
define('shell', [componentsPath + '/shell'], returnFirstDependency);

define('apiclient', [bowerPath + '/apiclient/apiclient'], returnFirstDependency);

if ("registerElement" in document) {
define("registerElement", []);
if ('registerElement' in document) {
define('registerElement', []);
} else if (browser.msie) {
define('registerElement', ['webcomponents'], returnFirstDependency);
} else {
Expand All @@ -396,11 +394,14 @@ var AppInfo = {};

define('confirm', [componentsPath + '/confirm/confirm'], returnFirstDependency);

define("loading", [componentsPath + "/loading/loading"], returnFirstDependency);
define("multi-download", [componentsPath + "/multidownload"], returnFirstDependency);
define("fileDownloader", [componentsPath + "/filedownloader"], returnFirstDependency);
define('prompt', [componentsPath + '/prompt/prompt'], returnFirstDependency);

define('loading', [componentsPath + '/loading/loading'], returnFirstDependency);
define('multi-download', [componentsPath + '/multidownload'], returnFirstDependency);
define('fileDownloader', [componentsPath + '/filedownloader'], returnFirstDependency);
define('localassetmanager', [bowerPath + '/apiclient/localassetmanager'], returnFirstDependency);

define("castSenderApiLoader", [componentsPath + "/castSenderApi"], returnFirstDependency);
define('castSenderApiLoader', [componentsPath + '/castSenderApi'], returnFirstDependency);
}

function init() {
Expand Down Expand Up @@ -666,35 +667,35 @@ var AppInfo = {};
},
bundles: {
bundle: [
"document-register-element",
"fetch",
"flvjs",
"jstree",
"jQuery",
"hlsjs",
"howler",
"native-promise-only",
"resize-observer-polyfill",
"shaka",
"swiper",
"queryString",
"sortable",
"webcomponents",
"material-icons",
"jellyfin-noto",
"date-fns",
"page",
"polyfill",
"fast-text-encoding",
"intersection-observer",
"classlist-polyfill",
"screenfull",
"headroom",
"events",
"credentialprovider",
"connectionManagerFactory",
"appStorage",
"apiclient"
'document-register-element',
'fetch',
'flvjs',
'jstree',
'jQuery',
'hlsjs',
'howler',
'native-promise-only',
'resize-observer-polyfill',
'shaka',
'swiper',
'queryString',
'sortable',
'webcomponents',
'material-icons',
'jellyfin-noto',
'date-fns',
'page',
'polyfill',
'fast-text-encoding',
'intersection-observer',
'classlist-polyfill',
'screenfull',
'headroom',
'apiclient',
'events',
'credentialprovider',
'connectionManagerFactory',
'appStorage'
]
},
urlArgs: urlArgs,
Expand Down
Loading