<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: dongdongzhang</title>
    <description>The latest articles on DEV Community by dongdongzhang (@dongdongzhang).</description>
    <link>https://dev.to/dongdongzhang</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1079301%2F3f0a8e27-1e05-4225-a5a1-3f1709526c93.png</url>
      <title>DEV Community: dongdongzhang</title>
      <link>https://dev.to/dongdongzhang</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dongdongzhang"/>
    <language>en</language>
    <item>
      <title>webpack publicpath</title>
      <dc:creator>dongdongzhang</dc:creator>
      <pubDate>Mon, 29 Jul 2024 02:30:16 +0000</pubDate>
      <link>https://dev.to/dongdongzhang/webpack-publicpath-321h</link>
      <guid>https://dev.to/dongdongzhang/webpack-publicpath-321h</guid>
      <description>&lt;p&gt;The publicPath configuration option acts as a placeholder, allowing you to dynamically adjust the paths to your static assets.&lt;/p&gt;

&lt;p&gt;To illustrate, let's consider the scenario where you've uploaded your static assets, such as commons.js  to a CDN. The actual URL for this file might be:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;https://s1.cdn.com/my-project/commons.js&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;However, your HTML page is typically served from your own domain, for example:&lt;br&gt;
&lt;code&gt;https://my-own-domain.com/my-project/index.html&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To ensure that the index.html correctly references the CDN-hosted static files, you can utilize the publicPath setting. This configuration will replace the local path of commons.js within index.html from:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;https://my-own-domain.com/my-project/commons.js&lt;/code&gt;&lt;br&gt;
to the CDN path:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;https://s1.cdn.com/my-project/commons.js&lt;/code&gt;&lt;br&gt;
By setting the publicPath, you ensure that all references to static assets in your HTML files point to the correct CDN URLs, facilitating efficient content delivery.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webpack</category>
      <category>react</category>
      <category>webdev</category>
    </item>
    <item>
      <title>build a instagram message chat app</title>
      <dc:creator>dongdongzhang</dc:creator>
      <pubDate>Sun, 14 Jul 2024 08:44:54 +0000</pubDate>
      <link>https://dev.to/dongdongzhang/build-a-instagram-message-chat-app-ibn</link>
      <guid>https://dev.to/dongdongzhang/build-a-instagram-message-chat-app-ibn</guid>
      <description>&lt;p&gt;Hello, everyone! I have just build a web version of a chat application, similar to the cover image above&lt;/p&gt;

&lt;p&gt;You can watch a brief introduction video &lt;a href="https://youtu.be/S7Zanjrw8v4?si=O_JoZFdD8aPkmBms" rel="noopener noreferrer"&gt;youtube&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The project consists of both client-side and server-side. &lt;br&gt;
The client-side utilizes &lt;a href="https://vitejs.dev/guide/" rel="noopener noreferrer"&gt;create-vite-app&lt;/a&gt; with &lt;code&gt;Reactjs&lt;/code&gt;+&lt;code&gt;Typescript&lt;/code&gt;&lt;br&gt;
On the server-side,we will use &lt;code&gt;GraphQL&lt;/code&gt;, &lt;code&gt;Apollo&lt;/code&gt;,&lt;code&gt;MongoDB&lt;/code&gt;,&lt;code&gt;Mongoose&lt;/code&gt;&lt;br&gt;
The design file can be accessed  &lt;a href="https://www.figma.com/design/AVkjKyXt9UpJPdxJt6EoV5/10-Real-Chat%2FMessaging-Pages---Facebook%2C-Reddit%2C-Snapchat-%26-more-(Community)?node-id=0-1&amp;amp;t=gx4KTbUaNaN409XH-0" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why use GraphQL？
&lt;/h2&gt;

&lt;p&gt;It's incredibly easy to use just right out of the box when starting up, and it can readily scale to meet large-scale demands when needed.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;GraphQL is based on HTTP POST and has only one endpoint; all your request commands like CRUD operations, are sent via this single endpoint.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;GraphQL is really convenient  when nesting queries.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Apollo Framework provides builtin functionalities such as server management, API testing, And WebSocket subscriptions for message handling.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The source code at &lt;a href="https://github.com/zwd321081/instgram-messages/tree/master" rel="noopener noreferrer"&gt;github&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>graphql</category>
      <category>react</category>
      <category>mongodb</category>
    </item>
    <item>
      <title>An easier way to deploy AstroJS on GitHub Pages</title>
      <dc:creator>dongdongzhang</dc:creator>
      <pubDate>Sat, 13 Jul 2024 10:48:34 +0000</pubDate>
      <link>https://dev.to/dongdongzhang/an-easier-way-to-deploy-astrojs-on-github-pages-1m45</link>
      <guid>https://dev.to/dongdongzhang/an-easier-way-to-deploy-astrojs-on-github-pages-1m45</guid>
      <description>&lt;p&gt;It may be a little confusing when you follow the AstroJS official guide to deploy your blog on GitHub. Don't worry, I found an easier way. Follow these steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Choose a theme.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I like the &lt;a href="https://github.com/JustGoodUI/dante-astro-theme" rel="noopener noreferrer"&gt;Dante&lt;/a&gt; theme &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Rename the repository to {username}.github.io&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As I did with &lt;a href="https://github.com/zwd321081/zwd321081.github.io" rel="noopener noreferrer"&gt;zwd321081.github.io&lt;/a&gt;.This is crucial because Github pages has specific naming rules&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to the Actions tab and search for the Astro workflow&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fql7doil427swwfvyvfys.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fql7doil427swwfvyvfys.png" alt="astro workflow" width="800" height="482"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Making some  modification to &lt;code&gt;astro.yml&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Remove the &lt;code&gt;--site&lt;/code&gt; and &lt;code&gt;--base&lt;/code&gt; options. This will result in your default  URL being structured as &lt;code&gt;https://{username}.github.io/{reponame}&lt;/code&gt;.&lt;br&gt;
 By removing these options, you eliminate the subpage path.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0f1vu7x98p8jwfvhgdb6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0f1vu7x98p8jwfvhgdb6.png" alt="config" width="800" height="118"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Visit your page at the domain https://{username}.github.io, such as &lt;a href="https://zwd321081.github.io/" rel="noopener noreferrer"&gt;mine&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
      <category>astro</category>
      <category>github</category>
      <category>career</category>
    </item>
    <item>
      <title>Npm Deprecated problem</title>
      <dc:creator>dongdongzhang</dc:creator>
      <pubDate>Fri, 28 Jul 2023 06:07:21 +0000</pubDate>
      <link>https://dev.to/dongdongzhang/npm-depreacted-problem-c79</link>
      <guid>https://dev.to/dongdongzhang/npm-depreacted-problem-c79</guid>
      <description>&lt;p&gt;When using &lt;code&gt;npm install&lt;/code&gt;, you won't install a deprecated version&lt;/p&gt;

&lt;p&gt;Nevertheless, this is only compatible with npm version 5 and higher, so it won't function on older Node.js versions.&lt;/p&gt;

</description>
      <category>node</category>
      <category>npm</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
