Hi
I need to my framework7-vue/cordova app works on android 4.4 and on so i guess i should work with F7 v3 right?
But which version exactly(3.?.?) . because no matter which F7 version I use it always installs Template7 1.4.1 which uses new template literals and some es6 features that android 4.4 webview doesn’t understand!
I’ve got errors at escape(string = '') {...
or at part += ` ${helperParts[j]}` …
I’ve already managed to use babel to transpile es6 functions into compatible ones but i can’t figure out how to make it work on template literals.
// babel.config.js
module.exports = {
presets: [
[
'@babel/preset-env',
{
modules: false,
useBuiltIns: 'usage'
}
]
],
plugins: ['@babel/plugin-transform-template-literals']
}
So how could I manage to my app works on old android devices?
update :
After more digging I’ve found in Temple7 folder in node_modules there is a template7.esm.js
with new es6 features and template7.js
with common javascript codes. But webpack includes esm bundle into the chunk:
...
"use strict";
/* WEBPACK VAR INJECTION */(function(global) {/**
* Template7 1.4.1
* Mobile-first HTML template engine
*
* http://www.idangero.us/template7/
*
* Copyright 2019, Vladimir Kharlampidi
* The iDangero.us
* http://www.idangero.us/
*
* Licensed under MIT
*
* Released on: February 5, 2019
*/
let t7ctx;
if (typeof window !== 'undefined') {
t7ctx = window;
} else if (typeof global !== 'undefined') {
t7ctx = global;
} else {
t7ctx = undefined;
}
const Template7Context = t7ctx;
const Template7Utils = {
quoteSingleRexExp: new RegExp('\'', 'g'),
quoteDoubleRexExp: new RegExp('"', 'g'),
isFunction(func) {
return typeof func === 'function';
},
escape(string = '') {
return string
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"')
.replace(/'/g, ''');
},
...