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

Clean up externals global variables so it works with module loaders. #1057

Merged
merged 3 commits into from
Jan 28, 2016

Conversation

DDKnoll
Copy link
Contributor

@DDKnoll DDKnoll commented Jan 25, 2016

Attempting to use dash.js with module loader javascript frameworks such
as web pack or browserify was not working well. This was because of
global libraries that were not being included using require or import
syntax. Removing this global variable leak fixes the issues when
incorporating it into many modern stacks.

External libraries have been updated and all source files requiring
them are explicitly using the ‘import from …’ syntax. Gruntfile and
.jshintrc have been updated.

It now builds into a single all.min.js file

…n global variables.

Attempting to use dash.js with module loader javascript frameworks such
as web pack or browserify was not working well. This was because of
global libraries that were not being included using require or import
syntax.  Removing this global variable leak fixes the issues when
incorporating it into many modern stacks.

External libraries have been updated and all source files requiring
them are explicitly using the ‘import from …’ syntax.  Gruntfile and
.jshintrc have been updated.

It now builds into a single all.min.js file
@@ -148,7 +114,7 @@ module.exports = function (grunt) {
},
all: {
files: {
'build/temp/dash.no-externals.debug.js': ['src/All.js']
'build/temp/dash.all.min.js': ['src/All.js']
Copy link
Member

Choose a reason for hiding this comment

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

This should be something like build/temp/dash.all.debug.js

Then we would have an uglify step that would convert dash.all.debug.js into dash.all.min.js. The dist copy will need to be upgraded accordingly.

@DDKnoll DDKnoll changed the title Clean up externals global variablesso it works with module loaders. Clean up externals global variables so it works with module loaders. Jan 26, 2016
@dsparacio
Copy link
Contributor

@DDKnoll Seems like you got the debug.all stuff back in so thank you for this commit.
@boushley if you have a chance can you take a look I would like to merge this one soon ...

@boushley
Copy link
Member

This is looking really good although we're still missing one piece. The dash.all.debug.js file is now generated and placed in the build/temp folder, but we need to add it back into the dist configuration for the copy command. Just add a line right after this that copies dash.all.debug.js and dash.all.debug.js.map.

Once that's taken care of we'll get to update the samples again :) I can take care of that once this lands though. @AkamaiDASH if you ping me with an @ mention when you land this I'll update the samples.

@boushley
Copy link
Member

Additionally, if we don't want to wait another round you can land this and I'll update the copy command and the samples real quick.

@dsparacio
Copy link
Contributor

@boushley do you have rights to commit this PR?

@boushley
Copy link
Member

Indeed

boushley added a commit that referenced this pull request Jan 28, 2016
Clean up externals global variables so it works with module loaders.
@boushley boushley merged commit 39e1f4b into Dash-Industry-Forum:development Jan 28, 2016
@davemevans
Copy link
Contributor

Should this PR also have removed externals/iso_boxer.min.js since ISOBoxer is now included as a dependency in package.json?

@dsparacio
Copy link
Contributor

yes I believe you are correct and missed that. I will make sure we are ok if we remove from external and commit. Thanks @bbcrddave

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.

4 participants