Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.

Add build pipeline, improve JavaScript #90

Merged
merged 25 commits into from Aug 6, 2020
Merged

Add build pipeline, improve JavaScript #90

merged 25 commits into from Aug 6, 2020

Conversation

andreasremdt
Copy link
Collaborator

@andreasremdt andreasremdt commented Aug 3, 2020

Hey Andi,

I just created this new PR to prevent some merge/rebase chaos with the old one.
This PR contains the following changes:

  • Installed gulp-babel and @babel/env. These are used for JavaScript transpilation, meaning that you can use ES6 (like const, let, etc.) while having support for older browsers, such as Safari 9.
  • Changed the Gulp pipeline to also transpile the JavaScript.
  • Moved the raw, unprocessed Sass and JavaScript files into a new folder src. When Gulp has ran, it will put the processed (and ready-to-use) files into resources/(js|css), like they where before. Meaning that from now on, you should edit the Sass in and JavaScript in the src directory and let Gulp put them into resources.
  • Updated simple-translator to version 2.0.2. It now supports more browsers, is already transpiled and could also be loaded from a CDN. The API has also slightly changed.
  • In package.json, there were 3 dependencies that had version numbers referenced to some GitHub repos, which prevented a successful installation on my machine. I added the latest version numbers, if you don't want this let me know.
  • I installed and used the whatwg-fetch polyfill which should enable Safari to use the simple translator.
  • added Prettier to have consistent formatting for both JavaScript & SCSS

@andreasremdt andreasremdt mentioned this pull request Aug 3, 2020
@andreasremdt andreasremdt added the enhancement New feature or request label Aug 3, 2020
@andi34 andi34 force-pushed the add-build-pipeline branch 2 times, most recently from 646fef1 to 5fc748b Compare August 3, 2020 18:04
Copy link
Owner

@andi34 andi34 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andi34 @andreasremdt I've tested the whatwg-fetch polyfill in simple-translator as provided in above snapshot - works great on iOS 9 / iPad2, thanks a million.

I found one more small thing to be adjusted, in order to make it work with Photobooth on iPad2.

There seems to be an Javascript ES6 TypeError in Safari & IE when iterating over a NodeList object using forEach. Along that comment, I tried the following change in the simple-translatorcode-base, file translate.js, member function translatePageTo:

<                     elements.forEach(function(element) {
---
>                     Array.from(elements).forEach(function(element) {

which then made Photobooth translations work perfectly well on iPad2.

I tried to provide a simple PR but was not able to find the repo / branch where the backward compatible code base resides which is included in the snapshot (i.e. no more use of arrow function). If you are ok to take it from here would be great or let me know where to look and I am happy to provide a PR for this change.

Once more thanks for all the support and your willingness to go beyond, and to make it work.

@andreasremdt
Copy link
Collaborator Author

I just added Prettier to have consistent formatting for both JavaScript & SCSS. If you don't like the formatting (for example the 80 characters max-width which I could understand) let me know, we can still tweak the settings.

Copy link
Owner

@andi34 andi34 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll fix that later today

manual/index.php Outdated Show resolved Hide resolved
login/index.php Outdated Show resolved Hide resolved
slideshow/index.php Show resolved Hide resolved
admin/index.php Outdated Show resolved Hide resolved
andreasremdt and others added 21 commits August 5, 2020 20:12
Installs Babel and @babel/env to transpile JavaScript into ES5 code
Adapts the Gulp pipeline to process JavaScript
Moves source files into the `src` folder
Removes async/await and imports
Install version 2.0.1 of simple translator via CDN
Improve usage
Change-Id: I78d1cd9aeffc98440d5c431dc2834c75fbff1799
Change-Id: I5b290222857f98761451c9c2e6ebfbadf30f9059
Change-Id: I06c568cb6966024816ce90986d5beed1c75ab4bc
- this was a git submodule in the past, moved to dependencies inside
  package.json

Change-Id: If2fc6aac0d5c2f18ebc1bcbea178e8fe47d53caf
Change-Id: If5428ed5a270a59cf292f84c30a088fb7f3f019b
Change-Id: Ife824a1fe910e2bbabe7b5c708645bd513afd2f7
Change-Id: I71b3f22fc57550f2694501e7a3ea71f4c2745aff
Change-Id: I14fb40b89f91a4bce22202f10d68d180f46b962c
Change-Id: I4a815e2b83bc231a4e196bb33cfb34753fbaa922
Use actual version numbers for the package.json dependencies
Install and use whatwg-fetch as polyfill for older browsers (Safari 9)

Change-Id: I2049d49179e3f619a61fc5436313be55f60d1139
Change-Id: I55e1b5c72559bd2ed269f442b5df501f773ff9b9
Change-Id: Ie5dfda945328d566251bc8e33162d322ef59fb0e
Install prettier and format all source files (JS & SCSS).

Change-Id: I5cb26fc74e98e7abf24941ec6db34548b07a5386
Change-Id: I117a1e2b8bf9800a9567ec6d478e5745376defab
Change-Id: I4012782a152d27a1018b2f04c5d8cdcb0fc716cb
- also always generate the faq

Change-Id: I92896ed2f8fbe43518967068b864f83f453ba55c
Change-Id: Ie28d401b2f783354f087f9316f9caf735546e436
@andi34
Copy link
Owner

andi34 commented Aug 5, 2020

rebased on dev branch. will merge once i get feedback :)

Change-Id: I8568b5fe1b800a27b094d91e12c0ba7c94800eb0
Change-Id: I01471ddf5038edde2eb0ca2ceb134d504f3d9621
@andi34 andi34 merged commit ea5df01 into dev Aug 6, 2020
@andi34 andi34 added this to the v2.8.0 milestone Aug 6, 2020
@andi34 andi34 deleted the add-build-pipeline branch August 8, 2020 20:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants