What’s new in WebStorm
WebStorm 2018.1 adds integration with Prettier, partial Git commits, better support for Vue.js and React Native, and completely redesigned documentation.
Meet the new, more compact and lightweight documentation popup!
In addition to the support for the latest TypeScript 2.7 features, this update improves the Implement Members action and adds the new Surround with type guard quick-fix for unresolved properties.
WebStorm now also recognizes TypeScript configuration files with names other than tsconfig.json.
Now if you run Refactor – Rename for a class, WebStorm will also suggest renaming the file and its usages if it has the same name as the class.
And if you press Alt-Enter on the name of the class, interface or type, you will see a new intention that suggests renaming the file to this name.
With the new Reformat with Prettier action (Alt-Shift-Cmd/Ctrl-P), you can format the selected code, a file or a whole directory using Prettier.
Note that Prettier should be installed as your project dependency or globally on your machine.
You can now create new Vue projects in WebStorm using Vue CLI.
Install it by running
npm install -g vue-cli, then press Create New Project
– Vue.js on the IDE’s Welcome screen, and answer questions about the template and tools
that you want to use in your new project.
Create a new Vue component from an existing one, without any copy and paste – select the part of the template and use Refactor – Extract or press Alt-Enter and select Extract Vue Component.
WebStorm will create a new single-file component, add an import for it, and pass all the data and methods to it with props.
With the updated React Native configuration, WebStorm now supports more run and debug scenarios: you can now separately configure how the bundler is started and also attach the debugger to an app that is already built and launched on a device.
Moreover, you can now debug apps that use Expo right in the IDE.
It has been made easier to configure package managers in WebStorm – in the Node.js and npm preferences, you can select between npm and Yarn and then use it to install dependencies and run scripts.
And if you open a new project with yarn.lock file, WebStorm will use Yarn in it if it’s installed.
Node.js debugger now has two console tabs – the Console tab that shows the output of the node
console.log messages, and jump to the location where
console.log was called.
With the support for partial Git commits you can now commit only selected changes from the file. Use checkboxes in the diff view of the Commit Changes dialog to select chunks of code you want to commit.
You can also add changed lines of code to a new changelist using actions on the editor gutter and then commit the changelist.
In the commit details, you can now click on the commit hash to jump to this commit in the Log.
When you’re doing a rebase, there are now new Abort Rebase, Continue Rebase, and Skip Commit actions available in the Git Branches popup.
Cmd/Ctrl-click on the class name in HTML will now suggest navigating not only to its declaration in the compiled CSS file linked in this HTML file, but also to the Sass, SCSS or Less source.
In HTML, code completion will suggest classes and id from all style sheets if there are no matching symbols in the linked CSS file.
classand on-event handlers with React-specific attributes.
Or if there’s no parent class yet, you can extract fields and methods to a superclass using the new Extract superclass refactoring.
The new Extract type alias refactoring for TypeScript allows you to create an alias for a complex type and automatically replace all its usages with the new name. There’s also a new intention to help you convert a type alias into an interface.
You can also create a new interface directly by using the new Extract interface refactoring.
The documentation available via F1 now also includes a brief description for methods, which either comes from the bundled definition files or is fetched from MDN.
This update brings lots of improvements to WebStorm’s support for Vue.js! Code completion and navigation to the definition now work for Vue props, properties in the data object, computed properties, and methods.
Closing curly braces are now added automatically in Vue templates.
WebStorm adds a collection of code snippets for Vue. These code templates can help you save time typing some frequently used blocks of code. With a new Vue file template, you can also create new components faster.
Jest integration has become even better! When running tests in the IDE, you can now use Jest’s own watch mode for faster re-runs.
Run tests with coverage to see the coverage report. Then jump to the file to check what lines of code are not tested, if any.
From the test window, update failing snapshots in just one click.
WebStorm introduces a new way to test APIs from the IDE. Now you can write HTTP requests in an .http file and then quickly run them with the icons on the editor gutter.
When you open a project, WebStorm will automatically import the supported code style rules from simple ESLint and TSLint configuration files.
Code completion for CSS properties and values has become more precise. It has added completion suggestions for values of transform, transition, and pointer-events properties that were missing before.
When you switch between branches, the IDE preserves your workspace, including the opened files, the current run configuration, and the breakpoints. This workspace will be automatically restored when you switch back to that branch.
Parameter hints show the names of parameters in methods and functions to make your code easier to read.
You can also see the inferred type for objects in TypeScript if you hold Cmd on macOS or Ctrl on Windows & Linux and hover over them.
Reply 'Yes' when prompted about this in the .eslintrc file, to apply the matched rules and make the IDE formatting more consistent with your ESLint configuration.
Call the Rearrange Code action or use it together with Reformat Code to make code more readable and consistent.
Support for Angular Material has gotten better: you can now use code completion and navigation for Material attributes, in addition to completion for components that was available before.
You can now run or debug a single test or a suite with Karma right from WebStorm, as opposed to running them all.
Simply click the icon next to the test in the editor and select Run or Debug. The icon will then show the test status.
Run Mocha tests with coverage and see the coverage reports created by Istanbul right in the IDE.
The report shows how many files are covered with tests and the percentage of covered lines in them. From the report you can jump to the file and see which exact lines were covered and which weren’t.
For Sass and SCSS selectors created using &, you can now use code completion in HTML files and navigate to the definition.
For the nested selector, you can quickly jump to the definition with Cmd-click / Ctrl+click.
WebStorm helps you keep your project’s dependencies up-to-date. Now when you open a project, update it from the version control or edit package.json, the IDE will prompt you to run `npm install` or `npm update`.