Skip to content

Commit 34714cc

Browse files
v5: react 17-19 support, performance fixes, snippets
Co-authored-by: Dawid Harat <dawidharat03@gmail.com>
1 parent 7db2269 commit 34714cc

20 files changed

Lines changed: 1196 additions & 581 deletions

‎LICENSE‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2022
3+
Copyright (c) 2022 Damian Sznajder
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

‎README.md‎

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,26 @@ Launch _Quick Open_:
1515
Paste the following command and press `Enter`:
1616

1717
```shell
18-
ext install dsznajder.es7-react-js-snippets
18+
ext install r5n-labs.es-js-snippets
1919
```
2020

2121
## Options
2222

23-
From version 4 extension provides options to customize the behavior of the snippets:
23+
| Option | Description |
24+
| -------------------------: | --------------------------------------------------------------------------------------------------------------------------------------- |
25+
| languageScopes | Comma-separated list of language scopes where snippets are available (default: `typescript,typescriptreact,javascript,javascriptreact`) |
26+
| importReactOnTop | Adds `import React` at the top of component snippets. Enable for legacy projects pre-React 17 (default: `false`) |
27+
| typescript | Adds TypeScript-specific component snippets (default: `true`) |
28+
| typescriptPropsStatePrefix | Controls `type` vs `interface` for TypeScript Props/State (default: `type`) |
2429

25-
| Option | Description |
26-
| ---------------: | ---------------------------------------------------------------------------- |
27-
| languageScopes | list of supported languages / files recognition |
28-
| prettierEnabled | determines if snippets should be parsed with project prettier config |
29-
| importReactOnTop | If disabled, snippets won't contain `import React` on top. React 17+ support |
30-
| typescript | adds additional typescript snippets |
31-
32-
# Sponsors
33-
34-
<p><a title="Try CodeStream" href="https://sponsorlink.codestream.com/?utm_source=vscmarket&amp;utm_campaign=es7_react&amp;utm_medium=banner"><img src="https://alt-images.codestream.com/codestream_logo_es7_react.png"></a></br>
35-
Manage pull requests and conduct code reviews in your IDE with full source-tree context. Comment on any line, not just the diffs. Use jump-to-definition, your favorite keybindings, and code intelligence with more of your workflow.<br> <a title="Try CodeStream" href="https://sponsorlink.codestream.com/?utm_source=vscmarket&amp;utm_campaign=es7_react&amp;utm_medium=banner">Learn More</a></p>
36-
37-
<br>
30+
**Note:** Changing settings requires a VS Code restart to take effect.
3831

3932
### Conquer of Completion
4033

4134
It is possible to use this package in your vim/neovim text editor, to make this possible, make sure you have the `coc.nvim` previously configured, then add this command to your `init.vim`
4235

4336
```shell
44-
Plug 'dsznajder/vscode-es7-javascript-react-snippets', { 'do': 'yarn install --frozen-lockfile && yarn compile' }
37+
Plug 'r5n-labs/vscode-react-javascript-snippets', { 'do': 'yarn install --frozen-lockfile && yarn compile' }
4538
```
4639
4740
Update your vim / neovim settings with `:source %` and then install the new package with `:PlugInstall`
@@ -55,7 +48,7 @@ Note: This example uses `vim-plug` as a package manager, feel free to use some o
5548
For use with packer the syntax is a little different. Just add in your `init.vim` or `init.lua`:
5649
5750
```shell
58-
use {'dsznajder/vscode-es7-javascript-react-snippets',
51+
use {'r5n-labs/vscode-react-javascript-snippets',
5952
run = 'yarn install --frozen-lockfile && yarn compile'
6053
}
6154
```
@@ -68,7 +61,7 @@ When saving the file, the update will be done ( `:w` )
6861

6962
You can search through snippets with `ES7 snippet search` command which can be run with `CMD + Shift + P` or just use `CMD + Shift + R` (`CTRL + ALT + R` for Windows & Linux) keybinding.
7063

71-
Here is direct link to marketplace [ES7 React/Redux/React-Native/JS Snippets](https://marketplace.visualstudio.com/items?itemName=dsznajder.es7-react-js-snippets)
64+
Here is direct link to marketplace [ES7 React/Redux/React-Native/JS Snippets](https://marketplace.visualstudio.com/items?itemName=r5n-labs.es-js-snippets)
7265

7366
<br>
7467

0 commit comments

Comments
 (0)