kitodo / kitodo-presentation

Kitodo.Presentation is a feature-rich framework for building a METS- or IIIF-based digital library. It is part of the Kitodo Digital Library Suite.
https://kitodo.org
GNU General Public License v3.0
37 stars 45 forks source link

"use strict" requires variable declaration #208

Closed christopher-johnson closed 6 years ago

christopher-johnson commented 6 years ago

Our images are not rendered when with loading a presentation.xml file in the test viewer. I believe that this is related to the introduction of "use strict" in this commit; https://github.com/kitodo/kitodo-presentation/commit/0a162d56f178f903c0fc0b652349ce98d7f7a81c

albig commented 6 years ago

That's possible. This "use strict" was added by babel and had no impact on our use case.

What do you propose? Remove "use strict" or declare the missing variables? Could you provide a pull request?

christopher-johnson commented 6 years ago

Babel is often used to transpile from an ES6 source to an ES5 (or whatever) target for deployment. Here it was applied directly to the ES6 source file. I understand that this typo3 ext plugin resource wiring does not separate js source from target files, but I believe that a basic "java style" build setup (using Gulp or Grunt) could make future development, testing and integration in this project much easier.

I also think that implementing and committing any changes directly into master is uncertain without browser testing. As I indicated in an email I sent you on 13.07.2017, I have created an example BrowserStack browser test setup here.

RE: "use strict". I think that this is useful for testing ES5. I would keep it in, and also include it in all of your target scripts to see what will break. To fix this particular issue is easy, just insert the missing variable declarations (if you want to keep ES5 in your source ...) at line 70 in tx_dlf_utils.js:

            var format;
            var quality;
christopher-johnson commented 6 years ago

@albig This is a blocker for the presentation.xml implementation at UBL. Can you take care of this please? Thank you.

albig commented 6 years ago

@christopher-johnson Please provide a pull request for this issue. We will check and merge it.