Skip to content

Feat/upgrade to jsx#9

Open
john20xdoe wants to merge 24 commits intomasterfrom
feat/upgrade-to-jsx
Open

Feat/upgrade to jsx#9
john20xdoe wants to merge 24 commits intomasterfrom
feat/upgrade-to-jsx

Conversation

@john20xdoe
Copy link
Owner

No description provided.

john20xdoe and others added 14 commits March 10, 2026 12:35
Co-authored-by: john20xdoe <14521605+john20xdoe@users.noreply.github.com>
Fix npm scripts by aligning project structure with Vite conventions
Co-authored-by: john20xdoe <14521605+john20xdoe@users.noreply.github.com>
Co-authored-by: john20xdoe <14521605+john20xdoe@users.noreply.github.com>
Co-authored-by: john20xdoe <14521605+john20xdoe@users.noreply.github.com>
Co-authored-by: john20xdoe <14521605+john20xdoe@users.noreply.github.com>
Update copyright to 2026 and serve JSON from deployed domain only
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates the site to a React + Vite setup (JSX entrypoint) and updates deployment/build configuration to publish the Vite dist/ output to GitHub Pages.

Changes:

  • Introduces a Vite + React app entry (src/main.jsx) and reimplements the page in src/App.jsx with runtime JSON fetching.
  • Adds build-time copying of root data/*.json into dist/data/ via a Vite plugin.
  • Adds a GitHub Pages deployment workflow and updates project metadata/ignores.

Reviewed changes

Copilot reviewed 9 out of 12 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
vite.config.js Adds Vite config + plugin to copy data/ JSON into dist/data/.
src/main.jsx Adds React root bootstrap.
src/App.jsx Implements the full page UI in React + fetches data/*.json.
index.html Converts static HTML page into Vite root + module entry script.
package.json Switches to Vite/React dependencies and build/dev scripts.
package-lock.json Locks dependency tree for Vite/React toolchain.
deploy.yml Adds GitHub Pages deployment workflow (currently misplaced).
robots.txt Adds crawler rules + sitemap reference (currently not deployed by Vite as-is).
data/skills.json Adds runtime skills data used by the app.
data/links.json Adds runtime links data used by the app.
.gitignore Adds dist and .DS_Store ignores.
.DS_Store (Should not be committed) macOS metadata file added.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +13 to +15
const dataDir = resolve(__dirname, "data");
const distData = resolve(__dirname, "dist/data");

Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

vite.config.js is treated as an ES module (package.json sets "type": "module"), so __dirname is not defined and the build will crash when the copy plugin runs. Use an ESM-safe path resolution approach (e.g., derive a directory from import.meta.url / fileURLToPath, or use process.cwd() if appropriate) before calling resolve().

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +6
name: Deploy to GitHub Pages

on:
push:
branches: [main]

Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

This GitHub Actions workflow file won’t run from the repository root. GitHub only loads workflows from .github/workflows/*.yml. Move this file into .github/workflows/ (or adjust the PR to add it there) so the Pages deployment actually triggers on pushes to main.

Copilot uses AI. Check for mistakes.
Comment on lines +4 to +6
User-agent: Googlebot
Allow: /

Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

robots.txt is added at the repo root, but Vite only copies static files from public/ into dist/ by default. Since the Pages artifact is dist, this robots.txt likely won’t be deployed. Move it under public/robots.txt (or configure publicDir / add a copy step) so it ends up in the deployed site root.

Copilot uses AI. Check for mistakes.
Comment on lines +135 to +141
return (
<>
<style>{`
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@200,400,600,700,800&family=Open+Sans:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap');

*, *::before, *::after { box-sizing: border-box; }

Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

The large CSS string is embedded inside the App component’s render output. Because App re-renders on state changes (e.g., accordion open/close), this will re-render/re-apply the <style> contents repeatedly and can cause unnecessary style recalculation. Consider moving these styles to a static CSS file (preferred with Vite) or at least hoisting the string outside the component so it isn’t recreated on every render.

Copilot uses AI. Check for mistakes.
Copy link
Owner Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 11 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +26 to +33
useEffect(() => {
const controller = new AbortController();

setLoading(true);
fetch(url, { signal: controller.signal })
.then((r) => {
if (!r.ok) throw new Error(`HTTP ${r.status}`);
return r.json();
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

useFetch never resets error when a new request starts. If a previous request errors and a subsequent one succeeds (or url changes), the stale error value will remain set. Consider clearing error (and optionally data) when starting a new fetch (before calling fetch).

Copilot uses AI. Check for mistakes.
Comment on lines +54 to +57
// Safely renders label strings that contain inline <b> tags
function InlineHTML({ html }) {
return <span dangerouslySetInnerHTML={{ __html: html }} />;
}
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

InlineHTML uses dangerouslySetInnerHTML with content coming from JSON. Even if it's currently intended to only include <b>, this is still an XSS footgun if the JSON ever becomes user-controlled (or is modified unintentionally). Prefer representing emphasis as structured data (no HTML), or sanitize/whitelist allowed tags/attributes before rendering. Also, the comment says "Safely" but there is no sanitization here.

Copilot uses AI. Check for mistakes.
Comment on lines +135 to +145
return (
<>
<style>{`
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@200,400,600,700,800&family=Open+Sans:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap');

*, *::before, *::after { box-sizing: border-box; }

body {
margin: 0;
width: 100%;
font-family: "Inter", "Open Sans", sans-serif;
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

Large CSS is inlined inside the component render via a template literal. This string is recreated on every re-render (e.g., when toggling accordions), and it makes styling harder to maintain. Consider moving these styles to a dedicated CSS file (and importing it), or at least hoisting the CSS string outside the component so it isn't reallocated each render.

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI commented Mar 10, 2026

@john20xdoe I've opened a new pull request, #10, to work on those changes. Once the pull request is ready, I'll request review from you.

john20xdoe and others added 2 commits March 10, 2026 14:52
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

3 participants