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

chore: better dev experience #3896

Merged
merged 1 commit into from
Jan 3, 2017
Merged

chore: better dev experience #3896

merged 1 commit into from
Jan 3, 2017

Conversation

gkatsev
Copy link
Member

@gkatsev gkatsev commented Dec 28, 2016

npm start now runs grunt dev which in turn runs the connect server,
sets up babel watching, browserify watching (for both src and test
files), and css and alternate builds watching.

Additionally, it will copy over the dev build files into the dist folder
so that if you're linking videojs and you have a project that gets
video.js from the dist, you can link and develop with more easy without
rerunning all of grunt dist each time.

Additionally, this specifically does not run more time consumming
operations like minification.

npm start now runs `grunt dev` which in turn runs the connect server,
sets up babel watching, browserify watching (for both src and test
files), and css and alternate builds watching.

Additionally, it will copy over the dev build files into the dist folder
so that if you're linking videojs and you have a project that gets
video.js from the dist, you can link and develop with more easy without
rerunning all of `grunt dist` each time.

Additionally, this specifically does not run more time consumming
operations like minification.
Copy link
Member Author

@gkatsev gkatsev left a comment

Choose a reason for hiding this comment

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

Here's the better dev experience that I extracted from the middleware PR.

@@ -142,10 +151,6 @@ module.exports = function(grunt) {
babel: {
files: ['src/js/**/*.js'],
tasks: ['babel:es5']
},
jshint: {
Copy link
Member Author

Choose a reason for hiding this comment

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

we no longer use jshint.

@@ -127,6 +127,15 @@ module.exports = function(grunt) {
},
dist: {},
watch: {
dist: {
files: [
Copy link
Member Author

Choose a reason for hiding this comment

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

these are the files that users most likely try to get from the dist folder, so, we copy on changes to them.

@@ -405,6 +410,14 @@ module.exports = function(grunt) {
'watch:babel',
'browserify:tests'
],
dev: [
Copy link
Member Author

Choose a reason for hiding this comment

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

we specifically don't run watch:minify because it is a time consuming process.

'watch:novtt',
'watch:skin',
'watch:dist',
'shell:babel'
Copy link
Member Author

Choose a reason for hiding this comment

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

we run shell:babel to use babel's built-in file watching. grunt-babel provides watching using grunt's watch module that we use above, however, it recompiles all the files instead of the files that were changed.

"test": "grunt test",
"docs": "npm run docs:lint && npm run docs:api",
"docs:api": "jsdoc -r src/js -d docs/api -c .jsdoc.json",
"docs:lint": "remark -- './**/*.md'",
"docs:fix": "remark --output -- './**/*.md'"
"docs:fix": "remark --output -- './**/*.md'",
"babel": "babel src/js -d es5"
Copy link
Member Author

Choose a reason for hiding this comment

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

a simple babel command to compile our source files to the destination folder.

@@ -437,6 +450,12 @@ module.exports = function(grunt) {
}
},
shell: {
babel: {
command: 'npm run babel -- --w',
Copy link
Member Author

Choose a reason for hiding this comment

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

this runs our npm babel script (a simple babel command) with the --w flag for watch. When a file changes, just that one will be compiled.

@gkatsev gkatsev mentioned this pull request Dec 28, 2016
Copy link
Member

@misteroneill misteroneill left a comment

Choose a reason for hiding this comment

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

Nice.

@gkatsev gkatsev merged commit 9ec5587 into videojs:master Jan 3, 2017
@gkatsev gkatsev deleted the better-dev branch January 3, 2017 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants