Skip to content

Pass all binary modules through webpack #3

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

Merged
merged 15 commits into from
Sep 2, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ mojo/log/
binary-static.iml
scripts/local
src/javascript/binary_pack.js
npm-debug.log
*.swp
21 changes: 18 additions & 3 deletions .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"es5": true, // ECMAScript 5
"browser": true, // Standard browser globals e.g. `window`, `document`.
"sub": true, // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`.
"bitwise": true, // true: Prohibit bitwise operators (&, |, ^, etc.)
"immed": false, // true: Require immediate invocations to be wrapped in parens e.g.
"bitwise": true, // true: Prohibit bitwise operators (&, |, ^, etc.)
"immed": false, // true: Require immediate invocations to be wrapped in parens e.g.
"latedef": false, // true: Require variables/functions to be defined before being used
"newcap": false, // true: Require capitalization of all constructor functions e.g. `new F()`
"noarg": true, // true: Prohibit use of `arguments.caller` and `arguments.callee`
Expand Down Expand Up @@ -54,7 +54,22 @@
"moment": true,
"pjax_config_page": true,
"page": true,
"text": true
"require": true,
"module": true,
"TUser": true,
"PortfolioWS": true,
"BinarySocket": true,
"Portfolio": true,
"PortfolioWS": true,
"addComma": true,
"addTooltip": true,
"buildOauthApps": true,
"console": true,
"format_money": true,
"japanese_client": true,
"showLoadingImage": true,
"showTooltip": true,
"toJapanTimeIfNeeded": true
}

// TODO: Options to enable later:
Expand Down
1 change: 1 addition & 0 deletions build/aliases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ css:
js:
- 'webpack'
- 'concat'
- 'shell:remove_pack'
- 'uglify'

test:
Expand Down
3 changes: 2 additions & 1 deletion build/concat.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ module.exports = {
'src/javascript/autogenerated/idd_codes.js',
'src/javascript/autogenerated/texts.js',
'src/javascript/autogenerated/*.js',
'src/javascript/binary_pack.js',
'src/javascript/binary/components/**/*.js',
'dist/js/binary_pack.js',
]
}
]
Expand Down
1 change: 0 additions & 1 deletion build/mochaTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ module.exports = {
reporter: 'spec',
quiet: false, // Optionally suppress output to standard out (defaults to false)
clearRequireCache: false, // Optionally clear the require cache before running tests (defaults to false)
require: 'src/javascript/binary/common_functions/compatibility.js'
},
src: ['src/javascript/binary/**/__tests__/*.js']
}
Expand Down
8 changes: 7 additions & 1 deletion build/shell.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
module.exports = function (grunt) {
return {
remove_pack: {
command: 'rm ' + global.dist + '/js/binary_pack.js',
options: {
stdout: true
}
},
compile_dev: {
command: global.compileCommand('-f -d'),
options: {
Expand Down Expand Up @@ -107,4 +113,4 @@ module.exports = function (grunt) {
}
}
}
};
};
2 changes: 1 addition & 1 deletion build/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = function (grunt) {
app: './src/javascript/index.js',
},
output: {
path: './src/javascript',
path: global.dist + '/js/',
filename: 'binary_pack.js',
},
}
Expand Down
277 changes: 0 additions & 277 deletions src/javascript/binary/base.js

This file was deleted.

6 changes: 3 additions & 3 deletions src/javascript/binary/base/markets.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ var Market = function(name, display_name, submarkets) {

Market.prototype = {
translated_display_name: function() {
return text.localize(this.display_name);
return page.text.localize(this.display_name);
},
by_symbol: function(symbol) {
var count = this.submarkets.length;
Expand Down Expand Up @@ -85,7 +85,7 @@ Market.prototype = {
};

function localizeName() {
return text.localize(this.name);
return page.text.localize(this.name);
}

var SubMarket = function(name, display_name, underlyings) {
Expand All @@ -106,7 +106,7 @@ var SubMarket = function(name, display_name, underlyings) {

SubMarket.prototype = {
translated_display_name: function() {
return text.localize(this.display_name);
return page.text.localize(this.display_name);
},
each: function(callback) {
var underlying_count = this.underlyings.length;
Expand Down
Loading