Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Revert "[webpack] setup lazy loading for all visualizations" (apache#…
Browse files Browse the repository at this point in the history
…5219)

* Revert "[explore] fix autocomplete on verbose names (apache#5204)"

This reverts commit d5ebc43.

* Revert "[webpack] setup lazy loading for all visualizations (apache#4727)"

This reverts commit de0aaf4.
  • Loading branch information
williaster authored and timifasubaa committed Jul 25, 2018
1 parent 360a882 commit ad50a02
Show file tree
Hide file tree
Showing 20 changed files with 2,549 additions and 1,528 deletions.
24 changes: 5 additions & 19 deletions superset/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,37 +47,23 @@ def parse_manifest_json():
global manifest
try:
with open(MANIFEST_FILE, 'r') as f:
# the manifest inclues non-entry files
# we only need entries in templates
full_manifest = json.load(f)
manifest = full_manifest.get('entrypoints', {})
manifest = json.load(f)
except Exception:
pass


def get_js_manifest_files(filename):
def get_manifest_file(filename):
if app.debug:
parse_manifest_json()
entry_files = manifest.get(filename, {})
return entry_files.get('js', [])


def get_css_manifest_files(filename):
if app.debug:
parse_manifest_json()
entry_files = manifest.get(filename, {})
return entry_files.get('css', [])
return '/static/assets/dist/' + manifest.get(filename, '')


parse_manifest_json()


@app.context_processor
def get_manifest():
return dict(
js_manifest=get_js_manifest_files,
css_manifest=get_css_manifest_files,
)
def get_js_manifest():
return dict(js_manifest=get_manifest_file)


#################################################################
Expand Down
3 changes: 1 addition & 2 deletions superset/assets/.babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"presets" : ["airbnb", "react", "env"],
"plugins": ["syntax-dynamic-import"],
"presets" : ["airbnb"],
}
3 changes: 1 addition & 2 deletions superset/assets/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "airbnb",
"parser": "babel-eslint",
"parserOptions": {
"parserOptions":{
"ecmaFeatures": {
"experimentalObjectRestSpread": true
}
Expand Down
37 changes: 17 additions & 20 deletions superset/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
"scripts": {
"test": "mocha --require ignore-styles --compilers js:babel-core/register --require spec/helpers/browser.js --recursive spec/**/*_spec.*",
"cover": "babel-node node_modules/.bin/babel-istanbul cover _mocha -- --require ignore-styles spec/helpers/browser.js --recursive spec/**/*_spec.*",
"dev": "webpack --mode=development --colors --progress --debug --watch",
"prod": "node --max_old_space_size=4096 webpack --mode=production --colors --progress",
"build": "webpack --mode=production --colors --progress",
"dev": "NODE_ENV=dev webpack --watch --colors --progress --debug --output-pathinfo --devtool eval-cheap-source-map",
"dev-slow": "NODE_ENV=dev webpack --watch --colors --progress --debug --output-pathinfo --devtool inline-source-map",
"dev-fast": "echo 'dev-fast in now replaced by dev'",
"prod": "NODE_ENV=production node --max_old_space_size=4096 ./node_modules/webpack/bin/webpack.js -p --colors --progress",
"build": "NODE_ENV=production webpack --colors --progress",
"lint": "eslint --ignore-path=.eslintignore --ext .js,.jsx .",
"lint-fix": "eslint --fix --ignore-path=.eslintignore --ext .js,.jsx .",
"sync-backend": "babel-node --presets env src/syncBackend.js"
Expand All @@ -37,9 +39,6 @@
"bugs": {
"url": "https://github.com/apache/incubator-superset/issues"
},
"engines": {
"node": ">= 6.11.5 <7.0.0 || >= 8.9.0"
},
"homepage": "http://superset.apache.org/",
"dependencies": {
"//": "known issues with react-bootstrap>=0.32",
Expand Down Expand Up @@ -117,21 +116,19 @@
"supercluster": "https://github.com/georgeke/supercluster/tarball/ac3492737e7ce98e07af679623aad452373bbc40",
"underscore": "^1.8.3",
"urijs": "^1.18.10",
"viewport-mercator-project": "^5.0.0"
"viewport-mercator-project": "^5.0.0",
"webpack-cli": "^2.1.4"
},
"devDependencies": {
"babel-cli": "^6.14.0",
"babel-core": "^6.10.4",
"babel-eslint": "^8.2.2",
"babel-istanbul": "^0.12.2",
"babel-loader": "^7.1.4",
"babel-loader": "^7.0.0",
"babel-plugin-css-modules-transform": "^1.1.0",
"babel-plugin-dynamic-import-node": "^1.2.0",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-polyfill": "^6.23.0",
"babel-preset-airbnb": "^2.1.1",
"chai": "^4.0.2",
"clean-webpack-plugin": "^0.1.19",
"clean-webpack-plugin": "^0.1.16",
"css-loader": "^0.28.0",
"enzyme": "^2.0.0",
"eslint": "^4.19.0",
Expand All @@ -140,16 +137,16 @@
"eslint-plugin-jsx-a11y": "^5.1.1",
"eslint-plugin-react": "^7.0.1",
"exports-loader": "^0.7.0",
"file-loader": "^1.1.11",
"extract-text-webpack-plugin": "3.0.2",
"file-loader": "^0.11.1",
"github-changes": "^1.0.4",
"ignore-styles": "^5.0.1",
"imports-loader": "^0.7.1",
"istanbul": "^1.0.0-alpha",
"jsdom": "9.12.0",
"json-loader": "^0.5.4",
"less": "^2.6.1",
"less-loader": "^4.1.0",
"mini-css-extract-plugin": "^0.4.0",
"less-loader": "^4.0.3",
"mocha": "^3.2.0",
"npm-check-updates": "^2.14.0",
"react-addons-test-utils": "^15.6.2",
Expand All @@ -160,10 +157,10 @@
"style-loader": "^0.21.0",
"transform-loader": "^0.2.3",
"uglifyjs-webpack-plugin": "^1.1.0",
"url-loader": "^1.0.1",
"webpack": "^4.6.0",
"webpack-assets-manifest": "^3.0.1",
"webpack-cli": "^2.0.10",
"webpack-sources": "^1.1.0"
"url-loader": "^0.6.2",
"//": "Known issues with >=4",
"webpack": "^3.10.0",
"webpack-manifest-plugin": "2.0.3",
"webworkify-webpack": "2.1.2"
}
}
7 changes: 1 addition & 6 deletions superset/assets/spec/helpers/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@ import 'babel-polyfill';
import chai from 'chai';
import jsdom from 'jsdom';

require('babel-register')({
// NOTE: If `dynamic-import-node` is in .babelrc alongside
// `syntax-dynamic-import` it breaks webpack's bundle splitting capability.
// So only load during runtime on the node-side (in tests)
plugins: ['dynamic-import-node'],
});
require('babel-register')();

const exposedProperties = ['window', 'navigator', 'document'];

Expand Down
4 changes: 2 additions & 2 deletions superset/assets/spec/javascripts/chart/Chart_spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ describe('Chart', () => {
<Chart {...mockedProps} />,
);
});
describe('renderVis', () => {
describe('renderViz', () => {
let stub;
beforeEach(() => {
stub = sinon.stub(wrapper.instance(), 'renderVis');
stub = sinon.stub(wrapper.instance(), 'renderViz');
});
afterEach(() => {
stub.restore();
Expand Down
Loading

0 comments on commit ad50a02

Please sign in to comment.