Skip to content

Instantly share code, notes, and snippets.

Avatar
🥑

Sebastian Aigner SebastianAigner

🥑
View GitHub Profile
@SebastianAigner
SebastianAigner / gist:b06f50b1448f6466775b0df14fb2b35f
Last active Mar 4, 2021
Structural Search and Replace Template to mark RComponent implementations as @JsExport
View gist:b06f50b1448f6466775b0df14fb2b35f

This is a template for Structural Search and Replace to mark RComponents as @JsExport. To use it, open SSR via File | Find | Replace Structurally, click on the wrench icon, and select "Import Template from Clipboard". You can then click "Find" and "Replace All" to annotate all interfaces properly.

<replaceConfiguration name="Unnamed" text="class $componentName$($propsParam$: $propsType$) : RComponent&lt;$propsType$, $stateType$&gt;($propsParam$)" recursive="false" caseInsensitive="false" type="Kotlin" pattern_context="default" reformatAccordingToStyle="false" shortenFQN="false" replacement="@JsExport&#10;class $componentName$($propsParam$: $propsType$) : RComponent&lt;$propsType$, $stateType$&gt;($propsParam$)">
  <constraint name="__context__" within="" contains="" />
  <constraint name="componentName" within="" contains="" />
  <constraint name="propsParam" within="" contains="" />
  <constraint name="propsType" within="" 
@SebastianAigner
SebastianAigner / gist:62119536f24597e630acfdbd14001b98
Last active Sep 9, 2021
Structural Search and Replace Template to mark RState interfaces as external
View gist:62119536f24597e630acfdbd14001b98

This is a template for Structural Search and Replace to mark State interfaces as external. To use it, open SSR via File | Find | Replace Structurally, click on the wrench icon, and select "Import Template from Clipboard". You can then click "Find" and "Replace All" to annotate all interfaces properly.

<replaceConfiguration name="Mark State interface as external" text="interface $name$ : State" recursive="false" caseInsensitive="true" type="Kotlin" pattern_context="default" reformatAccordingToStyle="false" shortenFQN="false" replacement="external interface $name$ : State">
  <constraint name="__context__" within="" contains="" />
  <constraint name="name" within="" contains="" />
</replaceConfiguration>
@SebastianAigner
SebastianAigner / gist:a47a77f5e519fc74185c077ba12624f9
Last active Sep 9, 2021
Structural Search and Replace Template to mark RProps interfaces as external
View gist:a47a77f5e519fc74185c077ba12624f9

This is a template for Structural Search and Replace to mark Props interfaces as external. To use it, open SSR via File | Find | Replace Structurally, click on the wrench icon, and select "Import Template from Clipboard". You can then click "Find" and "Replace All" to annotate all interfaces properly.

<replaceConfiguration name="Mark Props interface as external" text="interface $name$ : Props" recursive="false" caseInsensitive="true" type="Kotlin" pattern_context="default" reformatAccordingToStyle="false" shortenFQN="false" replacement="external interface $name$ : Props">
  <constraint name="__context__" within="" contains="" />
  <constraint name="name" within="" contains="" />
</replaceConfiguration>