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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warning generated when using esbuild #4213

Closed
2 tasks
shollander opened this issue Jan 22, 2024 · 0 comments · Fixed by #4216
Closed
2 tasks

warning generated when using esbuild #4213

shollander opened this issue Jan 22, 2024 · 0 comments · Fixed by #4216

Comments

@shollander
Copy link

Which @ngrx/* package(s) are the source of the bug?

store-devtools

Minimal reproduction of the bug/regression with instructions

When compiling with the new esbuild system in Angular 17 (https://angular.io/guide/esbuild), the following warning is generated:

Using direct eval with a bundler is not recommended and may cause problems [direct-eval]

    node_modules/@ngrx/store-devtools/fesm2022/ngrx-store-devtools.mjs:423:42:
        432 | ....return typeof action === 'string' ? eval(`(${action})`) : action;
            |                                                  ~~~~

    You can read more about direct eval and bundling here: https://esbuild.github.io/link/direct-eval

Expected behavior

No warnings should be generated.

Versions of NgRx, Angular, Node, affected browser(s) and operating system(s)

NgRx: 17.0.1
Angular: 17.0.8

Other information

No response

I would be willing to submit a PR to fix this issue

  • Yes
  • No
rainerhahnekamp added a commit to rainerhahnekamp/ngrx that referenced this issue Jan 26, 2024
`unwrapAction` internally runs `eval` if the argument
is of type `string`.

It is unclear why that `unwrapAction` was necessary
in the first place and it looks like an artifact
from a former version. The line was added
in 2018.

Since `eval` is not best practice and according to ngrx#4213,
esbuild has issues with it, it is removed.
rainerhahnekamp added a commit to rainerhahnekamp/ngrx that referenced this issue Jan 26, 2024
`unwrapAction` internally runs `eval` if the argument
is of type `string`.

It is unclear why that `unwrapAction` was necessary
in the first place, and it looks like an artifact
from a older codebase. The line was added
in 2018.

Since `eval` is not best practice and according to ngrx#4213,
esbuild has issues with it, it is removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant