diff --git a/README.md b/README.md index 604ab3cb8c..be61a7a83e 100644 --- a/README.md +++ b/README.md @@ -58,10 +58,6 @@ export default class TryStardust extends Component { - - - - diff --git a/build/karma.conf.babel.js b/build/karma.conf.babel.js index 0100cfba54..4f245ef3c3 100644 --- a/build/karma.conf.babel.js +++ b/build/karma.conf.babel.js @@ -1,5 +1,6 @@ const { argv } = require('yargs') const config = require('../config') +const webpack = require('webpack') const webpackConfig = require('./webpack.config') const { paths } = config @@ -50,7 +51,13 @@ module.exports = (karmaConfig) => { ...webpackConfig.module.loaders, ], }), - plugins: webpackConfig.plugins, + plugins: [ + ...webpackConfig.plugins, + // utils/jquery loads real jQuery and semantic-ui-css + // we alias jquery and semantic-ui-css to mocks during tests + // ignore this module so we can use the mock versions in alias below + new webpack.NormalModuleReplacementPlugin(/utils\/jquery/, 'empty'), + ], resolve: Object.assign({}, webpackConfig.resolve, { alias: Object.assign({}, webpackConfig.resolve.alias, { jquery: `${paths.test('mocks')}/SemanticjQuery-mock.js`, diff --git a/build/webpack.config.js b/build/webpack.config.js index 7b04457421..fea2ab10ca 100644 --- a/build/webpack.config.js +++ b/build/webpack.config.js @@ -66,11 +66,6 @@ webpackConfig.output = { // ------------------------------------ webpackConfig.plugins = [ new webpack.DefinePlugin(config.compiler_globals), - new webpack.ProvidePlugin({ - $: 'jquery', - jQuery: 'jquery', - 'window.jQuery': 'jquery', - }), new webpack.DllReferencePlugin({ context: paths.base('node_modules'), manifest: require(paths.base('dll/vendor-manifest.json')), @@ -160,7 +155,8 @@ webpackConfig.module.loaders = [{ // ---------------------------------------- // For faster builds in dev, rely on prebuilt libraries // Local modules can still be enabled (ie for offline development) -if (argv.localModules) { +// in TEST we need local modules because karma uses a different index.html (no CDNs) +if (__TEST__ || argv.localModules) { webpackConfig.module.loaders = [ ...webpackConfig.module.loaders, { @@ -178,21 +174,27 @@ if (argv.localModules) { }, ] } else { + // we're not using local modules, we're loading deps via CDNs + webpackConfig.entry.vendor = _.without(webpackConfig.entry.vendor, [ + 'faker', + ]) + + // these are browser ready modules or aliased to empty + // do not parse their source for faster builds webpackConfig.module.noParse = [ ...webpackConfig.module.noParse, - /jquery/, - /semantic-ui-css\/semantic\.js/, - /semantic-ui-css\/semantic\.css/, + /faker/, ] + + // alias imports to empty webpackConfig.resolve.alias = Object.assign({}, webpackConfig.resolve.alias, { - 'semantic-ui-css/semantic.js': 'empty', 'semantic-ui-css/semantic.css': 'empty', 'highlight.js/styles/github.css': 'empty', }) + + // find them on the window webpackConfig.externals = { - jquery: 'jQuery', faker: 'faker', - lodash: '_', } } diff --git a/config/_default.js b/config/_default.js index 0012a11c25..ec5bf2b6d5 100644 --- a/config/_default.js +++ b/config/_default.js @@ -64,12 +64,9 @@ config = Object.assign({}, config, { 'bluebird', 'classnames', 'faker', - 'jquery', - 'lodash', 'react', 'react-dom', 'react-highlight', - 'semantic-ui-css/semantic.js', ], compiler_stats: { hash: false, // the hash of the compilation diff --git a/docs/app/Components/Root.js b/docs/app/Components/Root.js index 7dee562e83..0577c41b0d 100644 --- a/docs/app/Components/Root.js +++ b/docs/app/Components/Root.js @@ -1,4 +1,3 @@ -import 'semantic-ui-css/semantic.js' import 'semantic-ui-css/semantic.css' import 'highlight.js/styles/github.css' import _ from 'lodash' diff --git a/docs/app/Examples/collections/Form/Validation/FormValidationExamples.js b/docs/app/Examples/collections/Form/Validation/FormValidationExamples.js index 89e1a65fd6..31b57dec55 100644 --- a/docs/app/Examples/collections/Form/Validation/FormValidationExamples.js +++ b/docs/app/Examples/collections/Form/Validation/FormValidationExamples.js @@ -16,7 +16,7 @@ export default class FormValidationExamples extends Component { title='Validating on Blur and other Events' description={` Validation messages can also appear inline. - UI Forms automatically format labels with the class name prompt. + UI Forms automatically format labels with the class name "prompt". These validation prompts are also set to appear on input change instead of form submission. `} examplePath='collections/Form/Validation/FormValidatingOnBlurAndOtherEventsExample' diff --git a/docs/app/index.ejs b/docs/app/index.ejs index 4a613bac28..3c123bcc47 100644 --- a/docs/app/index.ejs +++ b/docs/app/index.ejs @@ -7,9 +7,6 @@ - - - Stardust