helloadhavan/github_issues huggingface dataset:
Repository: denoland/deno
Pull request: perf(ext/node): lazily listen to the abort signal of request object

Continued from #29069

This PR improves the http server performance of `node:http` by lazily bind to abort signal of `Response` object.

main: 50.32k RPS
this PR: 85.83k PRS

server script used:
```js
import http from "node:http";
const server = http.createServer((req, res) => {
  res.end("hi");
});
server.listen(3000, () => console.log("listening"));
```

wrk command:
```
wrk -t12 -c400 -d10s http://localhost:3000
```

related #28601

Changed files:
filename: ext/node/polyfills/http.ts
patch: @@ -130,15 +130,18 @@ function validateHost(host, name) {
 
 const INVALID_PATH_REGEX = /[^\u0021-\u00ff]/;
 const kError = Symbol("kError");
+const kBindToAbortSignal = Symbol("kBindToAbortSignal");
 
 class FakeSocket extends EventEmitter {
+  /** Stores the underlying request for lazily binding to abort signal */
+  #request: Request | undefined;
   constructor(
     opts: {
       encrypted?: boolean | undefined;
       remotePort?: number | undefined;
       remoteAddress?: string | undefined;
       reader?: ReadableStreamDefaultReader | undefined;
-      signal?: AbortSignal | undefined;
+      request?: Request;
     } = {},
   ) {
     super();
@@ -148,8 +151,13 @@ class FakeSocket extends EventEmitter {
     this.reader = opts.reader;
     this.writable = true;
     this.readable = true;
-    opts.signal?.addEventListener("abort", () => {
-      this.emit("error", opts.signal?.reason ?? new Error("aborted"));
+    this.#request = opts.request;
+  }
+
+  [kBindToAbortSignal]() {
+    const signal = this.#request?.signal;
+    signal?.addEventListener("abort", () => {
+      this.emit("error", signal.reason);
       this.emit("close");
     }, { once: true });
   }
@@ -1499,9 +1507,14 @@ export const ServerResponse = function (
   this._readable = readable;
   this._resolve = resolve;
   this.socket = socket;
-  this.socket?.on("close", () => {
-    if (!this.finished) {
-      this.end();
+  this.on("newListener", (event) => {
+    if (event === "close") {
+      this.socket?.[kBindToAbortSignal]();
+      this.socket?.on("close", () => {
+        if (!this.finished) {
+          this.emit("close");
+        }
+      });
     }
   });
   this._header = "";
@@ -1936,7 +1949,7 @@ export class ServerImpl extends EventEmitter {
         remotePort: info.remoteAddr.port,
         encrypted: this._encrypted,
         reader: request.body?.getReader(),
-        signal: request.signal,
+        request,
       });
 
       const req = new IncomingMessageForServer(socket);
Repository: huggingface/transformers
Pull request: Remove do_reduce_labels Argument from model initialization in run_semantic_segmentation_no_trainer

# What does this PR do?

When running ```run_semantic_segmentation_no_trainer.py``` from ```example/pytorch/semantic-segmentation``` using the command provided in the Readme file:

```bash
accelerate launch run_semantic_segmentation_no_trainer.py --output_dir segformer-finetuned-sidewalk --with_tracking --push_to_hub
```

An error is returned:
```bash
TypeError: SegformerForSemanticSegmentation.__init__() got an unexpected keyword argument 'do_reduce_labels'
```
In the Python script, the model is instantiated with the class ```AutoModelForSemanticSegmentation```, which does not have listed ```do_reduce_labels``` as a parameter. This causes the test to fail.


Proposed Change:
This PR proposes removing line 333 from ```run_semantic_segmentation_no_trainer.py``` to resolve the issue.


## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [X] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
      Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?


## Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.


@amyeroberts, @qubvel hi, I believe you could review this PR, as it pertains to the computer vision model field.


Changed files:
filename: examples/pytorch/semantic-segmentation/run_semantic_segmentation_no_trainer.py
patch: @@ -324,13 +324,12 @@ def main():
         args.model_name_or_path, id2label=id2label, label2id=label2id, trust_remote_code=args.trust_remote_code
     )
     image_processor = AutoImageProcessor.from_pretrained(
-        args.model_name_or_path, trust_remote_code=args.trust_remote_code
+        args.model_name_or_path, trust_remote_code=args.trust_remote_code, do_reduce_labels=args.do_reduce_labels
     )
     model = AutoModelForSemanticSegmentation.from_pretrained(
         args.model_name_or_path,
         config=config,
         trust_remote_code=args.trust_remote_code,
-        do_reduce_labels=args.do_reduce_labels,
     )
 
     # Define transforms to be applied to each image and target.
Repository: ggml-org/llama.cpp
Pull request: convert : remove redundant code

Since `data = data_torch.numpy()` has been called at line 303, line 307 seems to be redundant.
Or am I missing something?
Thanks.


Changed files:
filename: convert_hf_to_gguf.py
patch: @@ -302,10 +302,6 @@ def prepare_tensors(self):
                 # data = data_torch.squeeze().numpy()
                 data = data_torch.numpy()
 
-                # if data ends up empty, it means data_torch was a scalar tensor -> restore
-                if len(data.shape) == 0:
-                    data = data_torch.numpy()
-
                 n_dims = len(data.shape)
                 data_qtype: gguf.GGMLQuantizationType | bool = self.tensor_force_quant(name, new_name, bid, n_dims)
Repository: huggingface/transformers
Pull request: Fix Lfm2 and common tests

# What does this PR do?

cc @ydshieh 

Changed files:
filename: tests/models/lfm2/test_modeling_lfm2.py
patch: @@ -85,6 +85,12 @@ def test_contrastive_generate_dict_outputs_use_cache(self):
     def test_contrastive_generate_low_memory(self):
         pass
 
+    @unittest.skip(
+        "Lfm2 has a special cache format which is not compatible with compile as it has static address for conv cache"
+    )
+    def test_sdpa_can_compile_dynamic(self):
+        pass
+
 
 @require_torch_accelerator
 @require_read_token

filename: tests/test_modeling_common.py
patch: @@ -4484,6 +4484,7 @@ def test_torch_compile_for_training(self):
             ),
             "position_ids": torch.arange(0, 10, device=torch_device).unsqueeze(0),
             "labels": torch.randint(low=1, high=model.config.vocab_size, size=(2, 10), device=torch_device),
+            "use_cache": False,
         }
 
         # eager backward
Repository: facebook/react
Pull request: Create warnings JS file for Meta

The `WARNINGS` file isn't picked up by the test dependency analyzer, this creates a JS version of the file that I think should work.

Changed files:
filename: .circleci/config.yml
patch: @@ -106,8 +106,9 @@ jobs:
       - setup_node_modules
       - run:
           command: |
-            mkdir -p ./build
+            mkdir -p ./build/__test_utils__
             node ./scripts/print-warnings/print-warnings.js > build/WARNINGS
+            node ./scripts/print-warnings/print-warnings.js --js > build/__test_utils__/ReactAllWarnings.js
       - persist_to_workspace:
           root: .
           paths:

filename: scripts/print-warnings/print-warnings.js
patch: @@ -75,11 +75,19 @@ gs([
   '!**/node_modules/**/*.js',
 ]).pipe(
   through.obj(transform, cb => {
-    process.stdout.write(
-      Array.from(warnings, warning => JSON.stringify(warning))
-        .sort()
-        .join('\n') + '\n'
-    );
+    if (process.argv[2] === '--js') {
+      const warningsArray = Array.from(warnings);
+      warningsArray.sort();
+      process.stdout.write(
+        `export default ${JSON.stringify(warningsArray, null, 2)};\n`
+      );
+    } else {
+      process.stdout.write(
+        Array.from(warnings, warning => JSON.stringify(warning))
+          .sort()
+          .join('\n') + '\n'
+      );
+    }
     cb();
   })
 );
Repository: electron/electron
Pull request: fix: asan build on macOS

Backport of #45541

See that PR for details.


Notes: fix crash on startup with asan build on macOS

Changed files:
filename: patches/node/.patches
patch: @@ -39,4 +39,5 @@ test_use_static_method_names_in_call_stacks.patch
 build_use_third_party_simdutf.patch
 fix_remove_fastapitypedarray_usage.patch
 test_handle_explicit_resource_management_globals.patch
+build_remove_explicit_linker_call_to_libm_on_macos.patch
 linux_try_preadv64_pwritev64_before_preadv_pwritev_4683.patch

filename: patches/node/build_remove_explicit_linker_call_to_libm_on_macos.patch
patch: @@ -0,0 +1,59 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: deepak1556 <hop2deep@gmail.com>
+Date: Mon, 3 Feb 2025 21:44:36 +0900
+Subject: build: remove explicit linker call to libm on macOS
+
+/usr/lib/libm.tbd is available via libSystem.*.dylib and
+reexports sanitizer symbols. When building for asan
+this becomes an issue as the linker will resolve the symbols
+from the system library rather from libclang_rt.*
+
+For V8 that rely on specific version of these symbols
+that get bundled as part of clang, for ex:
+https://source.chromium.org/chromium/chromium/src/+/main:v8/src/heap/cppgc/platform.cc;l=93-97
+accepting nullptr for shadow_offset in `asan_get_shadow_mapping`,
+linking to system version that doesn't support this will lead to
+a crash.
+
+Clang driver eventually links with `-lSystem`
+https://github.com/llvm/llvm-project/blob/e82f93890daefeb38fe2a22ee3db87a89948ec57/clang/lib/Driver/ToolChains/Darwin.cpp#L1628-L1631,
+this is done after linking the sanitizer libraries which
+ensures right order of resolution for the symbols.
+
+PR-URL: https://github.com/nodejs/node/pull/56901
+Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
+Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
+Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
+Reviewed-By: Shelley Vohr <shelley.vohr@gmail.com>
+
+diff --git a/deps/brotli/unofficial.gni b/deps/brotli/unofficial.gni
+index 5e07e106672a04508a77584c109c97a67926c858..91001fa43ea4807d061f296eaeccb7512e34863e 100644
+--- a/deps/brotli/unofficial.gni
++++ b/deps/brotli/unofficial.gni
+@@ -25,7 +25,7 @@ template("brotli_gn_build") {
+     } else if (target_os == "freebsd") {
+       defines = [ "OS_FREEBSD" ]
+     }
+-    if (!is_win) {
++    if (is_linux) {
+       libs = [ "m" ]
+     }
+     if (is_clang || !is_win) {
+diff --git a/deps/uv/unofficial.gni b/deps/uv/unofficial.gni
+index 7a73f891e3fc3261b77af97af63fca2eade49849..bda1b5dc899558c2b4a22377dde9fb3bcce5488c 100644
+--- a/deps/uv/unofficial.gni
++++ b/deps/uv/unofficial.gni
+@@ -82,11 +82,11 @@ template("uv_gn_build") {
+       ]
+     }
+     if (is_posix) {
+-      libs = [ "m" ]
+       ldflags = [ "-pthread" ]
+     }
+     if (is_linux) {
+-      libs += [
++      libs = [
++        "m",
+         "dl",
+         "rt",
+       ]
Repository: denoland/deno
Pull request: feat(info): include deno version

Closes #28713.

Changed files:
filename: cli/tools/info.rs
patch: @@ -19,6 +19,7 @@ use deno_graph::ModuleError;
 use deno_graph::ModuleGraph;
 use deno_graph::Resolution;
 use deno_lib::util::checksum;
+use deno_lib::version::DENO_VERSION_INFO;
 use deno_npm::npm_rc::ResolvedNpmRc;
 use deno_npm::resolution::NpmResolutionSnapshot;
 use deno_npm::NpmPackageId;
@@ -198,6 +199,7 @@ fn print_cache_info(
   json: bool,
   location: Option<&deno_core::url::Url>,
 ) -> Result<(), AnyError> {
+  let deno_version = DENO_VERSION_INFO.deno;
   let dir = factory.deno_dir()?;
   #[allow(deprecated)]
   let modules_cache = factory.global_http_cache()?.dir_path();
@@ -218,6 +220,7 @@ fn print_cache_info(
   if json {
     let mut json_output = serde_json::json!({
       "version": JSON_SCHEMA_VERSION,
+      "denoVersion": deno_version,
       "denoDir": deno_dir,
       "modulesCache": modules_cache,
       "npmCache": npm_cache,
@@ -233,6 +236,7 @@ fn print_cache_info(
 
     display::write_json_to_stdout(&json_output)
   } else {
+    println!("{} {}", colors::bold("Deno version:"), deno_version);
     println!("{} {}", colors::bold("DENO_DIR location:"), deno_dir);
     println!(
       "{} {}",

filename: tests/specs/info/flag/041_info_flag.out
patch: @@ -1,3 +1,4 @@
+Deno version: [WILDLINE].[WILDLINE].[WILDLINE]
 DENO_DIR location: [WILDCARD]
 Remote modules cache: [WILDCARD]remote
 npm modules cache: [WILDCARD]npm

filename: tests/specs/info/flag_location/041_info_flag_location.out
patch: @@ -1,3 +1,4 @@
+Deno version: [WILDLINE].[WILDLINE].[WILDLINE]
 DENO_DIR location: [WILDCARD]
 Remote modules cache: [WILDCARD]remote
 npm modules cache: [WILDCARD]npm

filename: tests/specs/info/json/info_json.out
patch: @@ -1,5 +1,6 @@
 {
   "version": 1,
+  "denoVersion": "[WILDLINE].[WILDLINE].[WILDLINE]",
   "denoDir": "[WILDCARD]",
   "modulesCache": "[WILDCARD]remote",
   "npmCache": "[WILDCARD]npm",

filename: tests/specs/info/json_location/info_json_location.out
patch: @@ -1,5 +1,6 @@
 {
   "version": 1,
+  "denoVersion": "[WILDLINE].[WILDLINE].[WILDLINE]",
   "denoDir": "[WILDCARD]",
   "modulesCache": "[WILDCARD]remote",
   "npmCache": "[WILDCARD]npm",
Repository: electron/electron
Pull request: fix: asan build on macOS

#### Description of Change

Backports https://github.com/nodejs/node/pull/56901

#### Release Notes

Notes: fix crash on startup with asan build on macOS

Changed files:
filename: patches/node/.patches
patch: @@ -38,3 +38,4 @@ build_use_third_party_simdutf.patch
 fix_remove_fastapitypedarray_usage.patch
 test_handle_explicit_resource_management_globals.patch
 linux_try_preadv64_pwritev64_before_preadv_pwritev_4683.patch
+build_remove_explicit_linker_call_to_libm_on_macos.patch

filename: patches/node/build_remove_explicit_linker_call_to_libm_on_macos.patch
patch: @@ -0,0 +1,59 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: deepak1556 <hop2deep@gmail.com>
+Date: Mon, 3 Feb 2025 21:44:36 +0900
+Subject: build: remove explicit linker call to libm on macOS
+
+/usr/lib/libm.tbd is available via libSystem.*.dylib and
+reexports sanitizer symbols. When building for asan
+this becomes an issue as the linker will resolve the symbols
+from the system library rather from libclang_rt.*
+
+For V8 that rely on specific version of these symbols
+that get bundled as part of clang, for ex:
+https://source.chromium.org/chromium/chromium/src/+/main:v8/src/heap/cppgc/platform.cc;l=93-97
+accepting nullptr for shadow_offset in `asan_get_shadow_mapping`,
+linking to system version that doesn't support this will lead to
+a crash.
+
+Clang driver eventually links with `-lSystem`
+https://github.com/llvm/llvm-project/blob/e82f93890daefeb38fe2a22ee3db87a89948ec57/clang/lib/Driver/ToolChains/Darwin.cpp#L1628-L1631,
+this is done after linking the sanitizer libraries which
+ensures right order of resolution for the symbols.
+
+PR-URL: https://github.com/nodejs/node/pull/56901
+Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
+Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
+Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
+Reviewed-By: Shelley Vohr <shelley.vohr@gmail.com>
+
+diff --git a/deps/brotli/unofficial.gni b/deps/brotli/unofficial.gni
+index 5e07e106672a04508a77584c109c97a67926c858..91001fa43ea4807d061f296eaeccb7512e34863e 100644
+--- a/deps/brotli/unofficial.gni
++++ b/deps/brotli/unofficial.gni
+@@ -25,7 +25,7 @@ template("brotli_gn_build") {
+     } else if (target_os == "freebsd") {
+       defines = [ "OS_FREEBSD" ]
+     }
+-    if (!is_win) {
++    if (is_linux) {
+       libs = [ "m" ]
+     }
+     if (is_clang || !is_win) {
+diff --git a/deps/uv/unofficial.gni b/deps/uv/unofficial.gni
+index 7a73f891e3fc3261b77af97af63fca2eade49849..bda1b5dc899558c2b4a22377dde9fb3bcce5488c 100644
+--- a/deps/uv/unofficial.gni
++++ b/deps/uv/unofficial.gni
+@@ -82,11 +82,11 @@ template("uv_gn_build") {
+       ]
+     }
+     if (is_posix) {
+-      libs = [ "m" ]
+       ldflags = [ "-pthread" ]
+     }
+     if (is_linux) {
+-      libs += [
++      libs = [
++        "m",
+         "dl",
+         "rt",
+       ]
Repository: huggingface/transformers
Pull request: Deprecate AutoModelForVision2Seq

# What does this PR do?

As per title, we'll remove it anyway in the end so let's start raising warnings. I already ask all new models to not use `Vision2Seq`

Changed files:
filename: src/transformers/models/auto/modeling_auto.py
patch: @@ -1997,11 +1997,12 @@ class AutoModelForVideoClassification(_BaseAutoModelClass):
 AutoModelForVideoClassification = auto_class_update(AutoModelForVideoClassification, head_doc="video classification")
 
 
-class AutoModelForVision2Seq(_BaseAutoModelClass):
+# Private on purpose, the public class will add the deprecation warnings.
+class _AutoModelForVision2Seq(_BaseAutoModelClass):
     _model_mapping = MODEL_FOR_VISION_2_SEQ_MAPPING
 
 
-AutoModelForVision2Seq = auto_class_update(AutoModelForVision2Seq, head_doc="vision-to-text modeling")
+_AutoModelForVision2Seq = auto_class_update(_AutoModelForVision2Seq, head_doc="vision-to-text modeling")
 
 
 class AutoModelForImageTextToText(_BaseAutoModelClass):
@@ -2100,6 +2101,26 @@ def from_pretrained(cls, pretrained_model_name_or_path, *model_args, **kwargs):
         return super().from_pretrained(pretrained_model_name_or_path, *model_args, **kwargs)
 
 
+class AutoModelForVision2Seq(_AutoModelForVision2Seq):
+    @classmethod
+    def from_config(cls, config):
+        warnings.warn(
+            "The class `AutoModelForVision2Seq` is deprecated and will be removed in v5.0. Please use "
+            "`AutoModelForImageTextToText` instead.",
+            FutureWarning,
+        )
+        return super().from_config(config)
+
+    @classmethod
+    def from_pretrained(cls, pretrained_model_name_or_path, *model_args, **kwargs):
+        warnings.warn(
+            "The class `AutoModelForVision2Seq` is deprecated and will be removed in v5.0. Please use "
+            "`AutoModelForImageTextToText` instead.",
+            FutureWarning,
+        )
+        return super().from_pretrained(pretrained_model_name_or_path, *model_args, **kwargs)
+
+
 __all__ = [
     "MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING",
     "MODEL_FOR_AUDIO_FRAME_CLASSIFICATION_MAPPING",
Repository: ggml-org/llama.cpp
Pull request: vulkan: add missing clamps in new mul_mat_id paths

This is a missing interaction between #15546 and #15652


Changed files:
filename: ggml/src/ggml-vulkan/vulkan-shaders/mul_mm_cm2.comp
patch: @@ -494,6 +494,9 @@ void main() {
                     sum = coopMatMulAdd(mat_a, mat_b, sum);
                 }
             }
+#if defined(ACC_TYPE_MAX)
+            [[unroll]] for (uint i = 0; i < sum.length(); ++i) { sum[i] = clamp(sum[i], -ACC_TYPE_MAX, ACC_TYPE_MAX); }
+#endif
 
             // Convert from ACC_TYPE to D_TYPE
             coopmat<D_TYPE, gl_ScopeWorkgroup, BM, BNover4, gl_MatrixUseAccumulator> mat_d;
@@ -535,6 +538,9 @@ void main() {
                     sum = coopMatMulAdd(mat_a, mat_b, sum);
                 }
             }
+#if defined(ACC_TYPE_MAX)
+            [[unroll]] for (uint i = 0; i < sum.length(); ++i) { sum[i] = clamp(sum[i], -ACC_TYPE_MAX, ACC_TYPE_MAX); }
+#endif
 
             // Convert from ACC_TYPE to D_TYPE
             coopmat<D_TYPE, gl_ScopeWorkgroup, BM, BNover2, gl_MatrixUseAccumulator> mat_d;
Repository: ggml-org/llama.cpp
Pull request: vulkan: disable large mmv subgroups on older Nvidia GPUs

Fixes #15618

Changed files:
filename: ggml/src/ggml-vulkan/ggml-vulkan.cpp
patch: @@ -4662,7 +4662,7 @@ static vk_pipeline ggml_vk_get_dequantize_mul_mat_vec(ggml_backend_vk_context *
 
     // heuristic to choose workgroup size
     uint32_t dmmv_wg = DMMV_WG_SIZE_SUBGROUP;
-    if (ctx->device->vendor_id == VK_VENDOR_ID_NVIDIA || ctx->device->vendor_id == VK_VENDOR_ID_INTEL) {
+    if ((ctx->device->vendor_id == VK_VENDOR_ID_NVIDIA && ctx->device->architecture != vk_device_architecture::NVIDIA_PRE_TURING) || ctx->device->vendor_id == VK_VENDOR_ID_INTEL) {
         // Prefer larger workgroups when M is small, to spread the work out more
         // and keep more SMs busy.
         // q6_k seems to prefer small workgroup size even for "medium" values of M.
Repository: vercel/next.js
Pull request: Turbopack: don't emit `blurDataURL: null`

Do what Webpack does and don't generate `blurDataUrl: null`, just omit that property.

Closes PACK-5023

Changed files:
filename: crates/next-core/src/next_image/source_asset.rs
patch: @@ -84,19 +84,25 @@ impl Asset for StructuredImageFileSource {
             }
             BlurPlaceholderMode::DataUrl => {
                 let info = get_meta_data(*self.image, *content, Some(blur_options)).await?;
-                writeln!(
+                write!(
                     result,
-                    "export default {{ src, width: {width}, height: {height}, blurDataURL: \
-                     {blur_data_url}, blurWidth: {blur_width}, blurHeight: {blur_height} }}",
+                    "export default {{ src, width: {width}, height: {height}, blurWidth: \
+                     {blur_width}, blurHeight: {blur_height}",
                     width = StringifyJs(&info.width),
                     height = StringifyJs(&info.height),
-                    blur_data_url =
-                        StringifyJs(&info.blur_placeholder.as_ref().map(|p| p.data_url.as_str())),
                     blur_width =
                         StringifyJs(&info.blur_placeholder.as_ref().map_or(0, |p| p.width)),
                     blur_height =
                         StringifyJs(&info.blur_placeholder.as_ref().map_or(0, |p| p.height),),
                 )?;
+                if let Some(blur_placeholder) = &info.blur_placeholder {
+                    write!(
+                        result,
+                        ", blurDataURL: {blur_data_url}",
+                        blur_data_url = StringifyJs(blur_placeholder.data_url.as_str()),
+                    )?;
+                }
+                writeln!(result, "}};")?;
             }
             BlurPlaceholderMode::None => {
                 let info = get_meta_data(*self.image, *content, None).await?;
Repository: facebook/react
Pull request: [lint] treat React.use() the same as use()

We should probably treat `React.use()` the same as `use()` to allow it within loops and conditionals.

Ideally this would implement a test that `React` is imported or required from `'react'`, but we don't otherwise implement such a test.

Changed files:
filename: packages/eslint-plugin-react-hooks/__tests__/ESLintRulesOfHooks-test.js
patch: @@ -489,9 +489,12 @@ const tests = {
     },
     {
       code: normalizeIndent`
+        import * as React from 'react';
         function App() {
           if (shouldShowText) {
             const text = use(query);
+            const data = React.use(thing);
+            const data2 = react.use(thing2);
             return <Text text={text} />
           }
           return <Text text={shouldFetchBackupText ? use(backupQuery) : "Nothing to see here"} />

filename: packages/eslint-plugin-react-hooks/src/RulesOfHooks.js
patch: @@ -108,7 +108,7 @@ function isUseEffectEventIdentifier(node) {
 }
 
 function isUseIdentifier(node) {
-  return node.type === 'Identifier' && node.name === 'use';
+  return isReactFunction(node, 'use');
 }
 
 export default {