Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: code migration for useAsyncData #26862

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

niklas-wortmann
Copy link

馃敆 Linked issue

starting point for #25713 (I provided some information around my ideas in that ticket)

馃摎 Description

This PR allows for automatic code migration of the changes for useAsync data, described by @danielroe here

There are still a couple of todos, but I wanted to open the PR early to get the discussion going.

Todos:

  • Integrate schematic in build and test infrastructure
  • fix complex test scenario
  • define more test cases?
  • integrate code migration execution in Nuxi

Copy link

stackblitz bot commented Apr 19, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

New and removed dependencies detected. Learn more about Socket for GitHub 鈫楋笌

Package New capabilities Transitives Size Publisher
npm/chokidar@3.6.0 environment, filesystem +11 419 kB paulmillr
npm/cookie-es@1.1.0 None 0 33.5 kB pi0
npm/klona@2.0.6 None 0 23.2 kB lukeed
npm/nypm@0.3.8 None +1 86.6 kB pi0
npm/ohash@1.1.3 None 0 70.7 kB pi0
npm/rollup-plugin-visualizer@5.12.0 filesystem Transitive: environment +6 3.18 MB btd
npm/strip-literal@2.1.0 None +1 26.3 kB antfu
npm/uncrypto@0.1.3 None 0 7.87 kB pi0
npm/unstorage@1.10.2 Transitive: environment, filesystem, network +36 5.71 MB pi0

View full report鈫楋笌

Copy link

馃毃 Potential security issues detected. Learn more about Socket for GitHub 鈫楋笌

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteSource
Install scripts npm/esbuild@0.20.2

View full report鈫楋笌

Next steps

What is an install script?

Install scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.

Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/foo@1.0.0 or ignore all packages with @SocketSecurity ignore-all

  • @SocketSecurity ignore npm/esbuild@0.20.2

@@ -0,0 +1,23 @@
{
Copy link
Member

Choose a reason for hiding this comment

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

do we need a separate tsconfig.json for this package?

@@ -0,0 +1,25 @@
<script setup lang="ts">
const pending = 'something-else'
Copy link
Member

Choose a reason for hiding this comment

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

Might also be worth handling the situation of:

Suggested change
const pending = 'something-else'
const status = 'something-else'
const pending = 'something-else'

@niklas-wortmann
Copy link
Author

I got the tests now mostly written, but I run into an issue with TS Morph when not using semicolons at the end of an expression. The statement evaluation is kinda weird resulting in wrong code/not compiling code. I am working on that and also adjust the tsconfig thing

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.

None yet

3 participants