-
-
Notifications
You must be signed in to change notification settings - Fork 31
fix: #238 hot reload error #240
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
Conversation
WalkthroughRevises page metadata reading and SFC parsing logic in packages/core/src/page.ts. Adds guarded error handling for read failures and JSON stringify, adjusts assignment order for meta/raw, removes catch-and-wrap around SFC parsing to let errors propagate, and safely ignores invalid custom block content during meta extraction. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Caller
participant Page
participant FS as File System
participant Parser as SFC Parser
participant Log as debug.error
Caller->>Page: read()
Page->>FS: readPageMetaFromFile()
alt read success
Page->>Page: JSON.stringify(meta)
alt stringify success
Page->>Page: raw computed
else stringify fails
Note over Page: raw = '' (unchanged/empty)
end
Page->>Page: set this.meta, this.raw
Page->>Page: this.changed = (oldRaw != raw)
else read fails
Page->>Log: log error
Page-->>Caller: return early
end
Note over Parser,Page: parseSFC() now lets errors propagate
Note over Page: tryPageMetaFromCustomBlock() swallows invalid content errors
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧬 Code graph analysis (1)packages/core/src/page.ts (2)
🔇 Additional comments (3)
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
这么多问题吗😀[扣脑袋] |
|
不过这次这个bug是之前的,parseSFC时,遇到无法解析的代码,就会出错。 |
|
厉害呀,辛苦啦 |
|
敬礼🫡 |
Description 描述
related #238
Summary by CodeRabbit
Bug Fixes
Refactor