<?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: Samuel Ruiz</title>
    <description>The latest articles on DEV Community by Samuel Ruiz (@samuel_ruiz_64604c4d0ba22).</description>
    <link>https://dev.to/samuel_ruiz_64604c4d0ba22</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%2F3075961%2Fbdf6f337-5cdf-4315-b1b9-43d18675d55d.png</url>
      <title>DEV Community: Samuel Ruiz</title>
      <link>https://dev.to/samuel_ruiz_64604c4d0ba22</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/samuel_ruiz_64604c4d0ba22"/>
    <language>en</language>
    <item>
      <title>BENEFITS OF MODELING</title>
      <dc:creator>Samuel Ruiz</dc:creator>
      <pubDate>Wed, 11 Feb 2026 22:19:48 +0000</pubDate>
      <link>https://dev.to/samuel_ruiz_64604c4d0ba22/benefits-of-modeling-1cef</link>
      <guid>https://dev.to/samuel_ruiz_64604c4d0ba22/benefits-of-modeling-1cef</guid>
      <description>&lt;ol&gt;
&lt;li&gt;Enhanced Requirements Management&lt;/li&gt;
&lt;li&gt;Streamlined requirements generation.&lt;/li&gt;
&lt;li&gt;Increased end-to-end traceability.&lt;/li&gt;
&lt;li&gt;Superior System Design&lt;/li&gt;
&lt;li&gt;Reduced design errors and inconsistencies.&lt;/li&gt;
&lt;li&gt;Enhanced analytical capabilities and system quality.&lt;/li&gt;
&lt;li&gt;Operational Effectiveness&lt;/li&gt;
&lt;li&gt;Lowered total lifecycle costs.&lt;/li&gt;
&lt;li&gt;Reduced overall schedule duration.&lt;/li&gt;
&lt;li&gt;Note: Does not typically reduce initial systems design time.&lt;/li&gt;
&lt;li&gt;Long-term Strategic Value&lt;/li&gt;
&lt;li&gt;Increased capacity for component reuse.&lt;/li&gt;
&lt;li&gt;Advanced support for automation and tool integration.&lt;/li&gt;
&lt;/ol&gt;

</description>
    </item>
    <item>
      <title>What to Review Before Merging to `main`: A Practical Code Review Checklist</title>
      <dc:creator>Samuel Ruiz</dc:creator>
      <pubDate>Tue, 20 Jan 2026 19:42:29 +0000</pubDate>
      <link>https://dev.to/samuel_ruiz_64604c4d0ba22/what-to-review-before-merging-to-main-a-practical-code-review-checklist-2b8l</link>
      <guid>https://dev.to/samuel_ruiz_64604c4d0ba22/what-to-review-before-merging-to-main-a-practical-code-review-checklist-2b8l</guid>
      <description>&lt;p&gt;Merging to &lt;code&gt;main&lt;/code&gt; is not a formality. It’s a commitment.&lt;br&gt;
Once code lands there, it becomes &lt;strong&gt;someone else’s problem&lt;/strong&gt;, &lt;strong&gt;future you’s problem&lt;/strong&gt;, and potentially &lt;strong&gt;production’s problem&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Here’s a checklist I use before approving any pull request. If these points aren’t met, the code is &lt;strong&gt;not ready&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Unit Tests Exist (or There’s a Real Reason They Don’t)
&lt;/h2&gt;

&lt;p&gt;If there are &lt;strong&gt;no unit tests&lt;/strong&gt;, the default assumption is that the code is incomplete.&lt;/p&gt;

&lt;p&gt;Questions to ask:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Are unit tests present for new logic?&lt;/li&gt;
&lt;li&gt;If not, is there a &lt;strong&gt;clear, documented reason&lt;/strong&gt; why?&lt;/li&gt;
&lt;li&gt;Is this logic testable at all?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;“No time” is not a valid reason.&lt;br&gt;
“No idea how to test it” is a red flag.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Unit Tests Actually Assert Behavior
&lt;/h2&gt;

&lt;p&gt;Tests without assertions are meaningless.&lt;/p&gt;

&lt;p&gt;Things to verify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every test has &lt;strong&gt;at least one assertion&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Assertions validate &lt;strong&gt;behavior&lt;/strong&gt;, not just execution&lt;/li&gt;
&lt;li&gt;Tests fail when the feature breaks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Bad tests give false confidence.&lt;br&gt;
A green test suite that proves nothing is worse than no tests at all.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. UI Matches the Design System
&lt;/h2&gt;

&lt;p&gt;Code that “works” but ignores design standards creates silent debt.&lt;/p&gt;

&lt;p&gt;Check for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Correct colors (tokens, not hardcoded values)&lt;/li&gt;
&lt;li&gt;Consistent padding, spacing, and alignment&lt;/li&gt;
&lt;li&gt;Proper positioning across breakpoints&lt;/li&gt;
&lt;li&gt;No “close enough” UI decisions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the team has a design system, &lt;strong&gt;use it or explain why you didn’t&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. The Code Is Readable, Simple, and Intentional
&lt;/h2&gt;

&lt;p&gt;Before merging, ask yourself:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Does this code &lt;strong&gt;make sense at first glance&lt;/strong&gt;?&lt;/li&gt;
&lt;li&gt;Are variable and function names clear?&lt;/li&gt;
&lt;li&gt;Is there unused or dead logic?&lt;/li&gt;
&lt;li&gt;Is complexity justified—or accidental?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Also verify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The code follows &lt;strong&gt;existing team patterns&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;No custom abstractions where simple logic would do&lt;/li&gt;
&lt;li&gt;No clever tricks that reduce readability&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Readable code scales. Clever code breaks teams.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. It Works on Mobile and Touch Screens
&lt;/h2&gt;

&lt;p&gt;Desktop-only thinking ships broken products.&lt;/p&gt;

&lt;p&gt;Validate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Responsive layout (small, medium, large screens)&lt;/li&gt;
&lt;li&gt;Touch targets are large enough&lt;/li&gt;
&lt;li&gt;No hover-only interactions&lt;/li&gt;
&lt;li&gt;Scroll, focus, and keyboard behavior make sense&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If it fails on a phone, it fails—period.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. Folder Structure and File Placement Are Correct
&lt;/h2&gt;

&lt;p&gt;Where code lives matters.&lt;/p&gt;

&lt;p&gt;Check that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Files follow the established folder structure&lt;/li&gt;
&lt;li&gt;No random dumping into &lt;code&gt;utils&lt;/code&gt;, &lt;code&gt;helpers&lt;/code&gt;, or &lt;code&gt;components&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;The structure communicates intent&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Poor structure compounds fast and is painful to undo later.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. Storybook Exists (When It Should) and Covers All States
&lt;/h2&gt;

&lt;p&gt;If the project uses Storybook, it’s not optional.&lt;/p&gt;

&lt;p&gt;Verify:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stories exist for new components&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;All important states are covered:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Loading&lt;/li&gt;
&lt;li&gt;Empty&lt;/li&gt;
&lt;li&gt;Error&lt;/li&gt;
&lt;li&gt;Disabled&lt;/li&gt;
&lt;li&gt;Edge cases&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;If a component has logic and UI states, it should be explorable in isolation.&lt;/p&gt;




&lt;h2&gt;
  
  
  8. Performance Has Been Considered
&lt;/h2&gt;

&lt;p&gt;Performance issues rarely announce themselves—they sneak in.&lt;/p&gt;

&lt;p&gt;Look for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Unnecessary re-renders&lt;/li&gt;
&lt;li&gt;Expensive calculations without memoization&lt;/li&gt;
&lt;li&gt;Effects firing too often&lt;/li&gt;
&lt;li&gt;Large lists without virtualization&lt;/li&gt;
&lt;li&gt;Over-fetching data&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You don’t need to over-optimize—but ignoring performance entirely is irresponsible.&lt;/p&gt;




&lt;h2&gt;
  
  
  9. ESLint and Prettier Are Clean
&lt;/h2&gt;

&lt;p&gt;This is the easiest check and the least negotiable.&lt;/p&gt;

&lt;p&gt;Before merging:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ESLint errors are fixed&lt;/li&gt;
&lt;li&gt;Warnings are intentional and justified&lt;/li&gt;
&lt;li&gt;Prettier has been run&lt;/li&gt;
&lt;li&gt;TS compiler passes with no errors&lt;/li&gt;
&lt;li&gt;No formatting noise in the diff&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If tools can fix it automatically, humans shouldn’t review it.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Rule Before Merging
&lt;/h2&gt;

&lt;p&gt;Before approving, ask yourself one last question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Would I be comfortable owning this code six months from now?&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If the answer is no, don’t merge it.&lt;/p&gt;

&lt;p&gt;Code reviews aren’t about blocking people.&lt;br&gt;
They’re about protecting the codebase—and the team—from unnecessary pain.&lt;/p&gt;




&lt;h2&gt;
  
  
  Here's a checklist you can follow
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🧪 Testing
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;[ ] &lt;strong&gt;Unit tests exist&lt;/strong&gt; for all new or changed logic&lt;/li&gt;
&lt;li&gt;[ ] All unit tests include &lt;strong&gt;meaningful assertions&lt;/strong&gt; (no empty or “render-only” tests)&lt;/li&gt;
&lt;li&gt;[ ] Tests validate &lt;strong&gt;behavior&lt;/strong&gt;, not implementation details&lt;/li&gt;
&lt;li&gt;[ ] Edge cases are covered (errors, empty states, boundaries)&lt;/li&gt;
&lt;li&gt;[ ] Tests are deterministic (no random values, real dates, or timing issues)&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🎨 UI / UX (If Applicable)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;[ ] UI follows the &lt;strong&gt;design system&lt;/strong&gt; (colors, spacing, typography, positioning)&lt;/li&gt;
&lt;li&gt;[ ] No hardcoded styles where design tokens exist&lt;/li&gt;
&lt;li&gt;[ ] Layout is &lt;strong&gt;responsive&lt;/strong&gt; (mobile, tablet, desktop)&lt;/li&gt;
&lt;li&gt;[ ] Works correctly on &lt;strong&gt;touch devices&lt;/strong&gt; (no hover-only interactions)&lt;/li&gt;
&lt;li&gt;[ ] Accessibility basics are respected (focus, contrast, click targets)&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🧠 Code Quality
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Code is &lt;strong&gt;easy to read and understand&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;[ ] No unused variables, functions, or dead logic&lt;/li&gt;
&lt;li&gt;[ ] Complex logic is justified and documented (or refactored)&lt;/li&gt;
&lt;li&gt;[ ] Naming clearly reflects intent&lt;/li&gt;
&lt;li&gt;[ ] Code follows &lt;strong&gt;existing team patterns and conventions&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  📁 Project Structure
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Files follow the &lt;strong&gt;established folder structure&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;[ ] No “dumping” code into generic folders (&lt;code&gt;utils&lt;/code&gt;, &lt;code&gt;helpers&lt;/code&gt;, etc.)&lt;/li&gt;
&lt;li&gt;[ ] New folders or patterns are explained and intentional&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  📘 Storybook (If Applicable)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Storybook stories exist for new components&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;[ ] All relevant states are covered:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Default&lt;/li&gt;
&lt;li&gt;[ ] Loading&lt;/li&gt;
&lt;li&gt;[ ] Empty&lt;/li&gt;
&lt;li&gt;[ ] Error&lt;/li&gt;
&lt;li&gt;[ ] Disabled / Edge cases&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  ⚡ Performance
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;[ ] No unnecessary re-renders&lt;/li&gt;
&lt;li&gt;[ ] Expensive logic is memoized or optimized&lt;/li&gt;
&lt;li&gt;[ ] Effects and subscriptions are scoped correctly&lt;/li&gt;
&lt;li&gt;[ ] Large lists or heavy UI are handled efficiently&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🧹 Tooling &amp;amp; Standards
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;[ ] ESLint passes with &lt;strong&gt;no errors&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;[ ] Prettier has been run&lt;/li&gt;
&lt;li&gt;[ ] No unnecessary lint disables&lt;/li&gt;
&lt;li&gt;[ ] CI checks are green&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🧾 Final Confirmation
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;[ ] I would be comfortable &lt;strong&gt;maintaining this code in 6 months&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;[ ] This PR is ready to be merged into &lt;code&gt;main&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>react</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Most React Code Is Hard to Read Because Developers Ignore This One Rule</title>
      <dc:creator>Samuel Ruiz</dc:creator>
      <pubDate>Tue, 20 Jan 2026 19:28:16 +0000</pubDate>
      <link>https://dev.to/samuel_ruiz_64604c4d0ba22/most-react-code-is-hard-to-read-because-developers-ignore-this-one-rule-74i</link>
      <guid>https://dev.to/samuel_ruiz_64604c4d0ba22/most-react-code-is-hard-to-read-because-developers-ignore-this-one-rule-74i</guid>
      <description>&lt;p&gt;Naming is one of the cheapest ways to prevent bugs and mental overhead in React/JS codebases.&lt;/p&gt;

&lt;p&gt;Below are &lt;strong&gt;practical, opinionated naming conventions that actually matter&lt;/strong&gt;—with examples that make intent obvious at the call site.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. &lt;strong&gt;Naming Functions&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;If you need comments to explain what a function does, &lt;strong&gt;the name already failed&lt;/strong&gt;. The naming of a function should tell you what's about without having you read the function definition.&lt;/p&gt;

&lt;h3&gt;
  
  
  ❌ Bad
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nf"&gt;getUser&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ✅ Good
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nf"&gt;fetchUserAPI&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;      &lt;span class="c1"&gt;// network&lt;/span&gt;
&lt;span class="nf"&gt;calculateUserAge&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  &lt;span class="c1"&gt;// pure&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why it matters&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You instantly know &lt;strong&gt;what can fail&lt;/strong&gt; and &lt;strong&gt;what can be a synchronous&lt;/strong&gt; function.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2. &lt;strong&gt;Async Functions Must Signal Asynchrony&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Rule:&lt;/strong&gt; Async work should be visible without reading implementation.&lt;/p&gt;

&lt;h3&gt;
  
  
  ❌ Bad
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nf"&gt;getOrders&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ✅ Good
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nf"&gt;getOrdersAsync&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="nf"&gt;fetchOrdersApi&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="nf"&gt;loadOrders&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Strong signal hierarchy&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;fetch*&lt;/code&gt; → network&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;get*&lt;/code&gt; → synchronous access&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  3. &lt;strong&gt;React Components vs Utilities&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Rule:&lt;/strong&gt; Components are nouns. Utilities are verbs.&lt;/p&gt;

&lt;h3&gt;
  
  
  ❌ Bad
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;RenderUser&lt;/span&gt;
&lt;span class="nx"&gt;UserHandler&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ✅ Good
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;UserCard&lt;/span&gt;        &lt;span class="c1"&gt;// component&lt;/span&gt;
&lt;span class="nx"&gt;UserList&lt;/span&gt;        &lt;span class="c1"&gt;// component&lt;/span&gt;
&lt;span class="nx"&gt;formatUserName&lt;/span&gt; &lt;span class="c1"&gt;// utility&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Bonus&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Components &lt;strong&gt;never&lt;/strong&gt; start with verbs.&lt;/li&gt;
&lt;li&gt;Utilities &lt;strong&gt;always&lt;/strong&gt; start with verbs.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  4. &lt;strong&gt;Event Handlers&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Rule:&lt;/strong&gt; Events describe &lt;strong&gt;what happened&lt;/strong&gt;, not &lt;strong&gt;what you’ll do&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  ❌ Bad
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nf"&gt;submit&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="nf"&gt;click&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ✅ Good
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nf"&gt;handleSubmit&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="nf"&gt;handleUserClick&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="nf"&gt;handleModalClose&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;React-specific&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Always prefix with &lt;code&gt;handle&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Makes JSX scanning painless&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  5. &lt;strong&gt;Boolean Variables&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Rule:&lt;/strong&gt; Booleans must read like a yes/no question.&lt;/p&gt;

&lt;h3&gt;
  
  
  ❌ Bad
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;loading&lt;/span&gt;
&lt;span class="nx"&gt;active&lt;/span&gt;
&lt;span class="nx"&gt;valid&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ✅ Good
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;isLoading&lt;/span&gt;
&lt;span class="nx"&gt;isActive&lt;/span&gt;
&lt;span class="nx"&gt;isValid&lt;/span&gt;
&lt;span class="nx"&gt;hasAccess&lt;/span&gt;
&lt;span class="nx"&gt;canEdit&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;If it sounds awkward in an &lt;code&gt;if&lt;/code&gt;, it’s wrong.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;isUserAuthenticated&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="err"&gt;✅&lt;/span&gt;
&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;userAuthenticated&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="err"&gt;❌&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  6. &lt;strong&gt;State Setters (React)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Rule:&lt;/strong&gt; Setters must mirror state exactly.&lt;/p&gt;

&lt;h3&gt;
  
  
  ❌ Bad
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;open&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;toggleOpen&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ✅ Good
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;isOpen&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setIsOpen&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Predictable&lt;/li&gt;
&lt;li&gt;Greppable&lt;/li&gt;
&lt;li&gt;No surprises for teammates&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  7. &lt;strong&gt;Files That Touch the Outside World&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Rule:&lt;/strong&gt; Files that hit the world should scream.&lt;/p&gt;

&lt;h3&gt;
  
  
  ❌ Bad
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ts&lt;/span&gt;
&lt;span class="nx"&gt;utils&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ts&lt;/span&gt;
&lt;span class="nx"&gt;helpers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ts&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ✅ Good
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;api&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ts&lt;/span&gt;
&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;service&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ts&lt;/span&gt;
&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;mapper&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ts&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you instantly know:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;.api.ts&lt;/code&gt; → network&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.mapper.ts&lt;/code&gt; → transformations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;NOTE: You don’t need to specify the file type (user.api.ts) as long as the file is under the ./apis folder.&lt;/p&gt;




&lt;h2&gt;
  
  
  8. &lt;strong&gt;Hooks&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Rule:&lt;/strong&gt; Hooks describe &lt;strong&gt;what they provide&lt;/strong&gt;, not how.&lt;/p&gt;

&lt;h3&gt;
  
  
  ❌ Bad
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nf"&gt;useFetchUser&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ✅ Better
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nf"&gt;useUser&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="nf"&gt;useAuthenticatedUser&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="nf"&gt;useUserPermissions&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let the hook &lt;strong&gt;hide implementation details&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Mental Model Summary
&lt;/h2&gt;

&lt;p&gt;Good naming answers these &lt;strong&gt;without reading code&lt;/strong&gt;:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Question&lt;/th&gt;
&lt;th&gt;Naming Signal&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Hits the network? Async?&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;fetch&lt;/code&gt;, &lt;code&gt;.api.ts&lt;/code&gt;, &lt;code&gt;fetch&lt;/code&gt;, &lt;code&gt;load&lt;/code&gt;, &lt;code&gt;Async&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mutates state?&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;set&lt;/code&gt;, &lt;code&gt;mutate&lt;/code&gt;, &lt;code&gt;append&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pure logic?&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;calculate&lt;/code&gt;, &lt;code&gt;format&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UI component?&lt;/td&gt;
&lt;td&gt;PascalCase noun&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Boolean?&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;is&lt;/code&gt;, &lt;code&gt;has&lt;/code&gt;, &lt;code&gt;can&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

</description>
      <category>react</category>
      <category>webdev</category>
      <category>programming</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Common Third-Party GUI Integration Patterns</title>
      <dc:creator>Samuel Ruiz</dc:creator>
      <pubDate>Tue, 06 Jan 2026 18:50:05 +0000</pubDate>
      <link>https://dev.to/samuel_ruiz_64604c4d0ba22/common-third-party-gui-integration-patterns-44dd</link>
      <guid>https://dev.to/samuel_ruiz_64604c4d0ba22/common-third-party-gui-integration-patterns-44dd</guid>
      <description>&lt;p&gt;At some point, almost every product needs to embed or integrate a third-party UI: payments, analytics, scheduling, support widgets, internal tools, or partner features.&lt;/p&gt;

&lt;p&gt;There are &lt;strong&gt;four common patterns&lt;/strong&gt;, each with very different tradeoffs around &lt;strong&gt;security, UX, ownership, and complexity&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;🧱 &lt;strong&gt;Iframe embed&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;📜 &lt;strong&gt;Script tag / JavaScript SDK&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;📦 &lt;strong&gt;NPM package / component library&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;🧬 &lt;strong&gt;Micro-frontend (MFE)&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Choosing the wrong one early can lock you into painful rewrites later.&lt;/p&gt;




&lt;h2&gt;
  
  
  ⚡ Quick Decision Guide
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🛡️ &lt;strong&gt;Safest, fastest “just embed it”&lt;/strong&gt; → &lt;strong&gt;Iframe&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;⚠️ &lt;strong&gt;Quick integration + tight UX (accepts global JS risk)&lt;/strong&gt; → &lt;strong&gt;Script tag / JS SDK&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;🎯 &lt;strong&gt;Best UX + full control + shared design system&lt;/strong&gt; → &lt;strong&gt;NPM package&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;🏗️ &lt;strong&gt;Independent deploys + large teams&lt;/strong&gt; → &lt;strong&gt;Micro-frontend (MFE)&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you’re unsure, start with &lt;strong&gt;iframe&lt;/strong&gt;. You can always move down the list—but moving up is expensive.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧱 1. Iframe Embed
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🔍 What it is
&lt;/h3&gt;

&lt;p&gt;You render third-party UI inside an &lt;code&gt;&amp;lt;iframe&amp;gt;&lt;/code&gt; pointing to a URL hosted by the vendor (or another internal team).&lt;/p&gt;

&lt;p&gt;The iframe runs in a &lt;strong&gt;separate browsing context&lt;/strong&gt;, isolated from your app’s JS and CSS.&lt;/p&gt;




&lt;h3&gt;
  
  
  💻 Basic Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;iframe&lt;/span&gt;
  &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://vendor.example.com/widget?tenant=acme"&lt;/span&gt;
  &lt;span class="na"&gt;title=&lt;/span&gt;&lt;span class="s"&gt;"Vendor Widget"&lt;/span&gt;
  &lt;span class="na"&gt;width=&lt;/span&gt;&lt;span class="s"&gt;"100%"&lt;/span&gt;
  &lt;span class="na"&gt;height=&lt;/span&gt;&lt;span class="s"&gt;"700"&lt;/span&gt;
  &lt;span class="na"&gt;loading=&lt;/span&gt;&lt;span class="s"&gt;"lazy"&lt;/span&gt;
  &lt;span class="na"&gt;style=&lt;/span&gt;&lt;span class="s"&gt;"border:0; border-radius:12px;"&lt;/span&gt;
&lt;span class="nt"&gt;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  🔐 Secure Sandbox Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;iframe&lt;/span&gt;
  &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://vendor.example.com/widget?tenant=acme"&lt;/span&gt;
  &lt;span class="na"&gt;title=&lt;/span&gt;&lt;span class="s"&gt;"Vendor Widget"&lt;/span&gt;
  &lt;span class="na"&gt;width=&lt;/span&gt;&lt;span class="s"&gt;"100%"&lt;/span&gt;
  &lt;span class="na"&gt;height=&lt;/span&gt;&lt;span class="s"&gt;"700"&lt;/span&gt;
  &lt;span class="na"&gt;sandbox=&lt;/span&gt;&lt;span class="s"&gt;"allow-scripts allow-forms allow-popups"&lt;/span&gt;
  &lt;span class="na"&gt;allow=&lt;/span&gt;&lt;span class="s"&gt;"clipboard-read; clipboard-write"&lt;/span&gt;
  &lt;span class="na"&gt;style=&lt;/span&gt;&lt;span class="s"&gt;"border:0;"&lt;/span&gt;
&lt;span class="nt"&gt;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  🔁 Parent ↔ Child Communication (&lt;code&gt;postMessage&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Parent&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;iframe&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vendor-iframe&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;HTMLIFrameElement&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;message&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;origin&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://vendor.example.com&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;READY&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;iframe&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;contentWindow&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;postMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;SET_THEME&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;dark&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://vendor.example.com&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Child&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;parent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;postMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;READY&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://host.example.com&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  ✅ Pros
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;🛡️ Strong isolation (security, CSS, JS)&lt;/li&gt;
&lt;li&gt;🔄 Easy rollback&lt;/li&gt;
&lt;li&gt;🚀 Vendor deploys independently&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  ❌ Cons
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;🎨 Styling consistency is harder&lt;/li&gt;
&lt;li&gt;🔁 Requires &lt;code&gt;postMessage&lt;/code&gt; plumbing&lt;/li&gt;
&lt;li&gt;🔍 SEO &amp;amp; accessibility limitations&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🎯 Use when
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Vendor is untrusted&lt;/li&gt;
&lt;li&gt;Security &amp;gt; UX polish&lt;/li&gt;
&lt;li&gt;You want minimal blast radius&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📜 2. Script Tag / JavaScript SDK
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🔍 What it is
&lt;/h3&gt;

&lt;p&gt;A vendor-hosted script injects UI or exposes a global SDK that runs &lt;strong&gt;inside your app’s origin&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  💻 HTML Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"vendor-root"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://cdn.vendor.com/widget/v1/widget.min.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="nx"&gt;VendorWidget&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;mount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#vendor-root&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;tenant&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;acme&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;light&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  ⚛️ React Wrapper Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;useRef&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;VendorWidget&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;tenant&lt;/span&gt; &lt;span class="p"&gt;}:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;tenant&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ref&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useRef&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;HTMLDivElement&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;instance&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;VendorWidget&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;mount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ref&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;tenant&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;instance&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;unmount&lt;/span&gt;&lt;span class="p"&gt;?.();&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;tenant&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;ref&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;ref&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  ✅ Pros
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;🎯 Better UX than iframe&lt;/li&gt;
&lt;li&gt;⚡ Fast integration&lt;/li&gt;
&lt;li&gt;🧩 No build-time dependency&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  ❌ Cons (Real Risks)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;☠️ Executes untrusted JS in your origin&lt;/li&gt;
&lt;li&gt;🎨 CSS / global JS conflicts&lt;/li&gt;
&lt;li&gt;🐞 Painful debugging&lt;/li&gt;
&lt;li&gt;📦 CDN version drift&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🛡️ Required Safety Measures
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;🔒 Pin exact versions&lt;/li&gt;
&lt;li&gt;🧾 Use SRI&lt;/li&gt;
&lt;li&gt;🚧 Lock down CSP&lt;/li&gt;
&lt;li&gt;🧩 Demand namespaced CSS or Shadow DOM&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🎯 Use when
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Vendor is trusted&lt;/li&gt;
&lt;li&gt;Widget is small&lt;/li&gt;
&lt;li&gt;Speed matters more than isolation&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📦 3. NPM Package / Component Library
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🔍 What it is
&lt;/h3&gt;

&lt;p&gt;You install the vendor UI as a dependency and render it directly.&lt;/p&gt;

&lt;p&gt;This gives the &lt;strong&gt;best UX&lt;/strong&gt;—and the most responsibility.&lt;/p&gt;




&lt;h3&gt;
  
  
  📥 Install
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; @vendor/ui @vendor/sdk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  ⚛️ React Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;VendorCheckout&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@vendor/ui&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;Checkout&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;VendorCheckout&lt;/span&gt;
      &lt;span class="na"&gt;customerId&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"cust_123"&lt;/span&gt;
      &lt;span class="na"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"light"&lt;/span&gt;
      &lt;span class="na"&gt;onSuccess&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  ✅ Pros
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;🏆 Best UX&lt;/li&gt;
&lt;li&gt;🧪 Fully testable&lt;/li&gt;
&lt;li&gt;🔢 Explicit version control&lt;/li&gt;
&lt;li&gt;🎨 Design system alignment&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  ❌ Cons
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;📦 Bundle size impact&lt;/li&gt;
&lt;li&gt;🔗 Dependency conflicts&lt;/li&gt;
&lt;li&gt;💥 Vendor bugs can break builds&lt;/li&gt;
&lt;li&gt;🚫 No isolation&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🧠 Best Practices
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;🔒 Pin versions&lt;/li&gt;
&lt;li&gt;⏳ Lazy-load heavy UI&lt;/li&gt;
&lt;li&gt;🧱 Wrap with adapter components&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🎯 Use when
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;UI is core to your product&lt;/li&gt;
&lt;li&gt;You own UX decisions&lt;/li&gt;
&lt;li&gt;You accept upgrade ownership&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧬 4. Micro-Frontend (MFE)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🔍 What it is
&lt;/h3&gt;

&lt;p&gt;A separately built and deployed frontend loaded at runtime.&lt;/p&gt;




&lt;h3&gt;
  
  
  🏗️ Host Loader Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;loadRemote&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;void&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;script&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;src&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;onload&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;head&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;appendChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;RemoteApp&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  🔌 Remote App Contract
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;mount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;el&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Element&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;tenant&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nf"&gt;unmount&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;RemoteApp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;mount&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  ✅ Pros
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;🚀 Independent deploys&lt;/li&gt;
&lt;li&gt;🧑‍🤝‍🧑 Team scalability&lt;/li&gt;
&lt;li&gt;🔄 Shared runtimes&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  ❌ Cons
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;🧠 High complexity&lt;/li&gt;
&lt;li&gt;🔗 Version coordination pain&lt;/li&gt;
&lt;li&gt;🐢 Slower local dev&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🎯 Use when
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Multiple teams&lt;/li&gt;
&lt;li&gt;Independent release cycles&lt;/li&gt;
&lt;li&gt;Large UI surface area&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📊 Comparison Table
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Pattern&lt;/th&gt;
&lt;th&gt;Isolation&lt;/th&gt;
&lt;th&gt;UX&lt;/th&gt;
&lt;th&gt;Complexity&lt;/th&gt;
&lt;th&gt;Risk&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;🧱 Iframe&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;📜 Script SDK&lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;td&gt;Medium–High&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;📦 NPM Library&lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;td&gt;Very High&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🧬 MFE&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  ⚠️ Critical Engineering Concerns
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🔐 Authentication
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Avoid long-lived tokens in URLs&lt;/li&gt;
&lt;li&gt;Prefer short-lived sessions&lt;/li&gt;
&lt;li&gt;Never expose secrets to iframes&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🎨 Styling
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Use theme contracts&lt;/li&gt;
&lt;li&gt;Avoid global CSS&lt;/li&gt;
&lt;li&gt;Prefer Shadow DOM when possible&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  ⚡ Performance
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Lazy-load non-critical UI&lt;/li&gt;
&lt;li&gt;Cache remote assets&lt;/li&gt;
&lt;li&gt;Watch for duplicate bundles&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🛟 Reliability
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Loading states&lt;/li&gt;
&lt;li&gt;Timeouts&lt;/li&gt;
&lt;li&gt;Graceful fallbacks&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧭 Practical Recommendations
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🛡️ Untrusted vendor → &lt;strong&gt;Iframe&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;⚠️ Trusted widget → &lt;strong&gt;Script SDK&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;🎯 Core UI → &lt;strong&gt;NPM library&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;🏗️ Large org → &lt;strong&gt;MFE&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>architecture</category>
      <category>frontend</category>
      <category>javascript</category>
    </item>
    <item>
      <title>3 Secrets to Perfectly Printed Web Pages</title>
      <dc:creator>Samuel Ruiz</dc:creator>
      <pubDate>Wed, 10 Dec 2025 23:16:41 +0000</pubDate>
      <link>https://dev.to/samuel_ruiz_64604c4d0ba22/5-secrets-to-perfectly-printed-web-pages-3h49</link>
      <guid>https://dev.to/samuel_ruiz_64604c4d0ba22/5-secrets-to-perfectly-printed-web-pages-3h49</guid>
      <description>&lt;p&gt;Generating PDFs in a modern web app sounds simple—until you actually try to do it. Between browser limitations, inconsistent HTML rendering, sandboxed environments like Electron, and the need for pixel-perfect output, developers quickly realize there’s no one-size-fits-all solution. Different tools solve different problems. Some libraries are great for building PDFs from scratch, others are ideal for filling existing templates, and some are the only reliable way to recreate a webpage exactly as it appears on screen.&lt;/p&gt;

&lt;p&gt;Some tools excel at building PDFs from scratch with custom layouts. Others are perfect for filling existing PDF templates. And a completely different set of tools is required when you need a PDF that looks exactly like the webpage your users see.&lt;br&gt;
If you choose the wrong approach, you’ll waste hours fighting broken CSS, missing fonts, cut-off pages, or slow rendering.&lt;/p&gt;

&lt;p&gt;This guide cuts through the noise and breaks down the most practical, battle-tested methods — from browser printing and React-based rendering to low-level PDF manipulation, HTML conversion engines, and Electron-specific techniques — so you can choose the right strategy for your app and avoid a weekend of debugging&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The multiple ways to print PDFs&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Comparing methods

&lt;ol&gt;
&lt;li&gt;Browser shortcut - &lt;code&gt;Ctrl + P&lt;/code&gt; (Windows) or &lt;code&gt;Cmd + P&lt;/code&gt; (Mac)&lt;/li&gt;
&lt;li&gt;React-pdf&lt;/li&gt;
&lt;li&gt;pdf-lib&lt;/li&gt;
&lt;li&gt;jsPDF&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Recommendations&lt;/li&gt;
&lt;li&gt;Client side vs Server side print&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  Comparing methods
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Browser "Print to PDF" (Fastest, but not the cleanest)
&lt;/h3&gt;

&lt;p&gt;Every browser can do this. &lt;/p&gt;

&lt;p&gt;How does it work:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open your webpage&lt;/li&gt;
&lt;li&gt;Press Ctrl + P (Windows) or Cmd + P (Mac)&lt;/li&gt;
&lt;li&gt;Select Save as PDF&lt;/li&gt;
&lt;li&gt;Adjust margins, background graphics, and layout&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Pros: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Simple&lt;/li&gt;
&lt;li&gt;No setup needed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Often messy layouts&lt;/li&gt;
&lt;li&gt;Doesn't handle long pages well&lt;/li&gt;
&lt;li&gt;Breaks when your website uses animations, dynamic content, or infinite scrolling&lt;/li&gt;
&lt;li&gt;Electron app doesn't work with &lt;code&gt;ctrl+p&lt;/code&gt;. Use Electron's &lt;code&gt;webContents.printToPDF()&lt;/code&gt; API.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// main.js&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;BrowserWindow&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ipcMain&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;dialog&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;electron&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;ipcMain&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;export-current-view-to-pdf&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;win&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;BrowserWindow&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fromWebContents&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sender&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pdfBuffer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;win&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;webContents&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;printToPDF&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;printBackground&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;marginsType&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// default&lt;/span&gt;
    &lt;span class="na"&gt;pageSize&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;A4&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;filePath&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;dialog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;showSaveDialog&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;win&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Save PDF&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;defaultPath&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;export.pdf&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;filters&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;PDF&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;extensions&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pdf&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}],&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;filePath&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;canceled&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;fs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;writeFileSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;filePath&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;pdfBuffer&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;canceled&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;filePath&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Renderer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// renderer (React)&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;electron&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;invoke&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;export-current-view-to-pdf&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;React-pdf&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;A react-based renderer that lets you build PDFs using React components, similar to building a UI. Think of it like "writing JSX for a PDF file".&lt;/p&gt;

&lt;p&gt;When to use react-pdf?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A custom-designed PDF layout (contracts, invoices, quotes, receipts)&lt;/li&gt;
&lt;li&gt;Full control over spacing, fonts, margins, page breaks&lt;/li&gt;
&lt;li&gt;A PDF that does NOT look like your website, instead a professionally formatted document&lt;/li&gt;
&lt;li&gt;Server-side or client-side generation with React/Next.js&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Pros:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Custom layouts&lt;/li&gt;
&lt;li&gt;Use your React knowledge (JSX components)&lt;/li&gt;
&lt;li&gt;Good for complex multi-page PDFs&lt;/li&gt;
&lt;li&gt;Supports images, tables, styling&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Slow for heavy PDFs&lt;/li&gt;
&lt;li&gt;Not ideal for turning an existing webpage into a PDF&lt;/li&gt;
&lt;li&gt;Styling is limited compared to CSS&lt;/li&gt;
&lt;li&gt;Leaning curve (if no previous experience of React)
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Page&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Document&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;StyleSheet&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@react-pdf/renderer&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;styles&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;StyleSheet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;page&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;fontSize&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;marginBottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MyPDF&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Document&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Page&lt;/span&gt; &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;styles&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Text&lt;/span&gt; &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;styles&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;INRI&lt;/span&gt; &lt;span class="nx"&gt;Paint&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;Wall&lt;/span&gt; &lt;span class="nx"&gt;LLC&lt;/span&gt; &lt;span class="nx"&gt;Estimate&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Text&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Text&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Total&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;$6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;800&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Text&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Text&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Includes&lt;/span&gt; &lt;span class="nx"&gt;wood&lt;/span&gt; &lt;span class="nx"&gt;replacement&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;caulking&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;and&lt;/span&gt; &lt;span class="nx"&gt;painting&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Text&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Page&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Document&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;pdf-lib&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;A low-level PDF manipulation library. It's extremely powerful, you can modify existing PDFs, merge, split, add pages, add images, write text anywhere. Think of it like "photoshop but PDFs in JavaScript".&lt;/p&gt;

&lt;p&gt;You can take a PDF contract, then fill in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Client name&lt;/li&gt;
&lt;li&gt;Address&lt;/li&gt;
&lt;li&gt;Price&lt;/li&gt;
&lt;li&gt;Dates&lt;/li&gt;
&lt;li&gt;Signature image&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Pros:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Modify existing PDFs&lt;/li&gt;
&lt;li&gt;Compact and fast&lt;/li&gt;
&lt;li&gt;Very flexible&lt;/li&gt;
&lt;li&gt;Supports images, font embedding&lt;/li&gt;
&lt;li&gt;No React required&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Not meant for designing full layouts from scratch&lt;/li&gt;
&lt;li&gt;Harder to position elements (you must use coordinates)&lt;/li&gt;
&lt;li&gt;Does Not covert webpages to PDFs
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;PDFDocument&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pdf-lib&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;existingPdf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/contract.pdf&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;arrayBuffer&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pdfDoc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;PDFDocument&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;existingPdf&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;pdfDoc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getPages&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;firstPage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;pages&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="nx"&gt;firstPage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;drawText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Client: Steve&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;y&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;700&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="nx"&gt;firstPage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;drawText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Price: $6,800&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;y&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;680&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pdfBytes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;pdfDoc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;save&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="c1"&gt;// download or return via API&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;jsPDF&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;A very popular, older library for generating PDFs in the browser. Works with HTML or manual drawing commands. Think of it like "Quick PDF generator, simple and lightweight".&lt;br&gt;
You can take sections of your webpage and convert it. You can also manually write text, draw lines, and add images.&lt;/p&gt;

&lt;p&gt;Pros:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Easy to use&lt;/li&gt;
&lt;li&gt;Supports HTML-to-PDF&lt;/li&gt;
&lt;li&gt;Good for simple PDFs&lt;/li&gt;
&lt;li&gt;Fast on small documents&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Not good for complex layouts&lt;/li&gt;
&lt;li&gt;HTML rendering is inconsistent&lt;/li&gt;
&lt;li&gt;Not great for long PDFs&lt;/li&gt;
&lt;li&gt;Struggles with modern CSS
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;jsPDF&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;jspdf&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pdf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;jsPDF&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nx"&gt;pdf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;INRI Paint &amp;amp; Wall LLC&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;pdf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Exterior Paint Quote: $6,800&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;pdf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;save&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;quote.pdf&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Headless Browser Rendering (Puppeteer/Playwright)
&lt;/h2&gt;

&lt;p&gt;These tools use a headless Chrome instance to generate PDFs. This produces pixel-perfect output, identical to what you see in the browser. Perfect when you need your PDF to look like the webpage (consistent styles, fonts, and layout), and when generating long or multi-page documents.&lt;/p&gt;

&lt;p&gt;Pros:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pixel perfect&lt;/li&gt;
&lt;li&gt;Handel long pages correctly&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Requires a backend&lt;/li&gt;
&lt;li&gt;Not ideal for purely client-side apps
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;browser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;puppeteer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;launch&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;browser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;newPage&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;goto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://yourcompany.com&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;waitUntil&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;networkidle0&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pdf&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;page.pdf&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;format&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;A4&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;printBackground&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;browser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;close&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Client side vs Server side print:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Client side: Generating big PDFs on the renderer thread can freeze the UI, making your app feel janky, especially with long documents or many images. &lt;/li&gt;
&lt;li&gt;Server side: Requires a backend server and not ideal for purely client-side apps.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Recommendations:
&lt;/h2&gt;

&lt;p&gt;Which Library Should You Use?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;“I want the PDF to look exactly like my webpage”&lt;br&gt;
Use: &lt;strong&gt;Puppeteer&lt;/strong&gt; or &lt;strong&gt;Playwright&lt;/strong&gt; (Only reliable option)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;“I need a professional layout (invoice, contract, estimate)”&lt;br&gt;
Use: &lt;strong&gt;react-pdf&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;“I already have a PDF template (like a contract) and I just need to fill fields”&lt;br&gt;
Use: &lt;strong&gt;pdf-lib&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;“I want a quick HTML → PDF in the browser”&lt;br&gt;
Use: &lt;strong&gt;jsPDF&lt;/strong&gt; (but be ready for CSS issues)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;“I need millions of PDFs server-side”&lt;br&gt;
Use: &lt;strong&gt;Puppeteer&lt;/strong&gt; + caching or streaming&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;“I need dynamic client-side generation without a backend”&lt;br&gt;
Use: &lt;strong&gt;react-pdf&lt;/strong&gt; or &lt;strong&gt;jsPDF&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>learning</category>
      <category>react</category>
    </item>
    <item>
      <title>Before You Can Make $500k+, You Must First Challenge the Beliefs Holding You Back</title>
      <dc:creator>Samuel Ruiz</dc:creator>
      <pubDate>Fri, 14 Nov 2025 16:26:17 +0000</pubDate>
      <link>https://dev.to/samuel_ruiz_64604c4d0ba22/before-you-can-make-150k-you-must-first-challenge-the-beliefs-holding-you-back-52k9</link>
      <guid>https://dev.to/samuel_ruiz_64604c4d0ba22/before-you-can-make-150k-you-must-first-challenge-the-beliefs-holding-you-back-52k9</guid>
      <description>&lt;p&gt;Your path to a six-figure salary depends on three things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Mastering the right tools&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Entering a well-paying industry&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cultivating the belief that you deserve success&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&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%2Fue8ktpswla1wgjolucow.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%2Fue8ktpswla1wgjolucow.png" alt="rich developer vs poor developer" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Here’s the guide that helped me break my limiting beliefs and secure a great salary.&lt;/p&gt;

&lt;p&gt;First, I had to confront my biggest weaknesses:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Caring too much about being “nice”&lt;/li&gt;
&lt;li&gt;Comparing myself to everyone else’s highlight reel&lt;/li&gt;
&lt;li&gt;Forgetting that &lt;em&gt;nobody&lt;/em&gt; fully knows what they’re doing all the time&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Not senior devs.&lt;br&gt;
Not staff engineers.&lt;br&gt;
Not FAANG engineers.&lt;br&gt;
&lt;strong&gt;Nobody.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The difference?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Seniors operate despite uncertainty. Juniors freeze because of it.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let’s change that.&lt;/p&gt;




&lt;h1&gt;
  
  
  🔥 Step 1 — You’re Not Lacking Skill. You’re Lacking Evidence.
&lt;/h1&gt;

&lt;p&gt;Your brain doesn’t trust you yet.&lt;/p&gt;

&lt;p&gt;When you say &lt;em&gt;“I don’t feel good enough,”&lt;/em&gt; it’s because your brain has no proof that you finish things consistently.&lt;/p&gt;

&lt;p&gt;So let’s give it evidence.&lt;/p&gt;

&lt;h3&gt;
  
  
  ✔️ Do this daily:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Solve &lt;strong&gt;one bug&lt;/strong&gt; — any size&lt;/li&gt;
&lt;li&gt;Finish &lt;strong&gt;one small task&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Write &lt;strong&gt;one technical explanation&lt;/strong&gt; (even rough notes)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Three small wins a day build unstoppable confidence in 30 days.&lt;/p&gt;




&lt;h1&gt;
  
  
  🔥 Step 2 — Stop Comparing Yourself
&lt;/h1&gt;

&lt;p&gt;If your code feels messy sometimes, congratulations — that means you’re a real developer, not a robot.&lt;/p&gt;

&lt;p&gt;Comparison is the fastest way to trigger imposter syndrome.&lt;/p&gt;

&lt;p&gt;You’re not supposed to be a clone of someone else.&lt;br&gt;
God made you unique — with your own strengths, instincts, and perspective.&lt;/p&gt;

&lt;p&gt;Your coworker might be amazing at CSS but terrible at database architecture.&lt;br&gt;
You might be great at something they struggle with.&lt;/p&gt;

&lt;p&gt;Everyone has strengths.&lt;br&gt;
Everyone has blind spots.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;“Why do you look at the speck of sawdust in your brother’s eye…?” — Matthew 7:1–5&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Focus on what &lt;em&gt;you&lt;/em&gt; bring.&lt;br&gt;
Learn from others.&lt;br&gt;
But don’t shrink yourself.&lt;/p&gt;

&lt;p&gt;Yes, some people can blaze through Vim commands or memorize terminal flags.&lt;br&gt;
You also have abilities they don't.&lt;/p&gt;




&lt;h1&gt;
  
  
  🔥 Step 3 — Learn the Senior Mindset (This Is the Real Cure)
&lt;/h1&gt;

&lt;p&gt;Here’s what seniors understand that juniors don’t:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. &lt;strong&gt;Being wrong is normal.&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;They expect it — and recover fast.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. &lt;strong&gt;Progress &amp;gt; perfection.&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Shipping matters more than polishing forever.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. &lt;strong&gt;They break down problems.&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Small chunks = clarity.&lt;br&gt;
Overwhelm = insecurity.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. &lt;strong&gt;They learn patterns, not syntax.&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Frameworks change.&lt;br&gt;
Patterns last.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. &lt;strong&gt;They push through confusion.&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Feeling lost means you’re learning something new.&lt;/p&gt;




&lt;h1&gt;
  
  
  🔥 Step 4 — Build “Deep Confidence” With Repetition
&lt;/h1&gt;

&lt;p&gt;Confidence doesn’t come from motivation.&lt;br&gt;
It comes from &lt;strong&gt;proof&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;You need reps.&lt;/p&gt;

&lt;h3&gt;
  
  
  Try this for 7 days:
&lt;/h3&gt;

&lt;p&gt;Pick one problem that scares you a little:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A feature you’ve avoided&lt;/li&gt;
&lt;li&gt;A weird bug&lt;/li&gt;
&lt;li&gt;A confusing part of the codebase&lt;/li&gt;
&lt;li&gt;A small tool you’ve wanted to build&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Finish it — even if the solution feels ugly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ugly solutions build confidence.&lt;/strong&gt;&lt;br&gt;
Polished tutorials don’t.&lt;/p&gt;




&lt;h1&gt;
  
  
  🔥 Step 5 — The Fastest Way to Feel Senior
&lt;/h1&gt;

&lt;p&gt;Do this every day:&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Explain what you learn out loud.&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;To:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;yourself&lt;/li&gt;
&lt;li&gt;ChatGPT&lt;/li&gt;
&lt;li&gt;your notes&lt;/li&gt;
&lt;li&gt;a rubber duck&lt;/li&gt;
&lt;li&gt;a friend&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Teaching forces clarity.&lt;br&gt;
Clarity kills insecurity.&lt;/p&gt;




&lt;h1&gt;
  
  
  🔥 Step 6 — You Need a Leveling-Up Plan
&lt;/h1&gt;

&lt;h2&gt;
  
  
  1) Master the Fundamentals
&lt;/h2&gt;

&lt;p&gt;Not frameworks. Not hype.&lt;/p&gt;

&lt;p&gt;Learn:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data structures&lt;/li&gt;
&lt;li&gt;Algorithms basics&lt;/li&gt;
&lt;li&gt;Async programming&lt;/li&gt;
&lt;li&gt;Networking&lt;/li&gt;
&lt;li&gt;HTTP + APIs&lt;/li&gt;
&lt;li&gt;Databases&lt;/li&gt;
&lt;li&gt;Architecture patterns&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When your fundamentals are solid, you can learn any tool in days.&lt;/p&gt;




&lt;h2&gt;
  
  
  2) Build Real-World Projects
&lt;/h2&gt;

&lt;p&gt;A senior has dealt with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;authentication&lt;/li&gt;
&lt;li&gt;payments&lt;/li&gt;
&lt;li&gt;file uploads&lt;/li&gt;
&lt;li&gt;caching&lt;/li&gt;
&lt;li&gt;migrations&lt;/li&gt;
&lt;li&gt;error handling&lt;/li&gt;
&lt;li&gt;performance&lt;/li&gt;
&lt;li&gt;deployment&lt;/li&gt;
&lt;li&gt;security basics&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you’ve only built a to-do app, you’re not ready.&lt;br&gt;
Build things that &lt;em&gt;force&lt;/em&gt; these skills.&lt;/p&gt;




&lt;h2&gt;
  
  
  3) Learn to Debug Like a Surgeon
&lt;/h2&gt;

&lt;p&gt;This is the #1 senior skill.&lt;/p&gt;

&lt;p&gt;Learn to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;isolate problems&lt;/li&gt;
&lt;li&gt;reproduce bugs&lt;/li&gt;
&lt;li&gt;simplify scope&lt;/li&gt;
&lt;li&gt;trace data flow&lt;/li&gt;
&lt;li&gt;read logs&lt;/li&gt;
&lt;li&gt;follow stack traces&lt;/li&gt;
&lt;li&gt;stop guessing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Seniors aren’t faster coders.&lt;br&gt;
They’re faster &lt;em&gt;debuggers&lt;/em&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  4) Get Good at Reading Code
&lt;/h2&gt;

&lt;p&gt;Most juniors only know how to write code.&lt;br&gt;
Seniors can read messy codebases and understand them.&lt;/p&gt;

&lt;p&gt;Practice by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;reading open source repos&lt;/li&gt;
&lt;li&gt;reading production code&lt;/li&gt;
&lt;li&gt;reading more than you write&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🧠 Step 7 — Communicate Like a Professional (The Most Important Skill)
&lt;/h1&gt;

&lt;p&gt;A true senior can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Explain &lt;em&gt;why&lt;/em&gt; a decision was made&lt;/li&gt;
&lt;li&gt;Simplify complex ideas for anyone&lt;/li&gt;
&lt;li&gt;Write clear summaries&lt;/li&gt;
&lt;li&gt;Document reasoning, not just steps&lt;/li&gt;
&lt;li&gt;Ask questions early&lt;/li&gt;
&lt;li&gt;Push back respectfully when needed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here’s the truth most developers don’t like hearing:&lt;/p&gt;

&lt;h3&gt;
  
  
  **Communication is more than half the job.
&lt;/h3&gt;

&lt;p&gt;Realistically, it’s 80% communication, 20% code.**&lt;/p&gt;

&lt;p&gt;Top earners aren’t the smartest developers —&lt;br&gt;
they’re the ones with &lt;strong&gt;exceptional emotional intelligence&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;They understand people.&lt;br&gt;
They navigate conflict.&lt;br&gt;
They make others better.&lt;/p&gt;

&lt;p&gt;Most CTOs and CEOs don’t touch code anymore —&lt;br&gt;
not because they can’t, but because their real value is in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;leadership&lt;/li&gt;
&lt;li&gt;clarity&lt;/li&gt;
&lt;li&gt;vision&lt;/li&gt;
&lt;li&gt;decision-making&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want to stay a pure coder forever, that’s totally fine.&lt;br&gt;
Just know your income ceiling will stay lower.&lt;/p&gt;

&lt;p&gt;Communication is what creates opportunity.&lt;br&gt;
Talking to the right people at the right time can 10x your career.&lt;/p&gt;




&lt;h1&gt;
  
  
  🧩 Stop Comparing, Start Growing
&lt;/h1&gt;

&lt;p&gt;Learn from others.&lt;br&gt;
Help others.&lt;br&gt;
Support your coworkers.&lt;br&gt;
But don’t measure your worth by someone else’s strengths.&lt;/p&gt;

&lt;p&gt;Zig Ziglar said it best:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;“You can have everything in life you want if you will just help enough other people get what they want.”&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Master that mindset and you’ll outrun anyone relying only on raw coding skill.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>You Start Everything, Finish Nothing.

Are you the kind of developer who starts ten side projects, only to abandon them when things get tough and jump to the next idea?</title>
      <dc:creator>Samuel Ruiz</dc:creator>
      <pubDate>Wed, 12 Nov 2025 17:52:00 +0000</pubDate>
      <link>https://dev.to/samuel_ruiz_64604c4d0ba22/you-start-everything-finish-nothing-are-you-the-kind-of-developer-who-starts-ten-side-2pam</link>
      <guid>https://dev.to/samuel_ruiz_64604c4d0ba22/you-start-everything-finish-nothing-are-you-the-kind-of-developer-who-starts-ten-side-2pam</guid>
      <description></description>
    </item>
    <item>
      <title>The Developer-Entrepreneur Curse: You Start Everything, Finish Nothing.

Are you the kind of developer who starts ten side projects, only to abandon them when things get tough and jump to the next idea?</title>
      <dc:creator>Samuel Ruiz</dc:creator>
      <pubDate>Wed, 12 Nov 2025 17:50:56 +0000</pubDate>
      <link>https://dev.to/samuel_ruiz_64604c4d0ba22/the-developer-entrepreneur-curse-you-start-everything-finish-nothing-are-you-the-kind-of-4mc8</link>
      <guid>https://dev.to/samuel_ruiz_64604c4d0ba22/the-developer-entrepreneur-curse-you-start-everything-finish-nothing-are-you-the-kind-of-4mc8</guid>
      <description></description>
    </item>
  </channel>
</rss>
