-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Support serving ES6 JS to clients #596
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
Oops! Something went wrong! :( ESLint: 4.9.0. ESLint couldn't find the plugin "eslint-plugin-html". This can happen for a couple different reasons: 1. If ESLint is installed globally, then make sure eslint-plugin-html is also installed globally. A globally-installed ESLint cannot find a locally-installed plugin. 2. If ESLint is installed locally, then it's likely that the plugin isn't installed correctly. Try reinstalling by running the following: npm i eslint-plugin-html@latest --save-dev If you still can't figure out the problem, please stop by https://gitter.im/eslint/eslint to chat with the team.
rollup.config-es6.js
Outdated
babelrc: false, | ||
presets: [ | ||
[ | ||
'es2016', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we can just remove any preset completely?
If we want to use a preset, we should use browser-env.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using babel-preset-env
which takes in a browserlist query.
We can support latest 2 versions of Chrome, Firefox and Safari?
http://browserl.ist/?q=last+2+firefox+versions%2C+last+2+chrome+versions%2C+last+2+safari+versions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed completely
rollup.config-es6.js
Outdated
], | ||
plugins: [ | ||
'external-helpers', | ||
'transform-object-rest-spread', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one too is in the modern browsers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Browsers recognize it, but rollup doesn't.
rollup.config-es6.js
Outdated
] | ||
], | ||
plugins: [ | ||
'external-helpers', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we don't transpile, we don't need this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need this if we do browser-env.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without it a warning is issued. Lets keep it.
'external-helpers', | ||
'transform-object-rest-spread', | ||
[ | ||
'transform-react-jsx', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only thing we need :-)
gulp/tasks/default.js
Outdated
@@ -4,6 +4,7 @@ const runSequence = require('run-sequence'); | |||
gulp.task('default', () => { | |||
return runSequence.use(gulp)( | |||
'clean', | |||
'build' | |||
'build', | |||
'build_es6' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it's kind of too late now, but I think "modern" would have been a better suffix that would stand time as I can see us changing what we transpile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe change to es5 and un-suffixed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I like that more. ES5 is a fixed goal.
gulp/common/transform.js
Outdated
sourceType: 'script', | ||
presets: [ | ||
['es2015', { modules: false }] | ||
es6 ? ['es2016'] : ['es2015', { modules: false }] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be browser-env too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed completely
gulp/tasks/gen-service-worker.js
Outdated
const fs = require('fs'); | ||
const path = require('path'); | ||
const swPrecache = require('sw-precache'); | ||
// var uglifyJS = require('uglify-js'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stale comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
Oops! Something went wrong! :( ESLint: 4.9.0. ESLint couldn't find the plugin "eslint-plugin-html". This can happen for a couple different reasons: 1. If ESLint is installed globally, then make sure eslint-plugin-html is also installed globally. A globally-installed ESLint cannot find a locally-installed plugin. 2. If ESLint is installed locally, then it's likely that the plugin isn't installed correctly. Try reinstalling by running the following: npm i eslint-plugin-html@latest --save-dev If you still can't figure out the problem, please stop by https://gitter.im/eslint/eslint to chat with the team.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
Oops! Something went wrong! :( ESLint: 4.9.0. ESLint couldn't find the plugin "eslint-plugin-html". This can happen for a couple different reasons: 1. If ESLint is installed globally, then make sure eslint-plugin-html is also installed globally. A globally-installed ESLint cannot find a locally-installed plugin. 2. If ESLint is installed locally, then it's likely that the plugin isn't installed correctly. Try reinstalling by running the following: npm i eslint-plugin-html@latest --save-dev If you still can't figure out the problem, please stop by https://gitter.im/eslint/eslint to chat with the team.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
Oops! Something went wrong! :( ESLint: 4.9.0. ESLint couldn't find the plugin "eslint-plugin-html". This can happen for a couple different reasons: 1. If ESLint is installed globally, then make sure eslint-plugin-html is also installed globally. A globally-installed ESLint cannot find a locally-installed plugin. 2. If ESLint is installed locally, then it's likely that the plugin isn't installed correctly. Try reinstalling by running the following: npm i eslint-plugin-html@latest --save-dev If you still can't figure out the problem, please stop by https://gitter.im/eslint/eslint to chat with the team.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
Oops! Something went wrong! :( ESLint: 4.9.0. ESLint couldn't find the plugin "eslint-plugin-html". This can happen for a couple different reasons: 1. If ESLint is installed globally, then make sure eslint-plugin-html is also installed globally. A globally-installed ESLint cannot find a locally-installed plugin. 2. If ESLint is installed locally, then it's likely that the plugin isn't installed correctly. Try reinstalling by running the following: npm i eslint-plugin-html@latest --save-dev If you still can't figure out the problem, please stop by https://gitter.im/eslint/eslint to chat with the team.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
Oops! Something went wrong! :( ESLint: 4.9.0. ESLint couldn't find the plugin "eslint-plugin-html". This can happen for a couple different reasons: 1. If ESLint is installed globally, then make sure eslint-plugin-html is also installed globally. A globally-installed ESLint cannot find a locally-installed plugin. 2. If ESLint is installed locally, then it's likely that the plugin isn't installed correctly. Try reinstalling by running the following: npm i eslint-plugin-html@latest --save-dev If you still can't figure out the problem, please stop by https://gitter.im/eslint/eslint to chat with the team.
@pvizeli reminder that I need to fix the Hass.io build before the next release. |
Ouch, now if someone syncs FE they will get a broken experience until BE is submitted too. |
Yeah, sorry about that 😞 thanks for the quick fix! |
* Support serving ES6 JS to clients * Make es6 default dir and es5 a special dir * Fix package building * Fix build_frontend script
* Support serving ES6 JS to clients * Make es6 default dir and es5 a special dir * Fix package building * Fix build_frontend script
Add an option to serve ES6 JS to clients
Backend PR: home-assistant/core#10474
In addition to
hass_frontend
package with all the frontend content, generatehass_frontend_es6
that contains untranspiled* files.(Not really untranspiled, as react JS is still transpiled to regular JS, and babel es2016 preset is used)
@balloob I didn't check that hassio-panel produces valid result.