[PR #2972] [MERGED] fix: shortcode data do not fetch or render #4169

Closed
opened 2026-03-17 01:43:44 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/2972
Author: @anwarulislam
Created: 4/6/2023
Status: Merged
Merged: 4/6/2023
Merged by: @AndrewBastin

Base: stagingHead: fix/shortcode-rendering


📝 Commits (1)

  • 09ec0c2 fix: shortcode data do not fetch or render

📊 Changes

2 files changed (+45 additions, -59 deletions)

View changed files

📝 packages/hoppscotch-common/src/components.d.ts (+1 -0)
📝 packages/hoppscotch-common/src/pages/r/_id.vue (+44 -59)

📄 Description

🤖 Generated by Copilot at a37b072

Summary

🎨🧰🚀

Refactored a component to use the latest Vue features and improved code reuse. Simplified the logic for adding requests to tabs with a common function. Updated r/_id.vue to use the new function.

Resolved the issue of shortcode not being fetched and rendered in a tab

<script setup> used
Refactored component code
Snowflakes of logic

Walkthrough

  • Simplify component options using <script setup> syntax (link)
  • Refactor component logic to use reactive refs and onMounted function (link)
  • Extract addRequestToTab function to avoid code duplication and improve readability (link)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/2972 **Author:** [@anwarulislam](https://github.com/anwarulislam) **Created:** 4/6/2023 **Status:** ✅ Merged **Merged:** 4/6/2023 **Merged by:** [@AndrewBastin](https://github.com/AndrewBastin) **Base:** `staging` ← **Head:** `fix/shortcode-rendering` --- ### 📝 Commits (1) - [`09ec0c2`](https://github.com/hoppscotch/hoppscotch/commit/09ec0c224903172017494ea95995b66f97b3d446) fix: shortcode data do not fetch or render ### 📊 Changes **2 files changed** (+45 additions, -59 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-common/src/components.d.ts` (+1 -0) 📝 `packages/hoppscotch-common/src/pages/r/_id.vue` (+44 -59) </details> ### 📄 Description <!-- copilot:all --> ### <samp>🤖 Generated by Copilot at a37b072</samp> ### Summary 🎨🧰🚀 <!-- 1. 🎨 - This emoji is often used to indicate code refactoring, improving the structure or design of existing code without changing its functionality. In this case, the component code was refactored to use a different syntax and API, but the behavior and appearance of the page should remain the same. 2. 🧰 - This emoji is often used to indicate adding or updating tools, utilities, or dependencies that help with development or testing. In this case, the common function for adding requests to tabs could be seen as a utility that simplifies the logic and reduces repetition in the component code. 3. 🚀 - This emoji is often used to indicate performance improvements, optimizations, or enhancements that make the code run faster or more efficiently. In this case, the `<script setup>` syntax and the composition API could potentially improve the performance of the component by reducing the overhead of creating and registering options-based components, and by enabling better tree-shaking and code-splitting. --> Refactored a component to use the latest Vue features and improved code reuse. Simplified the logic for adding requests to tabs with a common function. Updated `r/_id.vue` to use the new function. Resolved the issue of shortcode not being fetched and rendered in a tab > _`<script setup>` used_ > _Refactored component code_ > _Snowflakes of logic_ ### Walkthrough * Simplify component options using `<script setup>` syntax ([link](https://github.com/hoppscotch/hoppscotch/pull/2972/files?diff=unified&w=0#diff-663554b835991ed51ac33363634cf12dca4c894a3484342260a11f5a8c27fc93L62-R63)) * Refactor component logic to use reactive refs and `onMounted` function ([link](https://github.com/hoppscotch/hoppscotch/pull/2972/files?diff=unified&w=0#diff-663554b835991ed51ac33363634cf12dca4c894a3484342260a11f5a8c27fc93L80-R130)) * Extract `addRequestToTab` function to avoid code duplication and improve readability ([link](https://github.com/hoppscotch/hoppscotch/pull/2972/files?diff=unified&w=0#diff-663554b835991ed51ac33363634cf12dca4c894a3484342260a11f5a8c27fc93L80-R130)) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 01:43:44 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#4169
No description provided.