The Toolbox App is the easiest way to get the Beta builds and keep both them and your stable versions up to date. You can also manually download the Beta builds from our website.
Important! WebStorm Beta builds are not fully tested and might be unstable. Please try the latest build and share your feedback with us. You can do so using our issue tracker or by leaving a comment on this blog post.
JetBrains AI Assistant is advancing its line of models! We’ve added support for Claude 3.5 Sonnet and Claude 3.5 Haiku, now provisioned in Amazon Bedrock. This means you’ll benefit from sharper responses, faster insights, and an even smoother experience. AI Assistant’s lineup of OpenAI models now includes o1, o1-mini, and o3-mini.
Update: A new version of the JetBrains AI Assistant plugin has been released, bringing support for even more models, including:
• Claude 3.7 Sonnet
• OpenAI GPT-4.5
• Gemini 2.0 Flash
In addition to cloud-based models, you can now connect the AI chat to local models available through Ollama and LM Studio! You can set up local providers via Settings | Tools | AI Assistant | Custom Models:
For the 2025.1 release we have focused on improving AI-based completion in the context of web framework components. These changes affect local full line code completion as well as cloud-based completion suggestions:
AI-powered test generation now offers more careful framework detection, especially for cases when multiple frameworks are present. Additionally, generated tests respect naming conventions:
The engine previously known as WebStorm@next or the Use types from server option now has an official name – the service-powered type engine! We’re currently polishing it, with a focus on performance. A dedicated icon in the status bar displays the engine’s status, and you can granularly enable or disable it for supported frameworks or for TypeScript in general within the current project:
If you notice any degradations when the new engine is enabled, please use the Submit a bug report link.
WebStorm now supports code completion for host binding attributes based on directive selectors. Quick-fixes for creating fields are also available within binding expressions. Moreover, refactoring is supported across different locations and is even available for CSS classes:
The long-awaited support for Reactive Forms is here. This update includes code completion, syntax highlighting, validation, refactoring, and quick-fixes for Reactive Forms. Both declaration styles – constructor-based and builder-based – are fully supported.
There is also a new intention to extract or inline component templates. Invoke Show Context Actions (⌥⏎ (macOS) / Alt+Enter (Windows/Linux)) to use the action:
This release brings many other improvements and bug fixes for Angular beyond the features mentioned above.
WebStorm 2025.1 Beta introduces automatic run configuration creation for Next.js applications. Now, you can easily initiate debug sessions for both the client and server components of your Next.js application using the Run widget.
The New Project wizard now gives you the option to generate a new Nuxt project using the Nuxt CLI (nuxi
):
We’ve also implemented several bug fixes, including:
vue
are now resolved.__VLS_WithTemplateSlots
.In WebStorm 2025.1 Beta, invoking Show Context Actions (⌥⏎ (macOS) / Alt+Enter (Windows/Linux)) now opens the floating toolbar with different action groups. The toolbar also appears when you select code in the editor:
The floating toolbar contains the following actions and action groups:
You can customize the contents of the toolbar by opening the kebab menu (three vertical dots) and selecting the Customize Toolbar… option
Creating new files is now easier in the Project tool window. You can simply use the + icon located directly in the window’s toolbar:
WebStorm 2025.1 Beta introduces the following improvements for Prisma:
gql(query)
syntax support (WEB-71611)WebStorm now automatically detects and applies the nearest in the directory tree Prettier configuration when formatting files, ensuring the code style is consistent across subprojects. The Indentation status bar widget shows whether Prettier has modified the code style. The new dropdown menu offers the following options:
Code style changes made by Prettier are visible in the Code Style tab under Settings, where you can also disable automatic modifications.
A new setting controls whether WebStorm should use Prettier to auto-format code styles. This option is enabled by default. In case if .editorconfig
is present, Prettier takes precedence for files it handles, but if certain options aren’t specified in Prettier, EditorConfig settings still apply.
We are consistently working to improve reliability and performance in mono-repo setups. Here are some of the most noticable fixes in this build for long-standing issues:
package.json
export fields are now processed properly.package.json
exports are now used by auto-import in monorepos.That’s it for today. For the full list of improvements introduced throughout the latest 2025.1 EAPs, check out the release notes.
The WebStorm team
]]>Modern code editors need to understand your code to provide features like autocompletion, go to definition, or error detection. Traditionally, each editor needed to implement this understanding for every programming language, leading to duplicated effort and inconsistent experiences across editors.
The Language Server Protocol (LSP) solves this by standardizing how editors communicate with language-specific analysis tools. Here’s how it works:
// When you type this in your editor @Component({ template: ` <div *ngFor="let item of items"> {{ item.property }} </div> ` }) class MyComponent { }
Your editor sends the file content to the language server. The server analyzes it and might respond with:
{ "diagnostics": [{ "message": "Property 'property' does not exist on type 'any'", "range": { "start": {"line": 3, "character": 12}, "end": {"line": 3, "character": 20} } }] } // Your editor then shows the error underline
The Angular Language Server specifically provides Angular-aware code analysis, offering features like template type checking, component property completion, and Angular-specific refactorings to any editor that supports LSP.
The LSP has established itself as the standard for providing editor intelligence across different development environments. It enables consistent features like type checking, code completion, and navigation across any LSP-compatible editor:
@Component({ template: ` <div *ngFor="let item of items"> {{ item?.deeply?.nested?.property }} </div> ` }) class WhyTypeCheckingMatters { }
While the Angular compiler would catch these template errors during build time, the language server provides immediate feedback in your editor. This means you can spot and fix type errors as you write your code, without waiting for the compilation step.
VS Code’s integration with the Angular Language Server is seamless and intuitive. Here are some of the features that you’ll be able to use after installing the necessary plugin:
*ngFor
or @switch
.The best part? It’s all standardized. The same language server that powers VS Code can power any editor that speaks LSP.
Remember when Vim users had to type out every import statement manually? Pepperidge Farm remembers. Now, thanks to LSP, you get:
-- Neovim config that actually gives you IDE features require'lspconfig'.angularls.setup{ -- Look ma, real autocomplete! }
Neovim users now enjoy the same powerful features as VS Code users while keeping their beloved modal editing. It’s the best of both worlds – modern IDE features with an outstanding editing experience.
Language servers are great – they provide a consistent developer experience and guarantee correctness. However, the fact that language servers adhere to a standardized protocol means that they do have some limitations. For instance, even though most languages and frameworks have some kind of test support, the LSP is not aware of this concept, and, therefore, tests must be configured manually within the editor. This is also the case when working with debuggers, too.
Additionally, language servers generally look at the codebase on a “file by file” basis, and, more specifically, at the current cursor position. Generally speaking, this works great until it doesn’t… Implementing a multi-file refactoring, for instance, can be difficult (though not impossible). For this reason, extracting some HTML code into a new Angular component is not as straightforward as it might first sound. On top of that, language servers can usually only process one language at a time; therefore, refactoring a CSS class across languages can quickly become very cumbersome in a language server implementation. The Angular Language Server has a very clever trick for handling HTML and TypeScript, but more on that in the next section. CSS, on the other hand, doesn’t enjoy the same level of support.
What’s more, adding further support for parts that don’t have dedicated compiler functionality is difficult to accomplish. One such example would be IntelliSense for the host property of the component decorator.
Now, here’s where things get interesting. WebStorm and other JetBrains IDEs take a different approach, and it’s not just about being contrarian. For the last few years, the Angular plugin has been pre-installed with WebStorm. As of now, this plugin does not utilize the Angular Language Server, but a custom-type engine. As part of our new Service-powered type engine (more about this in the future), we made some major changes to our Angular integration. Instead of using the entire Angular Language Server, WebStorm adopted Angular’s TCB (type-check block) engine, an integral part of the Angular Language Server. For more details, you can check out this talk at NG DE, but in short, the Angular Language Server converts the HTML code into TypeScript code and uses the generated TypeScript code to map errors and IntelliSense features back to the cursor position in the original HTML file. The screenshot below visualizes this concept.
See how this.counter
is used in the template, which gets converted to the function _tcb1
on the right side, but isn’t properly declared in TestComponent
.
You might now be asking, why doesn’t WebStorm just use the Angular Language Server? Well, it turns out template type checking is just one piece of the IDE puzzle. WebStorm’s architecture already handles most of what the Angular Language Server provides:
Furthermore, it offers parts of functionality that our users appreciate and that are not offered by the language server:
So what does this mean for you, the developer, just trying to get work done?
The Angular Language Server continues to evolve, making developers’ lives easier. Meanwhile, WebStorm’s specialized approach shows that there’s more than one way to achieve excellent Angular support.
]]>If you only have a few minutes to explore the highlights of WebStorm 2024.3, check out our quick review video above for the top highlights. If you want to dive deeper into what you can expect in the release, just carry on reading!
The new features and improvements in v2024.3 include:
WebStorm 2024.3 now supports the Show component usages action for Vue, Svelte, and Astro and detects component usages both in imports and templates. You can also use this functionality by invoking the Find Usages action on the component file in the Project view:
The Rename refactoring has also been enhanced to include component usages renaming. When renaming a component file or explicitly defined name, the associated usages in templates will also be updated! This behavior can be disabled by toggling the Search for component usages option during the renaming process and in the Find dialog.
The Database Tools and SQL plugin, which was previously only available via a separate paid subscription, is now bundled with WebStorm at no extra cost. You can query, create, and manage databases directly in the IDE. This extends WebStorm’s capabilities for backend and full-stack development. It also makes switching between JetBrains IDEs easier, as most of them include this functionality.
WebStorm 2024.3 has significantly improved AI-driven code completion for JavaScript and TypeScript. The new approach combines fast, local full-line completion with powerful cloud-based suggestions powered by JetBrains’ in-house LLMs. This hybrid approach enhances speed, accuracy, and usability while reducing the frequency of lengthy and irrelevant suggestions.
Here are some of the key improvements:
Completion suggestions are now provided in more locations, and are now triggered during typing, not only on Enter keystrokes. Support for AI-based code completion has also been extended to HTML and CSS (including .css
, .less
, .scss
, .sass
, .pcss
). Please refer to this blog post for more insights.
In WebStorm 2024.3, color previews for Tailwind CSS classes are now shown inline in the editor. We’ve added support for the textDocument/documentColor
method of the Language Server Protocol (LSP), so all LSP-based plugins now support this functionality out of the box.
For projects with Angular 19, WebStorm now defaults to standalone mode for components, directives, and pipes. Quick-fixes have been added to help convert between standalone and non-standalone components. Unused standalone imports can be automatically removed during code reformatting or via a new inspection. Support for the @let
syntax has also been improved.
.prettierignore
in subfolders WebStorm 2024.3 now properly handles .prettierignore
files in subfolders with a package.json
, ensuring ignored files aren’t formatted. A new option also lets you specify custom ignore files in Settings | Languages & Frameworks | JavaScript | Prettier.
The Vue Language Server is now bundled with WebStorm to enhance reliability and prevent issues with loading on WSL. We may do the same for Svelte, Astro, and other technologies in the future.
WebStorm 2024.3 provides support for the <script module>
attribute, ensuring symbols from these blocks are resolved correctly. Additionally, there’s a new checkbox to disable SvelteKit a11y warnings, giving you more control over accessibility warnings.
package.json
WebStorm 2024.3 includes support for the exports
field in package.json
for CSS, Sass, SCSS, and Less. If styles are exported via package.json
, WebStorm will no longer show warnings about unresolved variables.
Basic Bun debugging, previously available only on macOS and Linux, is now supported on Windows. You can set breakpoints, step through code, inspect variables, and evaluate expressions within WebStorm.
We’ve optimized the placement of the Rename action in the context menu when it’s called on elements in the editor and the Project tool window. The action is now at the top level, making it easier to quickly rename files, variables, and other elements.
WebStorm now excludes node_modules
results by default when using Find in Files in project directories, reducing clutter from irrelevant files. You can restore the previous behavior by enabling the Search in library files when “Directory” is selected in Find in Files option under Settings | Advanced Settings.
By default, WebStorm will now automatically highlight all instances of the text you select within a file. This makes it easier to track where your selected text appears throughout your code. You can customize the feature in Settings | Editor | General | Appearance.
.idea
directory displayed by defaultPreviously, the .idea
folder – a place where WebStorm stores internal configuration settings – was hidden by default. This made it harder for some users to commit project-wide configurations. To address this, we’ve made it visible in the Project tool window.
WebStorm 2024.3 will automatically exclude unnecessary files in the dist
folder from indexing to optimize CPU usage and decrease indexing time.
We’ve improved the reliability of projects that are hosted on WSL and opened from Windows in WebStorm. In particular, support for symlinks has been added, and interaction with WSL has been switched to Hyper-V sockets, which has improved the performance of IDE interaction with WSL.
When you open or update your project, WebStorm indexes it, making some features temporarily inaccessible. We’re working to improve this by allowing more functionality during indexing. With this update, Search Everywhere (Shift+Shift) now works for already indexed parts of the project, along with spelling and grammar checks.
You can now manage background checks during the commit process with a new option under Settings | Version Control | Commit | Advanced Commit Checks | Run advanced checks after a commit is done. This setting lets you decide if tests and inspections should run after making a commit. If you want to wait for these checks to complete, simply disable this option.
WebStorm 2024.3 adds support for new Docker Compose attributes that give you better control over builds, resource management, service orchestration, and networking within Docker Compose, making development more efficient and flexible.
We’ve improved the compatibility of Dev Container templates, which weren’t originally designed to operate in remote environments. Previously, Dev Container templates often included configurations that assumed local execution, leading to issues when running containers on remote Docker instances. Now, WebStorm ensures that templates that are not optimized for remote use still function correctly.
There are lots of new improvements and enhancements to try out in this latest WebStorm release. If you’d like a list of everything included in WebStorm 2024.3, please check out the release notes. We hope you enjoy this release. As always, please share your feedback with us and report any issues you find to our issue tracker.
The WebStorm team
]]>The Toolbox App is the easiest way to get the EAP builds and keep both your stable and EAP versions up to date. You can also manually download the EAP builds from our website.
Important! WebStorm EAP builds are not fully tested and might be unstable. Please try the latest EAP build and share your feedback with us. You can do so using our issue tracker or by leaving a comment on this blog post.
Starting from version 2024.3, the Show component usages action for Vue, Svelte, and Astro detects component usages both in imports and templates. You can also use this functionality by invoking the Find Usages action on the component file in the Project view:
The Rename refactoring has been enhanced to include component usages renaming. When renaming a component file or explicitly defined name, the associated usages in templates will also be updated! This behavior can be disabled by toggling the Search for component usages option during the renaming process and in the Find dialog.
In 2024.3 we are significantly improving AI-driven code completion for JavaScript and TypeScript. The new approach combines fast, local full-line completion with powerful cloud-based suggestions powered by JetBrains’ in-house LLMs. This hybrid approach enhances speed, accuracy, and usability while reducing the frequency of lengthy and irrelevant suggestions.
Here are some of the key improvements:
Completion suggestions are now provided in more locations, and are now triggered during typing, not only on Enter keystrokes.
In EAP 3, support for AI-based code completion has also been extended to HTML and CSS (including .css, .less, .scss, .sass, .pcss). Please refer to this blog post for more insights.
You can now interact with AI Assistant directly in the editor thanks to an experimental inline input feature that detects and processes your requests as you type. This lets you express your intentions in natural language, which AI Assistant instantly interprets and converts into code changes without any extra steps. This feature is currently available for JavaScript and TypeScript:
The IDE leaves a purple mark in the gutter next to lines added or changed by AI Assistant so you can easily see what has been updated.
If you don’t like the initial suggestion, you can generate a new one by pressing Tab. You can also adjust the initial prompt by clicking on the purple block in the gutter or simply pressing Ctrl + / (Windows/Linux) or ⌘/ (macOS).
Please note that these improvements are available only when using the AI Assistant plugin.
Color previews for Tailwind CSS classes are now shown inline in the editor. We’ve added support for the textDocument/documentColor method of the Language Server Protocol (LSP), so all LSP-based plugins now support this functionality out of the box.
In EAP 2, we’ve introduced Bun debugger support for Windows. This update includes program traversal (Step Into, Step Over, and Run to Cursor), expression evaluation, and support for line breakpoints, exceptions, and conditional breakpoints.
Bun debugger support is currently unavailable on WSL. If you would like to see it added, consider voting for WEB-69167.
We have implemented new code style options for decorators in JavaScript and TypeScript. EAP 1 introduces four new items in the Wrapping and Braces subsection of the Code Style settings:
The Find in Files feature has a new search scope option: Project Files Excluding Git-Ignored. This option excludes any files ignored in .gitignore
from your search results, helping you narrow down the search scope to the relevant parts of your project.
By default, WebStorm will now automatically highlight all instances of the text you select within a file. You can toggle this feature in Settings | Editor | General | Appearance.
That’s it for today. For the full list of improvements introduced throughout the latest 2024.3 EAPs, check out the release notes.
The WebStorm team
]]>The project where you write code can have its own strict rules. Project rules are more relevant than any suggestion from any best practice article – this one included! If you would like to use a specific practice, make sure to sync it with the project rules and codebase and that everyone on your team is also on board.
JavaScript was invented on December 4, 1995. Since that time, it has been almost endlessly evolving. On the Internet, you can find a lot of outdated suggestions and practices. Be careful and verify if a practice that you would like to use is up to date.
Also, be careful when using the very latest JavaScript features. It is better to start using new JavaScript features that have been through at least Ecma TC39 Stage 3.
That said, here is a compilation of some of the current common best practices for JavaScript all in one place:
You may encounter code that uses many var declarations. This may be on purpose, but if it is old code, it could be because this was the old approach.
Advice: Use let
and const
instead of var
to declare your variables.
Why it matters: Although var
is still available, let
and const
provide block-scoping, which is more predictable and reduces unexpected errors that can happen when declaring variables with var
, which is function-scoped.
for (let j = 1; j < 5; j++) { console.log(j); } console.log(j); // you get 'Uncaught ReferenceError: j is not defined' //If we did this using var: for (var j = 1; j < 5; j++) { console.log(j); } // <-- logs the numbers 1 to 4 console.log(j); //You’d get 5 as it still exists outside the loop
In many old codebases or articles about OOP in JavaScript, you may run into the function prototype approach for emulation of classes. For example:
function Person(name) { this.name = name; } Person.prototype.getName = function () { return this.name; } const p = new Person('A'); console.log(p.getName()); // 'A'
Advice: This approach uses constructors to control the prototype chain. However, in such cases, using classes is almost always better.
class Person { constructor(name) { this.name = name; } getName() { return this.name; } } const p = new Person('A'); console.log(p.getName()); // 'A'
Why it matters: The main reason to use classes is that they have much cleaner syntax.
In older JavaScript code, it was common to use an underscore (_
) as a convention to denote private properties or methods in classes. However, this doesn’t actually enforce privacy – it just serves as a signal to developers that something is meant to be private.
class Person { constructor(name) { this._name = name; // Conventionally treated as private, but not truly private } getName() { return this._name; } } const p = new Person('A'); console.log(p.getName()); // 'A' console.log(p._name); // 'A' (still accessible from outside)
Advice: When you really need private fields in classes, JavaScript now has real private fields using the #
syntax. This is an official language feature that enforces true privacy.
class Person { #name constructor(name) { this.#name = name; } getName() { return this.#name } } const p = new Person('A'); console.log(p.getName()); // 'A'
Why it matters: Using real private fields ensures that the data is truly encapsulated, preventing accidental or malicious access from outside the class. The underscore convention only provides a visual cue and can easily be misused, while #
private fields guarantee privacy by design. This results in more robust and maintainable code.
Arrow functions are often used to make callback functions or anonymous functions more concise and readable. They are especially useful when working with higher-order functions like map
, filter
, or reduce
.
const numbers = [1, 2]; // Using arrow function numbers.map(num => num * 2); // Instead of numbers.map(function (num) { return num * 2; });
Advice: Arrow functions provide a more concise syntax, especially when the function body is a single expression. They also automatically bind the this
context, which can be particularly helpful in class methods where this can easily get lost.
Consider this example with a class:
class Person { name = 'A'; // Arrow function retains the 'this' context getName = () => this.name; } const getName = new Person().getName; console.log(getName()); // 'A'
Why it matters: Arrow functions enhance readability by removing boilerplate code, making callback functions and inline expressions much more concise. In addition, they are particularly valuable when working with classes or event handlers, as they automatically bind this
to the surrounding lexical scope. This avoids common bugs related to this
in traditional function expressions, especially in asynchronous or callback-heavy code.
In JavaScript, developers have often used the logical OR (||
) operator to assign default values when a variable is undefined
or null
. However, this can behave unexpectedly when the variable holds values like 0
, false
, or an empty string (""
), because ||
treats them as falsy and substitutes the default value.
For example:
const value = 0; const result = value || 10; console.log(result); // 10 (unexpected if 0 is a valid value)
Advice: Use the nullish coalescing operator (??
) instead of ||
when resolving default values. It only checks for null
or undefined
, leaving other falsy values (like 0
, false
, ""
) intact.
const value = 0; const result = value ?? 10; console.log(result); // 0 (expected behavior)
Why it matters: The ??
operator provides a more precise way of handling default values in cases where null
or undefined
should trigger the fallback. It prevents errors caused by using ||
, which may unintentionally override valid falsy values. Using nullish coalescing results in more predictable behavior, improving both code clarity and reliability.
?.
):When dealing with deeply nested objects or arrays, it’s common to have to check whether each property or array element exists before trying to access the next level. Without optional chaining, this requires verbose and repetitive code.
For example:
const product = {}; // Without optional chaining const tax = (product.price && product.price.tax) ?? undefined;
Advice: The optional chaining operator (?.) simplifies this process by automatically checking if a property or method exists before attempting to access it. If any part of the chain is null or undefined, it will return undefined rather than throwing an error.
const product = {}; // Using optional chaining const tax = product?.price?.tax;
Why it matters: Optional chaining reduces the amount of boilerplate code and makes it easier to work with deeply nested structures. It ensures your code is cleaner and less error-prone by handling null
or undefined
values gracefully, without the need for multiple checks. This leads to more readable and maintainable code, especially when working with dynamic data or complex objects.
async/await
In older JavaScript, handling asynchronous operations often relied on callbacks or chaining promises, which could quickly lead to complex, hard-to-read code. For example, using .then()
for promise chaining could make the flow harder to follow, especially with multiple asynchronous operations:
function fetchData() { return fetch('https://api.example.com/data') .then(response => response.json()) .then(data => { console.log(data); }) .catch(error => { console.error(error); }); }
Advice: Use async
and await
to make your asynchronous code look more like regular, synchronous code. This improves readability and makes error handling easier with try...catch
.
async function fetchData() { try { const response = await fetch('https://api.example.com/data'); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } }
Why it matters: The async/await
syntax simplifies working with asynchronous operations by removing the need for chaining .then()
and .catch()
. It makes your code more readable, more maintainable, and easier to follow, especially when dealing with multiple async calls. Error handling is also more straightforward with try...catch
, leading to cleaner and more predictable logic.
In older JavaScript code, interacting with the keys and values of an object often involved manual looping with for...in
or Object.keys()
, followed by accessing values through bracket notation or dot notation. This can lead to verbose and less intuitive code.
const obj = { a: 1, b: 2, c: 3 }; // Older approach with Object.keys() Object.keys(obj).forEach(key => { console.log(key, obj[key]); });
Advice: Use modern methods such as Object.entries()
, Object.values()
, and Object.keys()
for working with object keys and values. These methods simplify the process and return useful structures like arrays, making your code more concise and easier to work with.
const obj = { a: 1, b: 2, c: 3 }; // Using Object.entries() to iterate over key-value pairs Object.entries(obj).forEach(([key, value]) => { console.log(key, value); }); // Using Object.values() to work directly with values Object.values(obj).forEach(value => { console.log(value); });
Why it matters: Using modern object methods such as Object.entries()
, Object.values()
, and Object.keys()
results in cleaner, more readable code. These methods reduce the amount of boilerplate needed for iterating over objects and improve code clarity, especially when dealing with complex or dynamic data structures. They also support easier transformations of objects into other forms (e.g. arrays), making data manipulation more flexible and efficient.
In the past, developers used various non-straightforward methods to check if a variable was an array. These included approaches like checking the constructor or using instanceof
, but they were often unreliable, especially when dealing with different execution contexts (like iframes
).
const arr = [1, 2, 3]; // Older approach console.log(arr instanceof Array); // true, but not always reliable across different contexts
Advice: Use the modern Array.isArray()
method, which provides a simple and reliable way to check whether a variable is an array. This method works consistently across different environments and execution contexts.
const arr = [1, 2, 3]; console.log(Array.isArray(arr)); // true
Why it matters: Array.isArray()
is a clear, readable, and reliable way to check for arrays. It eliminates the need for verbose or error-prone methods like instanceof
, ensuring your code handles array detection correctly, even in complex or cross-environment scenarios. This leads to fewer bugs and more predictable behavior when working with different types of data structures.
Map
In earlier JavaScript, developers often used plain objects to map keys to values. However, this approach has limitations, especially when keys are not strings or symbols. Plain objects can only use strings or symbols as keys, so if you need to map non-primitive objects (like arrays or other objects) to values, it becomes cumbersome and error-prone.
const obj = {}; const key = { id: 1 }; // Trying to use a non-primitive object as a key obj[key] = 'value'; console.log(obj); // Object automatically converts key to a string: '[object Object]: value'
Advice: Use Map
when you need to map non-primitive objects or when a more robust data structure is required. Unlike plain objects, Map
allows any type of value – primitives and non-primitives alike – as keys.
const map = new Map(); const key = { id: 1 }; // Using a non-primitive object as a key in a Map map.set(key, 'value'); console.log(map.get(key)); // 'value'
Why it matters: Map
is a more flexible and predictable way of associating values with any kind of key, whether primitive or non-primitive. It preserves the type and order of keys, unlike plain objects, which convert keys to strings. This leads to more powerful and efficient handling of key-value pairs, especially when working with complex data or when you need fast lookups in larger collections.
In JavaScript, objects are typically used to store key-value pairs. However, when you need to add “hidden” or unique values to an object without risking name collisions with other properties, or you want to keep them somewhat private from external code, using Symbol
can be very helpful. Symbols create unique keys that are not accessible via normal enumeration or accidental property lookup.
const obj = { name: 'Alice' }; const hiddenKey = Symbol('hidden'); obj[hiddenKey] = 'Secret Value'; console.log(obj.name); // 'Alice' console.log(obj[hiddenKey]); // 'Secret Value'
Advice: Use Symbol
when you want to add non-enumerable, hidden properties to an object. Symbols are not accessible during typical object operations like for...in
loops or Object.keys()
, making them perfect for internal or private data that shouldn’t be exposed accidentally.
const obj = { name: 'Alice' }; const hiddenKey = Symbol('hidden'); obj[hiddenKey] = 'Secret Value'; console.log(Object.keys(obj)); // ['name'] (Symbol keys won't appear) console.log(Object.getOwnPropertySymbols(obj)); // [Symbol(hidden)] (accessible only if specifically retrieved)
Why it matters: Symbols allow you to safely add unique and “hidden” properties to objects without worrying about key collisions or exposing internal details to other parts of the codebase. They can be especially useful in libraries or frameworks where you might need to store metadata or internal states without affecting or interfering with other properties. This ensures better encapsulation and reduces the risk of accidental overwrites or misuse.
Intl
API before using extra formatting librariesIn the past, developers often relied on third-party libraries for tasks like formatting dates, numbers, and currencies to suit different locales. While these libraries provide powerful functionality, they add extra weight to your project and may duplicate features already built into JavaScript.
// Using a library for currency formatting const amount = 123456.78; // formatLibrary.formatCurrency(amount, 'USD');
Advice: Before reaching for an external library, consider using the built-in ECMAScript Internationalization API (Intl
). It provides robust out-of-the-box functionality for formatting dates, numbers, currencies, and more based on locale. This can often cover most of your internationalization and localization needs without the extra overhead of third-party libraries.
const amount = 123456.78; // Using Intl.NumberFormat for currency formatting const formatter = new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }); console.log(formatter.format(amount)); // $123,456.78
You can also use it for dates:
const date = new Date(); const dateFormatter = new Intl.DateTimeFormat('en-GB', { year: 'numeric', month: 'long', day: 'numeric' }); console.log(dateFormatter.format(date)); // "15 October 2024"
Why it matters: The Intl
API provides native and highly optimized support for internationalization, making it unnecessary to import large libraries for simple formatting needs. By using built-in features, you can keep your project lightweight, reduce dependencies, and still offer comprehensive locale-based formatting solutions. This not only improves performance but also reduces the maintenance burden associated with third-party libraries.
Now, let’s look at some common practices that should be best practices.
===
) if possibleOne of the trickiest and most surprising behaviors in JavaScript comes from the loose equality operator (==
). It performs type coercion, which means it tries to convert operands to the same type before comparing them. This can lead to strange and unexpected results, as demonstrated in the famous “WTFJS” cases from talks like Brian Leroux’s:
console.log([] == ![]); // true (this is surprising!)
In this case, the loose equality operator (==
) converts both sides in unexpected ways, leading to unintuitive results.
Advice: Whenever possible, use strict equality (===
) instead of loose equality (==
). Strict equality does not perform type coercion – it compares both value and type directly, which leads to more predictable and reliable behavior.
console.log([] === ![]); // false (as expected)
Here’s a more typical example to highlight the difference:
// Loose equality (==) performs type coercion console.log(0 == ''); // true // Strict equality (===) compares both value and type console.log(0 === ''); // false (as expected)
Why it matters: Using strict equality (===
) helps avoid the unexpected behavior that comes with type coercion in JavaScript. It makes comparisons more predictable and reduces the risk of subtle bugs, especially when dealing with different data types like numbers, strings, or booleans. It’s a good practice to default to ===
unless you have a specific reason to use loose equality and understand the implications.
if
statements:In JavaScript, the if statement implicitly converts the result of the expression it evaluates into a “truthy” or “falsy” value. This means that values like 0
, ""
(empty string), null
, undefined
, and false
are all treated as falsy, while most other values (even things like []
or {}
) are truthy. This implicit casting can sometimes lead to unexpected results if you’re not careful.
For example:
const value = 0; if (value) { console.log('This will not run because 0 is falsy.'); }
Advice: It’s a good practice to make the conditions in if statements explicit, especially when the values you’re working with might not behave as expected in a truthy/falsy evaluation. This makes the code more predictable and easier to understand.
For instance, instead of relying on implicit type coercion:
const value = 0; // Implicit check (may behave unexpectedly for some values) if (value) { console.log('This won’t run'); }
You can use explicit conditions:
// Explicitly check for the type or value you expect if (value !== 0) { console.log('This will run only if value is not 0.'); }
Or, when checking for null
or undefined
:
const name = null; if (name != null) { // Explicitly checking for null or undefined console.log('Name is defined'); } else { console.log('Name is null or undefined'); }
Why it matters: By explicitly defining the conditions in your if
statements, you reduce the chances of unexpected behavior from JavaScript’s automatic type coercion. This makes your code clearer and helps prevent bugs when working with potentially ambiguous values like 0
, false
, null
, or ""
. It’s a good practice to be explicit about what conditions you’re checking for, especially in complex logic.
Number
for sensitive calculationsJavaScript’s built-in Number
type is a floating-point number based on the IEEE 754 standard. While this is efficient for most purposes, it can lead to surprising inaccuracies, particularly with decimal arithmetic. This is not a problem specific to JavaScript, but it can cause serious issues when you’re working with sensitive data such as financial calculations.
For example, you might encounter this famous floating-point problem:
console.log(0.1 + 0.2); // 0.30000000000000004
Advice: When precision is critical – such as in financial calculations – avoid using the standard Number
type for arithmetic. Instead, use specialized libraries like decimal.js
or big.js
that are designed to handle precise decimal calculations without floating-point errors.
Here’s how it works with a library like decimal.js
:
const Decimal = require('decimal.js'); const result = new Decimal(0.1).plus(0.2); console.log(result.toString()); // '0.3'
These libraries ensure that the calculations are precise and that rounding errors won’t impact the result, making them ideal for sensitive tasks like handling money.
Why it matters: Inaccurate calculations can lead to serious issues when working with things like financial data, where even tiny discrepancies matter. JavaScript’s floating-point math can produce unexpected results, and while improvements are being made to the language, for now, it’s best to rely on libraries like decimal.js
or big.js
to ensure precision. By using these libraries, you avoid common pitfalls and ensure that your calculations are accurate, trustworthy, and suitable for critical applications.
JavaScript has limits when it comes to handling very large numbers. The maximum safe integer in JavaScript is 9007199254740991
(also known as Number.MAX_SAFE_INTEGER
). Numbers larger than this may lose precision and produce incorrect results. This becomes a problem when working with APIs or systems outside of JavaScript, where big numbers – such as database id
fields – can easily exceed JavaScript’s safe range.
For example, when parsing JSON with a large number:
console.log( JSON.parse('{"id": 9007199254740999}') ); // Output: { id: 9007199254741000 } (Precision lost)
Advice: To avoid this precision issue when dealing with large numbers from JSON data, you can use the reviver
parameter of JSON.parse()
. This allows you to manually handle specific values – like id
fields – and preserve them in a safe format, such as strings.
console.log( JSON.parse( '{"id": 9007199254740999}', (key, value, ctx) => { if (key === 'id') { return ctx.source; // Preserve the original value as a string } return value; } ) ); // Output: { id: '9007199254740999' }
Using BigInt: JavaScript introduced BigInt
to safely work with numbers larger than Number.MAX_SAFE_INTEGER
. However, BigInt cannot be directly serialized to JSON. If you attempt to stringify an object containing BigInt
, you’ll get a TypeError
:
const data = { id: 9007199254740999n }; try { JSON.stringify(data); } catch (e) { console.log(e.message); // 'Do not know how to serialize a BigInt' }
To handle this, use the replacer parameter in JSON.stringify()
to convert BigInt
values to strings:
const data = { id: 9007199254740999n }; console.log( JSON.stringify(data, (key, value) => { if (typeof value === 'bigint') { return value.toString() + 'n'; // Append 'n' to denote BigInt } return value; }) ); // Output: {"id":"9007199254740999n"}
⚠️ Important consideration: If you use these techniques for handling large integers with JSON, ensure that both the client and server sides of your application agree on how to serialize and deserialize the data. For example, if the server sends an id
as a string or BigInt
with a specific format, the client must be prepared to handle that format during deserialization.
Why it matters: JavaScript’s number precision limits can lead to serious bugs when working with large numbers from external systems. By using techniques like BigInt
and the reviver/replacer
parameters of JSON.parse()
and JSON.stringify()
, you can ensure that large integers are handled correctly, avoiding data corruption. This is especially important in cases where precision is crucial, such as dealing with large ids or financial transactions.
When working with JavaScript, functions and object signatures often lack documentation, making it harder for other developers (or even your future self) to understand what parameters and objects contain or how a function should be used. Without proper documentation, code can be ambiguous, especially if object structures aren’t clear:
For example:
const printFullUserName = user => // Does user have the `middleName` or `surName`? `${user.firstName} ${user.lastName}`;
In this case, without any documentation, it’s not immediately clear what properties the user object should have. Does user
contain middleName
? Should surName
be used instead of lastName
?
Advice: By using JSDoc, you can define the expected structure of objects, function parameters, and return types. This makes it easier for code readers to understand the function and also helps code editors provide better autocompletion, type checking, and tooltips.
Here’s how you can improve the previous example with JSDoc:
/** * @typedef {Object} User * @property {string} firstName * @property {string} [middleName] // Optional property * @property {string} lastName */ /** * Prints the full name of a user. * @param {User} user - The user object containing name details. * @return {string} - The full name of the user. */ const printFullUserName = user => `${user.firstName} ${user.middleName ? user.middleName + ' ' : ''}${user.lastName}`;
Why it matters: JSDoc improves the readability and maintainability of your code by clearly indicating what types of values are expected in functions or objects. It also enhances the developer experience by enabling autocompletion and type-checking in many editors and IDEs, such as Visual Studio Code or WebStorm. This reduces the likelihood of bugs and makes it easier for new developers to onboard and understand the code.
With JSDoc, editors can provide hints, autocompletion for object properties, and even warn developers when they misuse a function or provide the wrong parameter type, making your code both more understandable and robust.
As your codebase grows, manually verifying that new changes don’t break important functionality becomes time-consuming and error-prone. Automated testing helps ensure that your code works as expected and allows you to make changes with confidence.
In the JavaScript ecosystem, there are many testing frameworks available, but as of Node.js version 20, you no longer need an external framework to start writing and running tests. Node.js now includes a built-in stable test runner.
Here’s a simple example using Node.js’s built-in test runner:
import { test } from 'node:test'; import { equal } from 'node:assert'; // A simple function to test const sum = (a, b) => a + b; // Writing a test for the sum function test('sum', () => { equal(sum(1, 1), 2); // Should return true if 1 + 1 equals 2 });
You can run this test with the following command:
node --test
This built-in solution simplifies the process of writing and running tests in Node.js environments. You no longer need to configure or install additional tools like Jest or Mocha, though those options are still great for larger projects.
E2E testing in browsers: For end-to-end (E2E) testing in browsers, Playwright is an excellent tool that allows you to easily automate and test interactions within the browser. With Playwright, you can test user flows, simulate interactions across multiple browsers (such as Chrome, Firefox, and Safari), and ensure that your app behaves as expected from the user’s perspective.
Other environments: Bun and Deno, two alternative JavaScript runtimes, also provide built-in test runners similar to Node.js, making it easy to write and run tests without extra setup.
Why it matters: Writing tests saves time in the long run by catching bugs early and reducing the need for manual testing after every change. It also gives you confidence that the new features or refactoring won’t introduce regressions. The fact that modern runtimes like Node.js, Bun, and Deno include built-in test runners means you can start writing tests right away, with minimal setup. Testing tools like Playwright help ensure your application works seamlessly in real-world browser environments, adding an extra layer of assurance for critical user interactions.
Though this may seem like a lot to take in. Hopefully, it has given you insight into some areas that you haven’t otherwise considered and would like to implement into your JavaScript projects. Again, feel free to bookmark this and come back to it anytime you need to refer to it. JavaScript conventions are constantly changing and evolving, as are the frameworks. Keeping up with the latest tools and best practices will continuously improve and optimize your code, but it can be difficult to do. We’d recommend following along with what is going on in the ECMAScript releases, as this often points to new conventions that are then generally adopted in the latest JavaScript code. TC39 usually has proposals for the latest ECMAScript versions, which you can follow along with too.
By embracing these modern JavaScript best practices, you’re not just writing code that works – you’re creating cleaner, more efficient, and more maintainable solutions. Whether it’s using newer syntax like async/await
, avoiding pitfalls with floating-point numbers, or leveraging the powerful Intl
API, these practices will help you stay up-to-date and confident in your codebase. As the JavaScript ecosystem continues to evolve, taking the time to adopt best practices now will save you from future headaches and set you up for long-term success.
That’s it for today! We hope that this has been useful – the comments are open for questions, discussions, and sharing advice. Happy coding!
]]>Read on to learn more about the change and why we’re making it, and be sure to check out the FAQ section below for additional details.
Earlier this year, we implemented a new licensing model for our recently introduced IDEs, RustRover and Aqua, making them free for non-commercial use. We’re now extending this model to WebStorm and Rider. If you’re using these IDEs for non-commercial purposes, such as learning, open-source project development, content creation, or hobby development, you can now do so for free.
For commercial projects, nothing will change – our existing licensing remains in place. Other JetBrains IDEs are not affected by this update, either. We’ll evaluate the outcomes of this free non-commercial licensing initiative to see if it can be expanded.
In making non-commercial development free, we aim to make JetBrains IDEs more accessible to a broader audience. We hope the new licensing model will further lower the barrier to using our IDEs, helping you learn, grow, and stay creative.
We’ve explored various ways to achieve this goal. As many of you have asked for more community editions, this was one of the possible options that we considered. However, JetBrains IDEs often have monolithic functionality, with all features deeply integrated and essential for productive work. Creating additional community editions would risk offering a feature set that doesn’t meet the needs of the many different types of users we have.
According to various surveys like Stack Overflow, 68% of developers code outside of work as a hobby, and nearly 40% for professional growth or self-paced learning. This share is even higher for game and web development. For example, game developers often begin their careers by creating games as a hobby, using free game engines. This inspired our choice to apply the new licensing model to WebStorm and Rider.
As defined in the Toolbox Subscription Agreement for Non-Commercial Use, commercial use means developing products and earning commercial benefits from your activities. However, certain categories are explicitly excluded from this definition. Common examples of non-commercial uses include learning and self-education, open-source contributions without earning commercial benefits, any form of content creation, and hobby development.
It’s important to note that, if you’re using a non-commercial license, you cannot opt out of the collection of anonymous usage statistics. We use this information to improve our products. The data we collect is exclusively that of anonymous feature usages of our IDEs. It is focused on what actions are performed and what types of functionality of the IDE are used. We do not collect any other data. This is similar to our Early Access Program (EAP) and is in compliance with our Privacy Policy.
Below are answers to some other related questions. If you don’t find an answer to your question, feel free to leave a comment or contact sales@jetbrains.com.
With the new non-commercial license type, you can enjoy a full-featured IDE that is identical to its paid version. The only difference is in the Code With Me feature – you get Code With Me Community with your free license.
Yes, RustRover and Aqua follow the same guidelines for non-commercial use. They previously had slightly different criteria for certain use cases, but we’ve updated them to align with the licensing model used for WebStorm and Rider.
If you intend to use Rider or WebStorm for commercial development for which you will receive direct or indirect commercial advantage or monetary compensation within the meaning of the definitions provided in the Toolbox Subscription Agreement for Non-Commercial Use, you will need to purchase a commercial subscription (either individual or organizational). This license can then also be used for non-commercial development.
If you plan to release the product and get commercial benefits from it, either now or in the future, you should use a commercial license. If your project is for non-commercial purposes, then a non-commercial license is valid. However, if your intentions change over time, you’ll need to reassess whether you still qualify for non-commercial use. If you’re unsure after considering your intentions, it’s safer to choose a commercial license.
If you’re working and receiving payment, even if your employer doesn’t receive commercial benefits from the end product, such as in a non-profit organization, you should be using a commercial license. For startups and non-profit organizations, we have separate offers mentioned on this page.
With the non-commercial license agreement, you can create any type of content, even if it involves receiving commercial benefits. Here are some examples of such content creation:
Don’t worry, this new license type will not impact any of our other paid subscription options. You’ll still be able to purchase personal and organizational subscriptions for WebStorm, Rider, dotUltimate, and the All Products Pack with exactly the same terms and conditions as are currently in place.
Non-commercial subscriptions are issued for one year and will automatically renew after that. However, for the renewal to happen, you must have used the assigned license at least once during the last 6 months of the subscription period. If it has been more than 6 months since you last used an IDE activated with this type of license and the renewal did not occur automatically, you can request a new non-commercial subscription again at any time.
If you’re unsure whether you qualify for a refund, you’ll find full details of our policy here. Please note that if you also work on projects that qualify as commercial usage, you can’t use the free license for them.
We’re sorry you can’t benefit from the non-commercial use license, but we’re sure we’ve got something to suit your needs. It’s always worth checking our special offers and Community page to see all our latest promotional pricing options.
As a non-commercial license holder, we encourage you to reach out with any questions you might have via our public community forums. You can also report any issues you might be experiencing by submitting a new request on the relevant issue tracker.
These resources can be accessed via the following links:
Please note that support via private tickets is not included under this license.
The terms of the non-commercial agreement assume that the product may also electronically send JetBrains anonymized statistics (IDE telemetry) related to your usage of the product’s features. This information may include but is not limited to frameworks, file templates used in the product, actions invoked, and other interactions with the product’s features. This information does not contain personal data.
We appreciate that this might not be convenient for everyone, but there is unfortunately no way to opt out of sending anonymized statistics to JetBrains under the terms of the Toolbox agreement for non-commercial use. The only way to opt out is by switching to either a paid subscription or one of the complimentary options mentioned here.
It can be easily done right inside your IDE:
If you’ve already started a trial period or have activated your IDE using a paid license, you still can switch to a non-commercial subscription by following these steps:
The most likely explanation for this is that you’re using an older version of Rider or WebStorm. Unfortunately, we don’t support obtaining the non-commercial license for any releases prior to Rider 2024.2.7 and WebStorm 2024.2.4.
The new non-commercial subscription type is product-specific. This means that if you want to use both Rider and WebStorm for non-commercial purposes, you’ll have to obtain two separate licenses – one for each product.
Unfortunately, acquiring an activation code for a non-commercial subscription is not possible. You can only activate an IDE through your JetBrains Account.
]]>
With August now behind us, we’d like to announce what we’ve got planned for the next release of WebStorm, which is scheduled for the middle of November, with our usual disclaimer: these plans are subject to change.
Also, as usual, we’ll be releasing EAP builds in the run-up to this release. We encourage you to try these builds, provide feedback on the features, and report any issues you discover. At this stage, you can significantly impact the product’s development.
Our primary focus with this release is on improving the stability and quality of WebStorm and some of its subsystems. Here are our most significant plans for WebStorm 2024.3:
node_modules
in the Find in Files directory tab by default (WEB-25601).exports
field in package.json
(WEB-68290).exports
field in package.json
for CSS files (WEB-55017)..idea
directory displayed by default – Historically, the .idea
folder has been hidden by default. Moving forward, we’ve decided to display all files in the projects to enhance transparency (WEB-68009).=
) for boolean JSX attributes (WEB-62632).That’s all for now! Check out the 2024.3 Early Access Program to test these features as they become available!
The WebStorm team
]]>Let’s face it, keeping up with the rapid changes in the JavaScript ecosystem is no easy task – it can be hard for us, too. That’s exactly why we created JetBrains JavaScript Day! This year, as always, we brought together top experts to share their insights and discuss the latest trends of modern JavaScript and TypeScript development. Make sure to join us live to ask your questions and be a part of the conversation as it happens.
When: October 24 at 9:00 am EDT (check your timezone)
Where: Online
Cost: Free
Here is this year’s lineup of inspiring speakers and talks:
We’ve also added an Ask Me Anything (AMA) session with the WebStorm team to our agenda for all of you who want to meet the people behind the JavaScript support for JetBrains IDEs.
Grab your tickets today, and we’ll see you there!
Your JetBrains team
]]>If you only have a few minutes to explore the highlights of WebStorm 2024.2, check out this video, in which we give a quick review of the top three new features. If you want to dive deeper into what you can expect in the release, just carry on reading!
The new features and improvements in v2024.2 include:
--first-parent
and --no-merges
options, and an improved commit graph.WebStorm 2024.2 introduces support for path resolving for frameworks that use file-system based routing. WebStorm can now resolve link paths based on your project’s file system, providing autocompletion, and navigation. Additionally, Next.js also includes path resolving support for dynamic, group, and parallel routes. This support ensures that your development environment keeps up with the routing scenarios these frameworks employ. The following frameworks are covered:
Currently, the navigation is supported for the built-in components like Link
, NuxtLink
, and native a
elements.
WebStorm 2024.2 now supports the Debug Adapter Protocol (DAP), which introduces debugging support for developers using the Bun JavaScript runtime. This integration allows you to set breakpoints, step through code, inspect variables, and evaluate expressions directly within WebStorm:
Please note that this support is currently only available to macOS and Linux users, but it could be rolled out to Windows users in future updates.
Starting from WebStorm 2024.2, new projects with a direct prettier
dependency in their root package.json
and a Prettier configuration file at the same level will have the Automatic Prettier Configuration setting enabled by default. This feature simplifies the setup process and ensures that Prettier integration is enabled out of the box.
Previously, when using Tailwind CSS, developers could only see the preview of Tailwind classes in a secondary documentation popup. Now WebStorm displays Tailwind CSS class previews directly in the completion result list, eliminating the need to enable the documentation popup for completion:
Svelte 5 is on the way, and in WebStorm 2024.2, you can already try out the new Svelte snippets and render tags. These snippets are designed to create reusable chunks of markup within your components:
In 2024.2, we have enabled Astro Language Server Protocol (LSP) support, leading to improved code completion and overall developer experience. This enhancement ensures more accurate and efficient development when working with Astro projects, providing better integration and support within the IDE. Additionally, we have fixed several false-positive errors, further enhancing the Astro support.
You can toggle the language server in Settings | Languages & Frameworks | TypeScript | Astro.
WebStorm 2024.2 introduces Vue Language Service 2 support. This update enhances support for Vue 3, improving autocompletion, error checking, and type inference. Enjoy a smoother development experience powered by the most recent version of Vue language tools and built-in WebStorm support. There are also important fixes for auto-imports of Vue 3 components.
WebStorm 2024.2 provides the ability to run and debug TypeScript files directly within the IDE without any additional setup, utilizing the integrated tsx
loader.
You can now execute TypeScript files from different entry points, including the file context menu, the Run widget, and the Current file configuration. The bundled loader eliminates the need for extra dependencies, though it does come with some limitations, such as requiring Node 18 or higher, no type-checking, and limited support for tsconfig.json
. You can disable the bundled loader via the configuration settings if it’s not needed.
WebStorm 2024.2 enhances the New Project Wizard by adding a new option to create basic JavaScript and TypeScript projects. This feature is designed to simplify onboarding for new users, providing an easy way to set up a project with minimal configuration. Users can select JavaScript or TypeScript directly from the wizard.
The generated projects include essential files like package.json and either index.js
or index.ts
, with a welcoming console log message. For TypeScript projects, a tsconfig.json
file is also included to set up compiler options. The Generate playground project with onboarding tips option includes helpful tip comments, ensuring a smooth start with the IDE. Projects generated with this option are based on the Vite template and contain an example web application:
We’ve reworked inlay hints in TypeScript to better align with the information provided by the TypeScript service. Inlay hints are retrieved only for the currently visible screen and the screens immediately above and below it (though this can be configured in the settings). This may cause hints to appear gradually when scrolling quickly, and you might notice that previously rendered hints are re-rendered when you scroll back. This behavior is expected and designed to optimize performance.
WebStorm can now natively render mathematical expressions in Markdown files. In WebStorm 2024.2, you can use $
to insert inline math expressions and $$
for code blocks containing math content.
The Search Everywhere dialog now includes an option to preview the codebase elements you’re searching for. You can enable the preview through the icon on the dialog’s toolbar:
We’ve redesigned the layout and behavior of the UI elements in the Customize Main Toolbar dialog, making it more intuitive and organized. Now, it’s easier to search for, add, and delete actions in the main toolbar.
You can now set sticky lines more precisely and choose the languages for which you want them to appear. You can tailor the feature to your preferences either in Settings | Editor | General | Sticky Lines or by calling the context menu with a right-click on a sticky line in the editor.
With WebStorm 2024.2, we’re transitioning from JetBrains Runtime 17 (JBR17) to JetBrains Runtime 21 (JBR21). Starting with WebStorm 2024.2, all updates will come with JBR21, offering enhanced security and performance and Wayland rendering support for Linux. See the following blog post for more details.
We are happy to announce that we will enable the new UI for all JetBrains IDE users in the upcoming 2024.2 version. We designed the new UI to reduce visual clutter, ensuring easy access to essential features while gradually revealing more advanced functionality as needed. The new UI is clean and modern, providing bigger, easier-to-use controls, a consistent color palette, light and legible icons, increased contrast, and better accents. For more information about this change, please read this blog post.
If you prefer the classic UI, you can still use it by installing the corresponding plugin, which is available from JetBrains Marketplace.
JetBrains AI Assistant 2024.2 introduces enhanced code completion with more accurate and faster suggestions. The AI chat now supports GPT-4o, chat references, and semantic search for better context understanding. New features include AI integration in the Terminal for command generation, AI-assisted VCS conflict resolution, and customizable prompts for documentation and unit test creation. For more information, please see this blog post.
All settings related to the Log tool window are now consolidated into a dedicated settings page, making it easy to customize its behavior in one convenient location. You can access this page through Settings | Version Control | Log or via a new dropdown menu on the Log tool window’s toolbar:
--first-parent
and --no-merges
options support in the Git log UIGit has a useful option for viewing the history of changes in a branch: –first-parent. This option simplifies the log by hiding individual commits that came with the merge, making it easier to track changes. We’ve also added filtering with the –no-merges command, which displays the history without any merge commits.
Both options can be selected under the Graph Options button in the Git tool window.
To improve the visual perception of the commit graph in the Log tab of the Git tool window, we’ve refined the color encoding and layout of branch lines. Important branch lines now consistently remain on the left-hand side of the graph and retain their designated colors, making them easier to identify and follow.
Previously, commits from important branches were sometimes not correctly laid out or colored because their heads were contained within less important branches. This update ensures that important branches are always clearly visible and consistently colored.
JavaScript, TypeScript, Markup, and style sheet languages
${
and }
tokens in template literals for JavaScript and TypeScript files, including template literal types in TypeScript (WEB-35578).Frameworks and technologies
.cjs
, .cts
, .mjs
, and .mts
file extensions were added to Run for files by default for ESLint Prettier (WEB-60181).User experience
There are lots of new features and enhancements to try out in this latest WebStorm release. If you’d like a list of everything included in WebStorm 2024.2, please check out the release notes. We hope you enjoy this release. As always, please share your feedback with us and report any issues you find to our issue tracker.
The WebStorm team
]]>There are lots of programming languages out there, each with its own unique approach and advantages for learning:
But if you want all the above… JavaScript is the obvious choice. There are several advantages to starting your learning journey with JavaScript. First, its straightforward syntax makes it ideal for beginners, but it isn’t just a beginner language – its versatility is practically endless. It drives web frontends but can also support backend development. The immediate feedback you get from developing frontends keeps the learning process engaging and rewarding due to its visual nature.
Additionally, JavaScript is highly sought after in the tech industry. According to the 2023 Developer Ecosystem Survey, JavaScript has been the most commonly used programming language for the seventh consecutive year, with over 61% of developers using it regularly. This consistent demand translates into abundant job opportunities, making JavaScript a great choice for anyone entering the field of programming. Another benefit worth mentioning is that JavaScript runs everywhere, so knowing it means you can write everything from backend and frontend to IoT and mobile apps.
To learn JavaScript effectively, you’ll need to touch upon each of the different concepts that make up the language. If you are looking for a step-by-step roadmap to guide you through this process, there are some incredible roadmaps available on Roadmap.sh that will help make sure you don’t miss anything important along the way. Later in this blog post, we’ll cover other resources, such as course and book recommendations.
This is how it is organized. The original has links to the resources for each topic and lets you track your progress.
The fundamental skills you’ll need to learn to code effectively with JavaScript are as follows:
// the hello world program
console.log('Hello World');
let
, const
, and var
. Once you have the fundamentals down, it’s time to move on to some more advanced concepts within the language. You’ll want to make sure you understand the following:
this
keyword: The this
keyword is an important concept that you’ll need to wrap your head around in JavaScript. It refers to an object, but it will refer to different objects depending on how it’s used. If you want to make a career out of JavaScript development, then you’ll need to continue to learn and grow as a developer. JavaScript will take years to master completely, but there are things you can do to make sure you continue to grow in this field.
Learn frameworks and libraries: Now you can develop with JavaScript. The next step to becoming an expert is to add another layer on top by using a framework like React, Angular, or Vue. These are currently the most popular frameworks for JavaScript.Stay up to date: The JavaScript ecosystem is evolving, and although not quite as rapidly as it once was, you’ll need to keep up with the changes in order for your code to run smoothly. There are some great resources you can follow to make sure you stay up to date and at the top of your game when it comes to JavaScript.
Newsletters:
Surveys:
The only way to truly learn and understand something is through practice. Otherwise, you run the risk of getting stuck in the dreaded “tutorial hell”. Working through the process, making mistakes, and realizing you don’t know what you don’t know is pivotal to becoming a good programmer. Here are some project ideas you can develop from scratch.
A great first project to put time and effort into is creating a website for yourself. This doesn’t, however, mean modifying a WordPress template and hosting it on a web server somewhere. Creating your own website from scratch provides you with the opportunity to familiarize yourself with different concepts, which will prove to be an invaluable experience later down the line.
Level 1 | Level 2 | Level 3 | Level 4 | Level 5 | Final challenge |
---|---|---|---|---|---|
A one-page website | A contact form | A blog | A basic chatbot | A login authenticator | A 3D portfolio website |
Creating a game will help you familiarize yourself with algorithms, common game code, inputs, and outputs. As you develop increasingly complicated games, you’ll also get a feel for data structures, events, and storing states. All while getting to play your favorite games… purely for testing purposes, right?
Level 1 | Level 2 | Level 3 | Level 4 | Level 5 | Final challenge |
---|---|---|---|---|---|
Rock, paper, scissors game | Rock, paper, scissors, lizard, Spock | Wordle game | Connect four | Battleships game | Chess game |
The best thing about coding is you can solve your own problems – and if other people maybe have similar problems, then they might pay you for a solution, too.
Level 1 | Level 2 | Level 3 | Level 4 | Level 5 | Final challenge |
---|---|---|---|---|---|
Todo app | Password generator | Calculator | Pomodoro timer | Finance tracking app | Kanban task management app |
Chances are you’re going to want to get a job – so you can make money with your new skill set. What better way to prepare for the job than by creating a website similar to the one you’ll be maintaining, so you can hit the floor running?
Level 1 | Level 2 | Level 3 | Level 4 | Level 5 | Final challenge |
---|---|---|---|---|---|
News curation website | Job website | Twitter(X) app | E-commerce site | Video streaming app | Social media platform |
There are thousands of resources available to teach you everything you need to know to become proficient with JavaScript. Unfortunately, we cannot cover them all. Nevertheless, below, we’ve prepared a list of some of our favorites, which we like mainly because they are some of the most complete and usually include some form of project-based practice. If you have any course recommendations of your own, please feel free to post them in the comments, along with your own review of what makes them so good.
Hyperskill – Paid
This hands-on platform offers over 300 real-world projects created by JetBrains Academy experts, allowing you to build your developer portfolio from scratch. You are introduced to the theory and then get the chance to put it into practice, all while being tested on your understanding of the concepts and receiving immediate feedback on your code.
One big benefit of the platform is that you learn not only programming but also how to use essential development tools like IDEs – must-know technologies for a career in development.
The path we would recommend to get you job-ready would be the following:
Frontend Masters – Paid (free JavaScript bootcamp)
The Frontend Masters platform has hundreds of courses to take you through your learning journey, covering everything from the basics to very advanced technologies – and with a subscription, you get access to all of them. But for now, let’s focus on getting started with JavaScript. And to help you do exactly that, they have a really cool and totally free Front-End Development Bootcamp consisting of over 20 hours of enthralling content.
The path they recommend is their JavaScript learning path.
Codecademy – Paid (free JavaScript courses)
Codecademy offers interactive, hands-on coding exercises that guide you through writing code directly in the browser. The platform provides well-structured courses on a variety of web development topics, from HTML and CSS to JavaScript and full-stack development. The courses also include projects and quizzes to reinforce learning and help you apply what you’ve learned. There’s even a free introductory course for JavaScript to get you started.
The recommended path to get career-ready would be the Front-End Engineer career path.
Udemy – Paid
The Udemy platform hosts various courses from instructors worldwide on topics ranging from web design to data science. It enables instructors to create and sell courses while providing learners with access to thousands of courses.
JavaScript course recommendations on Udemy include:
This free resource is packed with information. It isn’t technically a course but rather a collection of resources. It can provide all the knowledge you need to learn JavaScript. If you’re looking for a free option to help support your self-learning, this is an incredible resource.
This free resource offers a wide range of courses and is quite incredible. It has over 10,000 tutorials across several languages and technologies. They also have a nice introductory course for JavaScript, which is project-led.
This is a complete repository of everything from JavaScript basics to advanced topics, supported with detailed explanations. If you ever feel stuck understanding a concept, this is a great place to get unstuck. If you like reading, you can essentially teach yourself everything you need using this resource.
This platform provides access to hundreds of step-by-step tutorials, with lots of places to test your understanding and try the code yourself. It offers a simplified and interactive learning experience with simple code examples and illustrations of how to apply the concepts in real-world scenarios.
If you’re interested in computer science in general, a great introductory course is Harvard University’s CS50 course. CS50’s Web Programming with Python and JavaScript builds on this foundation with a focus on web programming specifically. Though neither are JavaScript-specific, they’re still very, very good courses that you can take for free. The assignments, in particular, can help you solidify your understanding and practice your coding.
There are lots of content creators on YouTube who have created introductory courses for JavaScript. Check out these great options:
If you’re looking for a quick crash course in JavaScript development, this is a great beginner tutorial that covers the essentials and gives you a good understanding of the core concepts of JavaScript development. Though it isn’t technically a full course, it’s great for getting started and familiarizing yourself with the language.
This crash course from Traversy Media is a great place to start. It covers the fundamentals of JavaScript, including more modern syntax like classes, arrow functions, etc. It’s the first in a series of videos and is easy to follow, helping you learn the basic syntax and fundamentals.
This series from Net Ninja consists of six video lessons on the fundamentals of modern JavaScript. Although it has been around for a while, it’s definitely worth checking out if you’re looking for a series that explains the basics.
If you prefer to sit down with a book and dive into the details, you’re not alone. Books offer a lot of benefits for learners and usually allow for a deeper dig into the subject. Here’s a collection of books you can use to learn JavaScript programming:
Head First JavaScript Programming is designed to make learning JavaScript fun and accessible, even for anyone with little to no programming experience. One of its key strengths is its emphasis on active learning. Rather than simply reading about JavaScript, you’re encouraged to work through problems, think critically, and experiment with code. This hands-on approach helps to solidify understanding and improve retention. There are also plenty of practical examples and projects, ensuring that you can see how JavaScript is applied in real-world scenarios. Its unique approach to teaching makes it stand out among other programming books, ensuring that readers not only learn JavaScript but also enjoy the process.
JavaScript: The Definitive Guide covers the full spectrum of JavaScript, from basic syntax and programming fundamentals to advanced topics like closures, asynchronous programming, and the intricacies of the JavaScript runtime environment. Each chapter is meticulously crafted to provide clear explanations, backed by numerous examples and practical code snippets. What sets this book apart is its depth and precision. While it can serve as a beginner’s guide, its thoroughness, and complexity make it particularly well-suited for those looking to deepen their understanding and master the language.
Eloquent JavaScript is structured in a way that encourages you to actively engage with the content through exercises and projects, reinforcing their understanding through practical application. Its focus on both theoretical and practical aspects ensures that readers not only learn how to write JavaScript but also understand the underlying concepts, making it a valuable addition to any programmer’s library. This book is also available online for free!
This is a series of books that explores the core mechanisms and intricacies of JavaScript. Unlike many introductory programming books, this series is aimed at developers who want to go beyond the basics and gain a thorough understanding of the language. Each book tackles different aspects of JavaScript, from its foundational principles to more advanced topics. You can find a free version of the book in Kyle’s GitHub repository.
Though most of the resources recommended here often do include introductions to JavaScript frameworks or the technologies you’ll need as a developer, here are some other resources that you may want to check out.
This free course from the University of Helsinki will build on your knowledge and introduce you to modern JavaScript-based web development with React. It can help you build React, Redux, Node.js, MongoDB, GraphQL, and TypeScript knowledge.
If you enjoy a really interactive learning experience, then this might be perfect for you. It has video, quizzes, and a stunning UI – what more could you ask for?
Angular has a great introductory tutorial that covers the basic principles of Angular. It is pretty famous within the community for people learning Angular.
In this course, you’ll learn everything you need to get started writing applications with Angular. It starts at the very beginning: you’ll install the Angular command-line tools and then create a new project.
This resource includes courses, tutorials, and lessons from the Vue core team, including Evan You, the creator of the framework. It has a comprehensive learning path you can follow to make sure you are Vue-ready when the time comes.
This is another great resource for learning Vue again with courses from some of the Vue Core team. This resource covers some advanced topics, and there are different tracks you can choose from depending on your level.
An interactive introduction to the fundamentals of version control.
Another highly recommended introductory course, which covers all the fundamentals.
Here are some important references you may want to bookmark. They may come in handy during your learning journey.
Learning new things can seem daunting and overwhelming. However, using a variety of learning techniques to enhance learning efficiency and effectiveness can help improve your odds of success.
Good learning techniques:
Learning pitfalls:
That’s it for today! Learning something new is an infinitely rewarding pursuit. With the right attitude and resources, there’s nothing you can’t learn – it just takes time. If you’re frustrated that you can’t create the next Amazon or Netflix competitor after taking a four-hour course, don’t worry – we’ve all been there. The only way to get better is to practice and code: try, fail, learn, and repeat. You’ll get the biggest gains by applying the code, so even once you have been through a course and learned the basics, it’s time to start applying this knowledge. This is where you’re going to get good – actually, not good – great!
Happy developing!
]]>
As a developer advocate for JavaScript and TypeScript at JetBrains, I have the privilege of working with some of the best tools in the industry and exploring the different frameworks and libraries that are available. From WebStorm and Node.js to Angular, Tailwind, and RxJS, there’s always something new and exciting to discuss. That’s exactly why I’d like to experiment with opening up my calendar – because I believe the best ideas and solutions come from engaging conversations. I want to better understand your struggles and help you overcome them.
I want to hear from you! Whether you have questions about JetBrains tools, need advice on your next big project, or just want to geek out about the latest in web development, I’m here and ready to chat. This is also a great opportunity for me to gain new perspectives and understand how different developers are using these tools in their day-to-day work.
It’s simple! Just click here to access my calendar and book a time that works for you. I look forward to chatting and can’t wait to see what we can learn from each other.
Please note that this will be experimental for now. Though I hope it is a success, let’s see how it goes. If it works out great! If not, then we’ll see if there is something else we can do. But either way, I am looking forward to meeting you.
Thank you for being an amazing community. Let’s make the most of this opportunity to connect, share, and grow together.
Jan-Niklas Wortmann
Developer Advocate, JetBrains
Important! WebStorm EAP builds are not fully tested and might be unstable.Please try the latest EAP build and share your feedback with us. You can do so using our issue tracker or by leaving a comment on this blog post.
WebStorm 2024.2 now supports the Debug Adapter Protocol (DAP), introducing the debugging experience for developers using the Bun JavaScript runtime. This integration allows you to set breakpoints, step through code, inspect variables, and evaluate expressions directly within WebStorm:
Currently, we’re providing initial support and gathering your feedback. This functionality is available only for macOS and Linux users. Windows support is targeted for one of the upcoming minor releases; please track the following issue: WEB-67975.
WebStorm 2024.2 introduces support for path resolving for frameworks that use file-system based routing. WebStorm can now resolve link paths based on your project’s file system, providing autocompletion, and navigation. Additionally, Next.js also includes path resolving support for dynamic and nested routes. This support ensures that your development environment keeps up with the routing scenarios these frameworks employ. The following frameworks are covered:
Currently, the navigation is supported for the built-in components like Link
, NuxtLink
, and native a
elements.
In the 2024.2 EAPs, we’ve enabled Astro Language Server Protocol (LSP) support, leading to improved code completion and a better overall developer experience. This enhancement ensures more accurate and efficient development when working with Astro projects, providing better integration and support within the IDE. Additionally, we’ve fixed several false-positive errors, further enhancing the Astro support.
You can toggle the language server in Settings | Languages & Frameworks | TypeScript | Astro.
The EAP 7 of WebStorm introduces a visual enhancement to the Language Services status bar widget. Now, instead of the Language Services static label, you can see icons representing the active language services like ESLint, Tailwind, and TypeScript, which are running on the current file:
Starting from EAP 6, new projects with a direct prettier
dependency in their root package.json
and a Prettier configuration file at the same level will have the Automatic Prettier Configuration setting enabled by default. This feature simplifies the setup process, ensuring that Prettier integration is enabled out of the box.
For those working with monorepos, a separate issue (WEB-67396) is being addressed to support similar functionality across multiple packages within a single repository.
WebStorm EAP 8 enhances the New Project Wizard by adding a new option to create basic JavaScript and TypeScript projects. This feature is designed to simplify onboarding for new users, providing an easy way to set up a project with minimal configuration. Users can select JavaScript or TypeScript directly from the wizard.
The generated projects include essential files like package.json
and either index.js
or index.ts
, with a welcoming console log message. For TypeScript projects, a tsconfig.json file is also included to set up compiler options. The Generate a playground project with onboarding tips option includes helpful TIP comments ensuring a smooth start with the IDE. Projects that are generated with this option are based on the Vite template and contains an example web application:
The new feature, available with the AI Assistant plugin enabled, allows you to extract a Vue component from an existing template area. Open a Vue file, select a section of the template (excluding the template tag), and invoke the AI Actions | Extract Component intention. This opens two diff editors: one for the new component’s generated code and another for the changes in the existing component. After accepting the modifications, the new component is saved with a name suggested by the AI and integrated into the original component:
You can now set sticky lines more precisely and choose the languages you want them to appear for. You can tailor the feature to your preferences either in Settings | Editor | General | Sticky Lines or by calling the context menu by right-clicking on a sticky line in the editor:
Previously, when using Tailwind CSS, developers could only see the preview of Tailwind classes in a secondary documentation popup. Now WebStorm displays Tailwind CSS class previews directly in the completion result list, eliminating the need to enable the documentation popup for completion:
The 2024.2 EAPs introduce Vue Language Tools 2.0 support. This update enhances support for Vue 3, improving autocompletion, error checking, and type inference. Enjoy a smoother development experience powered by the most recent version of Vue language tools and built-in WebStorm support.
${
and }
tokens in template literals for JavaScript and TypeScript files, including template literal types in TypeScript (WEB-35578)..cjs
, .cts
, .mjs
, .mts
file extensions were added to Run for files by default for ESLint Prettier (WEB-60181).classnames
library (WEB-57054).That’s it for today. For the full list of improvements available in the latest EAP build, check out the release notes.
The WebStorm team
]]>