<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.2">Jekyll</generator><link href="https://ajpinedam.dev/rss" rel="self" type="application/atom+xml" /><link href="https://ajpinedam.dev/" rel="alternate" type="text/html" /><updated>2022-08-25T16:30:43+00:00</updated><id>https://ajpinedam.dev/rss</id><title type="html">Andres Pineda’s Blog</title><subtitle>👋 My name is Andres Pineda, I'm a Software Developer from the Carribean living in Montreal.  I enjoy working with all kind of tech, but most important I love working with cool people.</subtitle><entry><title type="html">New pluggin svelte webstorm</title><link href="https://ajpinedam.dev/archive/2022/08/25/new-pluggin-svelte-webstorm.html" rel="alternate" type="text/html" title="New pluggin svelte webstorm" /><published>2022-08-25T05:00:00+00:00</published><updated>2022-08-25T05:00:00+00:00</updated><id>https://ajpinedam.dev/archive/2022/08/25/new-pluggin-svelte-webstorm</id><content type="html" xml:base="https://ajpinedam.dev/archive/2022/08/25/new-pluggin-svelte-webstorm.html">&lt;h1 id=&quot;new-pluggin-for-svelte-0221&quot;&gt;New Pluggin for Svelte (0.22.1)&lt;/h1&gt;

&lt;p&gt;&lt;a href=&quot;https://svelte.dev/&quot;&gt;Svelte&lt;/a&gt; provides a radical new approach to building user interfaces. If you use the Svelte language in your projects, you will be happy to read that we are adding support through this plugin to the IDE of your choice.&lt;/p&gt;

&lt;!-- more --&gt;
&lt;p&gt;The Svelte Plugin is compatible with IntelliJ IDEA Ultimate, AppCode, CLion, GoLand, PhpStorm, PyCharm Professional, Rider, RubyMine and WebStorm.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Latest version (&lt;strong&gt;0.22.1&lt;/strong&gt;) adds compatibility with the 2022.2 platforms.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The rest of this blog will guide you through the installation and some of the most notorious features this plugin will enable.&lt;/p&gt;

&lt;h2 id=&quot;instalation&quot;&gt;Instalation&lt;/h2&gt;

&lt;p&gt;First, let’s start with the installation.&lt;/p&gt;

&lt;p&gt;As with any other plugin our IDE supports, you can find it directly from the IDE or the Welcome page.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://res.cloudinary.com/drfetiyvj/image/upload/v1661405479/webstorm_pluggin_aijobu.png&quot; alt=&quot;WebStorm Home Page&quot; /&gt;&lt;/p&gt;

&lt;p&gt;or navigating from the setting&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://res.cloudinary.com/drfetiyvj/image/upload/v1661405705/webstorm_pluggin_settings_wvb2w1.png&quot; alt=&quot;WebStorm Settings&quot; /&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Note: This plugin is also available from the &lt;a href=&quot;https://plugins.jetbrains.com/plugin/12375-svelte&quot;&gt;MarketPlace&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2 id=&quot;main-features&quot;&gt;Main Features&lt;/h2&gt;

&lt;p&gt;Once installed, this plugin will enable great features that will increase your development productivity, such as Syntax highlighting, Code Formatting, and Auto Import of components.&lt;/p&gt;

&lt;p&gt;Let’s see some of these features in action.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;For the examples, we will be using &lt;a href=&quot;https://www.jetbrains.com/webstorm/&quot;&gt;WebStorm&lt;/a&gt; IDE.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 id=&quot;1-opening-a-svelte-project-and-run-it&quot;&gt;1. Opening a Svelte Project and run it&lt;/h3&gt;

&lt;p&gt;Use WebStorm to open your Svelte project.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: If you don’t have the plugin installed but open a Svelte project, WebStorm will recognize this and allow you to install the plugin.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can start your project using the integrated Terminal on WebStorm.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://res.cloudinary.com/drfetiyvj/image/upload/v1661411532/webstorm_page_running_2_sfzpf9.png&quot; alt=&quot;Page running&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;2-syntax-highlighting&quot;&gt;2. Syntax highlighting&lt;/h3&gt;

&lt;p&gt;The Svelte Plugin will highlight fields, local variables, types and other identifiers with configurable colors.&lt;/p&gt;

&lt;h3 id=&quot;3-typing-assistance-and-auto-import-components&quot;&gt;3. Typing Assistance and Auto import components&lt;/h3&gt;

&lt;p&gt;The Svelte Plugin not only saves you time by providing you with smart suggestions but it will also Auto Import components based on your selection.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://res.cloudinary.com/drfetiyvj/image/upload/v1661409163/ezgif.com-gif-maker_i5qt4d.gif&quot; alt=&quot;Auto Import and Typing Assistance&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;4-easily-navigate-the-code-from-components-to-their-definition&quot;&gt;4. Easily navigate the code from components to their definition&lt;/h3&gt;

&lt;p&gt;Go to the Type Declaration by Ctrl+Click (on Windows) or Cmd+Click on MacOS.&lt;/p&gt;

&lt;h3 id=&quot;5-debugger-integration&quot;&gt;5. Debugger Integration&lt;/h3&gt;

&lt;p&gt;Debugging is an integral part of WebStorm, and using the Svelte Plugin will allow you to examine the runtime behaviour of your application step by step.&lt;/p&gt;

&lt;p&gt;Use the debugger to set breakpoints and inspect the value of the elements.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://res.cloudinary.com/drfetiyvj/image/upload/v1661411551/webstorm_debugging_uy9mrz.png&quot; alt=&quot;Debugging Session&quot; /&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;Tip&lt;/strong&gt;: You can start a debugger session from WebStorm by Ctrl+Shift+Click (on Windows) or Cmd+Shift+Click (on MacOS) the Url.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;As we saw, this plugin not only brings Svelte Support into your IDE but also makes you more productive by enabling the features described above.&lt;/p&gt;

&lt;h2 id=&quot;feedback&quot;&gt;Feedback&lt;/h2&gt;

&lt;p&gt;We would be grateful for any feedback you have, and all ideas are welcome! Contact us at webstorm-support@jetbrains.com or via our issue tracker.&lt;/p&gt;

&lt;p&gt;Your WebStorm team&lt;/p&gt;</content><author><name>Andres</name></author><category term="Archive" /><category term="Svelte" /><category term="Web" /><category term="Pluggins" /><summary type="html">New Pluggin for Svelte (0.22.1) Svelte provides a radical new approach to building user interfaces. If you use the Svelte language in your projects, you will be happy to read that we are adding support through this plugin to the IDE of your choice.</summary></entry><entry><title type="html">Using the Span in Xamarin Cross-Targeted projects</title><link href="https://ajpinedam.dev/archive/2019/03/31/using-span-of-t-in-xamarin-cross-targeted-projects.html" rel="alternate" type="text/html" title="Using the Span in Xamarin Cross-Targeted projects" /><published>2019-03-31T05:00:00+00:00</published><updated>2019-03-31T05:00:00+00:00</updated><id>https://ajpinedam.dev/archive/2019/03/31/using-span-of-t-in-xamarin-cross-targeted-projects</id><content type="html" xml:base="https://ajpinedam.dev/archive/2019/03/31/using-span-of-t-in-xamarin-cross-targeted-projects.html">&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;System.Memory&lt;/code&gt; exists to provide the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Span&amp;lt;T&amp;gt;&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Memory&amp;lt;T&amp;gt;&lt;/code&gt; and similar types, for which &lt;a href=&quot;https://msdn.microsoft.com/en-us/magazine/mt814808.aspx&quot;&gt;C# 7.x provided support&lt;/a&gt;, and it can enable significant performance improvements where appropriate. While .NET Standard 2.0 does not have support for it in its available API surface, there the &lt;a href=&quot;https://www.nuget.org/packages/System.Memory&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;System.Memory&lt;/code&gt;&lt;/a&gt; NuGet package that can be added to enable it.&lt;/p&gt;

&lt;p&gt;As part of the code sharing effort, Mono and Xamarin added support for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;System.Memory&lt;/code&gt; in the BCL as part of the releases bundled with VS 2019.&lt;/p&gt;

&lt;p&gt;While this is a very important step to make Mono and .NET Core very similar in behavior, this brings issues because the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Xamarin.iOS&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Xamarin.Mac&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MonoAndroid&lt;/code&gt; target frameworks are not versioned like .NET Core or .NET Standard. The Visual Studio version used to build a project has an impact on the code’s behavior or compatibility that cannot be adjusted as easily as changing a Target Framework version.&lt;/p&gt;

&lt;!-- more --&gt;
&lt;h2 id=&quot;vs2019-issues&quot;&gt;VS2019 issues&lt;/h2&gt;
&lt;p&gt;In VS2019, the following code :&lt;/p&gt;

&lt;div class=&quot;language-csharp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kt&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Span&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;with a project file like this:&lt;/p&gt;
&lt;div class=&quot;language-xml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;Project&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Sdk=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;MSBuild.Sdk.Extras/1.6.46&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;PropertyGroup&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;TargetFrameworks&amp;gt;&lt;/span&gt;xamarinios10;monoandroid90&lt;span class=&quot;nt&quot;&gt;&amp;lt;/TargetFrameworks&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/PropertyGroup&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;ItemGroup&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;PackageReference&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Include=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;System.Memory&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Version=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;4.5.2&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/ItemGroup&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/Project&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;does not build in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Xamarin.iOS10&lt;/code&gt;, giving this error:&lt;/p&gt;

&lt;p&gt;`
error CS0433: The type ‘Span&lt;T&gt;' exists in both 
'System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' and 
'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'
`&lt;/T&gt;&lt;/p&gt;

&lt;p&gt;One easy fix would be to remove the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;System.Memory&lt;/code&gt; package because &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;mscorlib&lt;/code&gt; already provides it, but it would prevent this library from building with VS15.9 and below.&lt;/p&gt;

&lt;p&gt;We could also only add &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;System.Memory&lt;/code&gt; as a normal assembly reference, which would work on both VS versions, but it would break the NuGet package creation and make the consumption of the project’s resulting NuGet package difficult.&lt;/p&gt;

&lt;h2 id=&quot;adjusting-references-during-the-build&quot;&gt;Adjusting references during the build&lt;/h2&gt;

&lt;p&gt;In recent MSBuild, there is a new &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MSBuildVersion&lt;/code&gt; property which tells the currently running version. While this is far from perfect, we can assume that when a given MSBuild version is installed at the same time as Xamarin for an installation of Visual Studio, the MSBuild version is implicitly tied to the installed Xamarin version.&lt;/p&gt;

&lt;p&gt;To keep the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PackageReference&lt;/code&gt; visible for the NuGet packing, but remove the assembly reference added by the package, only in VS16.x, we can inject an MSBuild target:&lt;/p&gt;

&lt;div class=&quot;language-xml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;Project&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Sdk=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;MSBuild.Sdk.Extras/1.6.46&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;PropertyGroup&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;TargetFrameworks&amp;gt;&lt;/span&gt;xamarinios10&lt;span class=&quot;nt&quot;&gt;&amp;lt;/TargetFrameworks&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/PropertyGroup&amp;gt;&lt;/span&gt;

  &lt;span class=&quot;nt&quot;&gt;&amp;lt;ItemGroup&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;PackageReference&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Include=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;System.Memory&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Version=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;4.5.2&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/ItemGroup&amp;gt;&lt;/span&gt;
  
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;Target&lt;/span&gt; 
    &lt;span class=&quot;na&quot;&gt;Name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;VS16_RemoveSystemMemory&quot;&lt;/span&gt; 
    &lt;span class=&quot;na&quot;&gt;BeforeTargets=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;FindReferenceAssembliesForReferences&quot;&lt;/span&gt; 
    &lt;span class=&quot;na&quot;&gt;Condition=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;'$(MSBuildVersion)' &amp;amp;gt;= '16.0'&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;ItemGroup&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;_ReferencePathToRemove&lt;/span&gt; 
        &lt;span class=&quot;na&quot;&gt;Include=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;@(ReferencePath)&quot;&lt;/span&gt; 
        &lt;span class=&quot;na&quot;&gt;Condition=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;'%(ReferencePath.NuGetPackageId)'=='System.Memory'&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;ReferencePath&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Remove=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;@(_ReferencePathToRemove)&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/ItemGroup&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;Message&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Text=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Removing System.Memory for VS 2019 compatibility&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;Importance=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;high&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/Target&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/Project&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;'$(MSBuildVersion)' &amp;amp;gt;= '16.0'&lt;/code&gt; condition ensure that the target only runs when VS 16.0 is used to build the project. Then we remove the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ReferencePath&lt;/code&gt; item that is generated by the loading of the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;PackageReference Include=&quot;System.Memory&quot; /&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The target is injected automatically before the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;FindReferenceAssembliesForReferences&lt;/code&gt; that can be found by looking at the generated binary log, and searching where the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ReferencePath&lt;/code&gt; values are manipulated to be provided to the CSC task.&lt;/p&gt;

&lt;p&gt;Interestingly enough, this manipulation does not need to be made in Xamarin.iOS head projects, where the reference seems to be automatically adjusted to be removed by the existing targets.&lt;/p&gt;</content><author><name>Jerome</name></author><category term="Archive" /><category term=".NET" /><category term="xamarin" /><summary type="html">System.Memory exists to provide the Span&amp;lt;T&amp;gt;, Memory&amp;lt;T&amp;gt; and similar types, for which C# 7.x provided support, and it can enable significant performance improvements where appropriate. While .NET Standard 2.0 does not have support for it in its available API surface, there the System.Memory NuGet package that can be added to enable it. As part of the code sharing effort, Mono and Xamarin added support for System.Memory in the BCL as part of the releases bundled with VS 2019. While this is a very important step to make Mono and .NET Core very similar in behavior, this brings issues because the Xamarin.iOS, Xamarin.Mac and MonoAndroid target frameworks are not versioned like .NET Core or .NET Standard. The Visual Studio version used to build a project has an impact on the code’s behavior or compatibility that cannot be adjusted as easily as changing a Target Framework version.</summary></entry></feed>