Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solve CORS issues for Visual Studio feeds #37

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

FokkoVeegens
Copy link

This pull request includes several changes to improve the development environment and enhance the functionality of the Index page. The most important changes are detailed below:

Development Environment Improvements:

  • .vscode/launch.json: Changed the default port for the Vite development server from 3000 to 5173 and added a serverReadyAction to debug with Edge when the server is ready.
  • vite.config.mjs: Enabled source maps in the build configuration to facilitate debugging.

Functionality Enhancements:

  • src/pages/Index.jsx: Added a proxy URL to handle CORS issues when fetching RSS items and sorted the RSS items by publication date before rendering them. [1] [2] [3]

Fixes #20

@FokkoVeegens FokkoVeegens requested a review from rajbos as a code owner January 3, 2025 16:22
Copy link
Collaborator

@rajbos rajbos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the showing of the filter buttons so the CORS feeds are visible as well (remove the filter call here: https://github.com/xebia/github-copilot-updates/blob/main/src/pages/Index.jsx#L151)

@@ -10,8 +10,13 @@
"run",
"dev"
],
"port": 3000, // Default port for Vite development server
"port": 5173, // Default port for Vite development server
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this port change needed at all?

const fetchRSSItems = async () => {;

const fetchRSSItems = async () => {
const proxyUrl = 'https://corsproxy.io/?url=';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice find. I tested it and it works. What concerns me is that they have a free plan that works for localhost requests or open source projects, but no indication how that works. They cant make the request to a localhost, and since our script runs on the users client the IP address will be different each time, so in that sense it will work, feels a bit like we are misusing their service then.

Let's merge it in for now, and I do have a plan to change this up a bit differently so we can cache the feeds in the repo instead. Let's chat on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CORS issues on new feeds from Visual Studio
2 participants