Skip to content

Update dependencies #7

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

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
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
4 changes: 1 addition & 3 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{
"presets": [
"latest"
]
"presets": ["@babel/preset-env"]
}
Copy link
Owner Author

@coryhouse coryhouse Feb 20, 2017

Choose a reason for hiding this comment

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

ES2015 modules can be parsed by webpack 2. This enables tree shaking in the production build by disabling Babel's transpilation of ES2015 modules. Since ES2015 modules are statically analyzable, webpack can determine with certainly what code you're not calling, and leave it out of the bundle. This process can reduce your final bundle size. It's commonly called tree shaking or dead code elimination.

Copy link
Owner Author

Choose a reason for hiding this comment

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

I've also switched to babel-preset-env since it replaced babel-preset-latest.

Choose a reason for hiding this comment

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

You'll need to update all "latest" with "env" in .babelrc.

Copy link
Owner Author

Choose a reason for hiding this comment

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

@jcscott2015 - Correct, and I did that as you can see above.

7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ This is a generic JavaScript development environment that I build from scratch i

| **Dependency** | **Use** |
| --------------------------- | --------------------------------------------------------------------------------------------------------- |
| babel-cli | Babel Command line interface |
| babel-core | Babel Core for transpiling the new JavaScript to old |
| @babel/cli | Babel Command line interface |
| @babel/core | Babel Core for transpiling the new JavaScript to old |
| babel-loader | Adds Babel support to Webpack |
| @babel/node | Run Babel via Node |
| babel-preset-latest | Babel preset for running all the latest standardized JavaScript features |
| babel-register | Register Babel to transpile our Mocha tests |
| @babel/register | Register Babel to transpile our Mocha tests |
| chai | Assertion library |
| chalk | Colored command line output |
| cheerio | Supports querying DOM with jQuery like syntax - Useful in testing and build process for HTML manipulation |
Expand Down
26 changes: 0 additions & 26 deletions buildScripts/buildHtml.js

This file was deleted.

5 changes: 4 additions & 1 deletion buildScripts/generateMockData.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ import {schema} from './mockDataSchema';
import fs from 'fs';
import chalk from 'chalk';

const json = JSON.stringify(jsf(schema));
// With latest version of json-schema-faker, must explicitly extend JSF with the fake libs you want to use.
jsf.extend("faker", () => require("faker"));

const json = JSON.stringify(jsf.generate(schema));

fs.writeFile("./src/api/db.json", json, function (err) {
if (err) {
Expand Down
2 changes: 1 addition & 1 deletion buildScripts/testSetup.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This file isn't transpiled, so must use CommonJS and ES5

// Register babel to transpile before our tests run.
require('babel-register')();
require('@babel/register')();

// Disable webpack features that Mocha doesn't understand.
require.extensions['.css'] = function() {};
Loading