-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat/blog-post-scripts #823
Conversation
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.
Looks good! Tried it out with my own blog post and it seems to work as expected. Even the dato field grows when I add more code!
I do wonder if the nesting of the css and noscript
can be improved, even though it does not seem to be influencing document flow
d6de013
to
1b62fe0
Compare
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.
Looks good, two small comments!
<template> | ||
<div class="custom-script"> | ||
<!-- we show a <noscript> element if the user has javascript disabled, this is necessary because some functionality might be broken due to javascript being disabled and its important that users are notified why it isn't working --> | ||
<!-- this needs to be v-html instead of your typical {{ someValue }} interpolation because of a bug that content in noscript does not seem to be evaluated by Vue --> |
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.
Not sure this is a bug, feels like intended behaviour? Maybe we can just mention it's not being evaluated?
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.
You're right, not a bug!
if (props.unmountScript) { | ||
const unmountScript = runScriptInBrowser(props.unmountScript, onUnmountScriptId); | ||
|
||
// how to ensure the unmountScript has a chance to be executed in the browser? |
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.
Since runScriptInBrowser is sync this shouldn't be an issue right?
Could add nextTick before removal to give it some extra time.
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.
That was our assumption as well, will remove
35c8ccf
to
bedfc58
Compare
What changes were made
Ticket
https://trello.com/c/SJizgBYO/753-as-a-writer-i-want-to-add-javascript-to-my-blog-post-so-i-can-have-interactive-examples
How to test or check results
Checks