Solid Bytes for VSCodeThis Visual Studio Code extension offers a comprehensive collection of Solid snippets designed to boost the productivity of developers. With a focus on flexibility, these snippets cater to a wide range of Solid functionalities, from component creation and reactive utilities to context management and stores. While the snippets are not customizable, their design ensures they can be seamlessly integrated into various coding styles and project requirements. Features
Installation
Alternatively, search for "Solid Bytes" in the Extensions view ( UsageTo efficiently use a snippet within your Solid projects, simply start typing its prefix in your project files. The extension will display a list of snippets that match the typed prefix. When you select a snippet, it inserts the code into your file, positioning the cursor right at the end of the function or component name. This cursor placement is specifically designed to streamline the importing process, allowing you to quickly import the necessary functions or components using
ContributingContributions are welcome! If you have ideas for new snippets, improvements, or find any issues, please open an issue or submit a pull request on our GitHub repository. LicenseThis extension is released under the MIT License. AcknowledgmentsThank you to the Solid community and all contributors. Your support and contributions are greatly appreciated. Stay tuned for updates as we continue to expand the snippet collection and improve the extension. Full List
createSignalView DetailsCreates a simple reactive state with a getter and setter "SSignal"
js,jsx
createSignal.tsView DetailsCreates a simple reactive state with a getter and setter "SSignal"
ts,tsx
createEffectView DetailsCreates a reactive computation that runs after the render phase "SEffect"
js,jsx
createEffect.tsView DetailsCreates a reactive computation that runs after the render phase "SEffect"
ts,tsx
createMemoView DetailsCreates a readonly derived reactive memoized signal "SMemo"
js,jsx
createMemo.tsView DetailsCreates a readonly derived reactive memoized signal "SMemo"
ts,tsx
createResourceView DetailsCreates a resource that wraps a repeated promise in a reactive pattern "SResource"
js,jsx
Solid ComponentView DetailsSolid Component "SComponent"
js,jsx
${1:${TM_FILENAME_BASE}}
}
```
Solid Component.tsView DetailsSolid Component "SComponent"
ts,tsx
${1:${TM_FILENAME_BASE}}
}
```
Solid Component ExportView DetailsSolid Component Export "SExportComponent"
js,jsx
${1:${TM_FILENAME_BASE}}
}
```
Solid Component Export.tsView DetailsSolid Component Export "SExportComponent"
ts,tsx
${1:${TM_FILENAME_BASE}}
}
```
DynamicView DetailsRenders an arbitrary custom or native component and passes the other props "SDynamic"
js,jsx
ErrorBoundaryView DetailsCatches uncaught errors inside components and renders a fallback content. Errors thrown from the fallback can be caught by a parent ErrorBoundary "SErrorBoundary"
js,jsx
Error: {error.toString()} }>
${2:${TM_SELECTED_TEXT}}
```
ForView DetailsCreates a list of elements from a list. It receives a map function as its child that receives a list element and an accessor with the index and returns a JSX-Element; if the list is empty, an optional fallback is returned "SFor"
js,jsx
Loading... }>
{(${3:item}) => (
${4:IndexView DetailsNon-keyed iteration over a list creating elements from its items. To be used if you have a list with fixed indices, but changing values. If you have a list with changing indices, better use `` "SIndex"
js,jsx
Loading... }>
{(${3:item}) => (
${4:PortalView DetailsUseful for inserting modals and tooltips outside of an cropping layout. If no mount point is given, the portal is inserted in document.body; it is wrapped in a ` ` unless the target is document.head or `isSVG` is true. setting `useShadow` to true places the element in a shadow root to isolate styles
"SPortal"
js,jsx
${4:My Content} }
```
ShowView DetailsConditionally render its children or an optional fallback componentConditionally render its children or an optional fallback componentConditionally render its children or an optional fallback component "SShow"
js,jsx
Loading... }>
${3:$4:My Content} }
```
Switch / MatchView DetailsSwitches between content based on mutually exclusive conditions. Selects a content based on condition when inside a `Switch` control flow "SSwitch"
js,jsx
Not Found }>
${4:}
${6:}
```
SuspenseView DetailsTracks all resources inside a component and renders a fallback until they are all resolved "SSuspense"
js,jsx
Loading... }>
${2:${TM_SELECTED_TEXT}}
```
SuspenseListView Details**[experimental]** Controls the order in which suspended content is rendered "SSuspenseList"
js,jsx
Loading...}> ${5:{resource.user\} }
```
childrenView DetailsResolves child elements to help interact with children "SChildren"
js,jsx
contextView DetailsCreates a Context to handle a state scoped for the children of a component. use a context to receive a scoped state from a parent's Context.Provider "SContext"
js,jsx
createUniqueIdView DetailsA universal id generator that is stable across server/browser. Note: on the server this only works under hydratable components "SUuid"
js,jsx
lazyView DetailsUsed to lazy load components to allow for code splitting. Components are not loaded until rendered "SLazy"
js,jsx
createStoreView DetailsCreates a reactive store that can be read through a proxy object and written with a setter function "SStore"
js,jsx
createStore.tsView DetailsCreates a reactive store that can be read through a proxy object and written with a setter function "SStore"
ts,tsx
batchView DetailsExecute a callback that will not side-effect until its top-most batch is completed "SBatch"
js,jsx
catchErrorView DetailsRun an effect whenever an error is thrown within the context of the child scopes "SCatchError"
js,jsx
|