-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
chore: markdown runtime errors/warnings #11304
Conversation
|
@@ -880,12 +875,16 @@ export function is_signal(val) { | |||
* @returns {T} | |||
*/ | |||
export function getContext(key) { | |||
const context_map = get_or_init_context_map(); | |||
if (current_component_context === null) { | |||
e.lifecycle_outside_component('getContext'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not move this logic into get_or_init_context_map
? i.e. you give that function the 'getContext'
string and it will then invoke the error correctly. Should minify a bit better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, fair. made that change
This is #11302 but for runtime warnings. Doesn't have a huge impact since we don't actually have many runtime warnings (yet?), but it makes them look a bit nicer:
In prod, it just logs the code. In future, it can log a link to the docs.
Before submitting the PR, please make sure you do the following
feat:
,fix:
,chore:
, ordocs:
.Tests and linting
pnpm test
and lint the project withpnpm lint