Skip to content

JS: Add support for vuex #6213

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

Merged
merged 11 commits into from
Aug 3, 2021
Merged

JS: Add support for vuex #6213

merged 11 commits into from
Aug 3, 2021

Conversation

asgerf
Copy link
Contributor

@asgerf asgerf commented Jul 2, 2021

Adds support for vuex, a Flux-type state management library for Vue.

It is similar to Redux but was simpler to model as more of the core functionality seems to delivered out of the box, so things are a bit more consistent and fewer third-party libraries needed to be supported.

The model is based on API graphs, and there were a few tweaks needed to make this work nicely:

  • API graphs can now backtrack def-nodes through spread operators.
  • API graphs understand property accesses where the property name comes from an imported constant.
  • String literals are now source nodes, so getAValueReachingRhs().getStringValue() can be used get string values reaching a def-node. (This landed separately in JS: Treat string literals as SourceNodes #6192)

The Vue model is not yet based on API graphs, so I only did a very loose integration, so as not to make the eventual migration harder.

Evaluations: (both containing a slightly older version of the string literals as source nodes PR causing some spurious alert diffs)

@asgerf asgerf added the JS label Jul 2, 2021
@asgerf asgerf requested a review from a team as a code owner July 2, 2021 11:03
Copy link
Contributor

@erik-krogh erik-krogh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vuex.qll is quite a mouthful.
(Everything outside of Vuex.qll looks fine).

I'm not done reviewing it, but here preliminary review.

@asgerf
Copy link
Contributor Author

asgerf commented Jul 16, 2021

Thanks for the initial review @erik-krogh, I know it's a heavy PR to work through. ✨

I've addressed the comments so far.

Copy link
Contributor

@erik-krogh erik-krogh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor comments, but nothing big.

Looks good 👍

asgerf and others added 3 commits August 3, 2021 08:45
@codeql-ci codeql-ci merged commit 394d334 into github:main Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants