FIX: CRLF & Switch to Dynamic Data Loading for Product Files (ref PR: #14 #15 #16)#21
Closed
lutfi-zain wants to merge 3 commits intobuildermethods:mainfrom
Closed
FIX: CRLF & Switch to Dynamic Data Loading for Product Files (ref PR: #14 #15 #16)#21lutfi-zain wants to merge 3 commits intobuildermethods:mainfrom
lutfi-zain wants to merge 3 commits intobuildermethods:mainfrom
Conversation
- Replace build-time import.meta.glob with runtime fetch() for markdown/JSON files - Add useProductData hook for consistent async loading across components - Normalize Windows line endings (CRLF) in markdown parsers - Enable hot-reloading of product files without dev server restart
|
Still not perfect, sections dont load only the first one manages to load everything except /design-screen, and the other ones dont at all |
|
@lutfi-zain were you still planning to get this merged or not? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
import.meta.globwith runtimefetch()for product data filesRelated PRs
This PR consolidates and extends the CRLF fixes from:
All three PRs address the same Windows line ending issue but only in
product-loader.ts. This PR applies the fix across all loaders and adds hot-reload support.Problem
Product markdown files (roadmap, overview, data model, etc.) were loaded at build time using Vite's
import.meta.glob. This caused two issues:product/directory required restarting the dev server to see updates\r\n) failed to parse correctly, causing "No Roadmap Defined Yet" even when the file existedSolution
fetch()with cache-busting in dev modeuseProductDatahook for consistent async loading patternChanges
src/lib/product-loader.tsfetchProductData()src/lib/data-model-loader.tssrc/lib/design-system-loader.tssrc/lib/shell-loader.tssrc/lib/use-product-data.tssrc/components/*Page.tsxuseProductDatahook with loading statessrc/components/PhaseNav.tsxsrc/components/PhaseWarningBanner.tsxTesting
product/*.mdfilesBreaking Changes
None. The async loading is handled internally with loading states.