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

Update dependencies #7

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open

Update dependencies #7

wants to merge 23 commits into from

Conversation

coryhouse
Copy link
Owner

@coryhouse coryhouse commented Feb 20, 2017

Updated September 2020

The pull request shows how to update the course dev environment to use the latest dependency versions.

To try this:

  1. Clone the repo: git clone https://github.com/coryhouse/javascript-development-environment.git
  2. Checkout this branch: git checkout update-2019

}]
]
}
}
}
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.

@@ -15,6 +17,11 @@ export default {
filename: 'bundle.js'
},
plugins: [
new webpack.LoaderOptionsPlugin({
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.

Note that debug and noInfo are now handled here instead in Webpack 2+.

@coryhouse coryhouse changed the title Update to Webpack 2. Update dependencies. Update dependencies Oct 11, 2017
@@ -4,7 +4,7 @@ export default function getBaseUrl() {

function getQueryStringParameterByName(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
name = name.replace(/[[]]/g, "\\$&");
Copy link
Owner Author

Choose a reason for hiding this comment

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

Removing unnecessary escape characters

Repository owner deleted a comment from jcscott2015 Oct 31, 2017
@coryhouse
Copy link
Owner Author

@jcscott2015 - Thanks for the heads up - I updated the webpack.config syntax to use the latest style.

knbknb pushed a commit to knbknb/javascript-development-environment that referenced this pull request Aug 19, 2018
@augustin-colesnic
Copy link

after updating the files for Babel7, express used in srcServer.js does not recognize the get method.
Webstorm inspector shows this message: 'Unresolved function or method get()'

@coryhouse
Copy link
Owner Author

@baakaweb - I just pulled this branch down and it runs fine. I'm not running web storm, so can't say why you're seeing that message. But I do suggest deleting node_modules and reinstalling. After that, it should run fine.

const dom = new JSDOM(index);
const h1 = dom.window.document.getElementsByTagName("h1")[0];
expect(h1.innerHTML).to.equal("Users");
dom.window.close();
Copy link
Owner Author

Choose a reason for hiding this comment

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

The latest version of JSDOM doesn't use an env var and no longer requires calling done when complete. Instead, you instantiate JSDOM and receive a dom.

"mocha": "3.1.2",
"nock": "8.1.0",
"npm-run-all": "3.1.1",
"nsp": "2.6.2",
Copy link
Owner Author

Choose a reason for hiding this comment

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

Node security project (NSP) is now built into npm, so you don't need to reference it or call it manually anymore. 😀

@@ -4,11 +4,10 @@
"description": "JavaScript development environment Pluralsight course by Cory House",
"scripts": {
"prestart": "babel-node buildScripts/startMessage.js",
"start": "npm-run-all --parallel security-check open:src lint:watch test:watch start-mockapi",
"start": "npm-run-all --parallel open:src lint:watch test:watch start-mockapi",
Copy link
Owner Author

Choose a reason for hiding this comment

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

Node security project (NSP) is now built into npm, so you don't need to reference it or call it manually anymore. 😀

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.

None yet

3 participants