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.
Support inline JavaScript events (v2) #1290
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
base: develop
Are you sure you want to change the base?
Support inline JavaScript events (v2) #1290
Changes from 22 commits
13f588a
edf0498
8ae45ce
c11c2c4
db770ac
67cd1e7
36e33e4
61fc1d3
258c4de
5ce5c32
0b14bc8
23a7297
a109a3b
3a159af
693b112
c3ddb45
4920d95
5d7dbdd
435fcbc
d809007
5790e11
7c7f851
59bb9f5
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Revert this function and create a separate transform function within
RequiredTransforms
that performs theInlineJavascript
transforms.The cadence set within
RequiredTransforms
is that it never needs any external calls, it just "does everything" automatically during initialization.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.
I'm not sure what to do here. I know about the RequiredTransforms cadence due to the comment in its
__init__
function, but to handle the "onclick" vs "onClick", "attributes" vs "inlineJavaScript", and^on\w+
vs^on[A-Z]\w+
dilemma (which we decided to stick with camelCase regex), I have to convert the inline html attributes to camelCase prior to instantiating the Vdom object, which is also prior to calling the RequiredTransforms - since these transforms all operate on Vdom object. Note the call order below:I injected the camelCase transform to occur on the parsed HTML etree object (again, prior to it being used to instantiate the Vdom object and applying the standard RequiredTransforms. And if conversion to camelCase happens prior to Vdom instantiation, then there's no need to execute it again after. That is why I deleted the old function and just created a new "private" one, where it's only private so that it won't be invoked within the official cadence.
Does this makes sense? So again, I'm a bit confused. Do you want me to just restore the old function in addition to keeping the new one while maintaining the call order I've implemented? In which case it will perform a camelCase conversion twice - once before Vdom and once after.
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.
@Archmonger Just waiting on some clarification above.
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.
Will respond on Friday. Been living and breathing my day job for the last few days.