helloadhavan/github_issues huggingface dataset:
Repository: huggingface/transformers
Pull request: [kernels] Update cv_utils name

# What does this PR do?

We are standardizing kernel names in `kernels-community` to use `-` instead of `_`, this pr simply updates `cv_utils`
new kernel is here with the latest torch version 2.10: https://huggingface.co/kernels-community/cv-utils

Changed files:
filename: src/transformers/models/sam3_video/modeling_sam3_video.py
patch: @@ -54,7 +54,7 @@ def _load_cv_utils_kernel_once():
         return
 
     try:
-        cv_utils_kernel = get_kernel("kernels-community/cv_utils")
+        cv_utils_kernel = get_kernel("kernels-community/cv-utils")
     except Exception as e:
         logger.warning_once(
             f"Failed to load cv_utils kernel (your torch/cuda setup may not be supported): {e}. "
Repository: vuejs/vue
Pull request: [automated] Patreon backers update (Sep 2019

This is an automated pull request.

Changed files:
filename: BACKERS.md
patch: @@ -351,90 +351,88 @@ Funds donated via Patreon go directly to support Evan You's full-time work on Vu
 <!--10 start-->
 - Masahiro Tanaka
 - Shawn Wildermuth
-- Samuel Smith
-- donny
-- Lars Andreas Ness
 - Sean Washington
+- Lars Andreas Ness
 - Keisuke Kita
 - Benjamin Listwon
 - Kirk Lewis
-- Stephen Michael Hartley
 - Wen-Tien Chang
 - Victor Tolbert
+- Stephen Michael Hartley
 - Phan An
 - James J. Ye
 - Barbara Liau
-- Luiz
 - Matsumoto Takamasa
 - Guy Gavergun
-- Duncan Kenzie
-- Niannian Modisette
 - Matt Jones
+- Niannian Modisette
+- Duncan Kenzie
 - Bernhard E. Reiter
 - Zoran Knezevic
 - Jon Hobbs-Smith
 - Pierre Vanhulst
-- Haim Yulzari
 - Asaf Yishai
+- Haim Yulzari
 - Anthony Estebe
 - Akiho Nagao
-- Jeremy Tan
 - Jim Raden
+- Jeremy Tan
 - IMGNRY
 - Tyler
+- Rob Yedlin
 - Guilherme S L de Souza
-- Daniel Waghorn
 - Mickaël Andrieu
 - Vivekanandhan Natarajan
-- Rob Yedlin
-- Rafael Belvederese
-- Jordan Oroshiba
 - Joe Gregory
+- Jordan Oroshiba
 - Marcos Moura
 - Jessie Hernandez
-- Eric
 - Ivan Sieder
-- Christo Crampton
+- Eric
 - Romain Lienard
 - Bohdan Kokotko
-- Donald Fischer
+- Christo Crampton
 - Oskar Lindgren
-- Alexander Weiher
-- David Ang
 - Wakana Seki
+- Alexander Weiher
+- Donald Fischer
 - Jere Sjöroos
-- Ben Hong
+- David Ang
 - David Kaplan
-- Domenico Gaudioso
 - Jaeyoung Lee
+- Shapovalov Pavel
+- Domenico Gaudioso
 - Andy
 - Matt Sencenbaugh
-- Shapovalov Pavel
+- Chris Calo
+- Elon Hung
 - Hannes Kochniß
 - Daniel Mattingley
-- Elon Hung
-- Chris Calo
 - Juan Bermudez
 - Soichiro Isshiki
-- Ed Linklater
 - Garion Herman
+- Ed Linklater
+- Andrew Willis
 - Princeyesuraj Edward
 - Yusuke Kawabata
 - 龙腾道
-- Peter Matkovsky
 - Nick Dandakis
+- Peter Matkovsky
 - Fabien GuySake Ungerer
+- Kenneth Crawford
 - Nathan Mallison
 - Bill Condo
-- Kenneth Crawford
 - Pierre Lebrun
 - John Thompson
 - Martin Bastien
 - Ryan Brewer
-- Merott Movahedi
 - Bichinger Software & Consulting
+- Merott Movahedi
 - Alfonso Herrera
 - Abhay
+- Afif Sohaili
+- Nicolaas
+- Riki Fridrich
 <!--10 end-->
 
 <h2 align="center">Backers via OpenCollective</h2>
Repository: ollama/ollama
Pull request: convert: change to colmajor

currently the shape is updated to colmajor in fs/ggml/gguf which break the abstraction and prevents WriteGGUF from being round tripped. this moves the shaping up to convert

Changed files:
filename: convert/convert.go
patch: @@ -7,6 +7,7 @@ import (
 	"io"
 	"io/fs"
 	"log/slog"
+	"slices"
 	"strings"
 
 	"github.com/ollama/ollama/fs/ggml"
@@ -84,14 +85,6 @@ func (ModelParameters) specialTokenTypes() []string {
 	}
 }
 
-func (ModelParameters) writeFile(ws io.WriteSeeker, kv ggml.KV, ts []ggml.Tensor) error {
-	return ggml.WriteGGUF(ws, kv, ts)
-}
-
-func (AdapterParameters) writeFile(ws io.WriteSeeker, kv ggml.KV, ts []ggml.Tensor) error {
-	return ggml.WriteGGUF(ws, kv, ts)
-}
-
 type ModelConverter interface {
 	// KV maps parameters to LLM key-values
 	KV(*Tokenizer) ggml.KV
@@ -103,8 +96,6 @@ type ModelConverter interface {
 
 	// specialTokenTypes returns any special token types the model uses
 	specialTokenTypes() []string
-	// writeFile writes the model to the provided io.WriteSeeker
-	writeFile(io.WriteSeeker, ggml.KV, []ggml.Tensor) error
 }
 
 type moreParser interface {
@@ -119,8 +110,6 @@ type AdapterConverter interface {
 	// Replacements returns a list of string pairs to replace in tensor names.
 	// See [strings.Replacer](https://pkg.go.dev/strings#Replacer) for details
 	Replacements() []string
-
-	writeFile(io.WriteSeeker, ggml.KV, []ggml.Tensor) error
 }
 
 func ConvertAdapter(fsys fs.FS, ws io.WriteSeeker, baseKV ggml.KV) error {
@@ -158,7 +147,7 @@ func ConvertAdapter(fsys fs.FS, ws io.WriteSeeker, baseKV ggml.KV) error {
 		return err
 	}
 
-	return conv.writeFile(ws, conv.KV(baseKV), conv.Tensors(ts))
+	return writeFile(ws, conv.KV(baseKV), conv.Tensors(ts))
 }
 
 // Convert writes an Ollama compatible model to the provided io.WriteSeeker based on configurations
@@ -248,5 +237,13 @@ func ConvertModel(fsys fs.FS, ws io.WriteSeeker) error {
 		return err
 	}
 
-	return conv.writeFile(ws, conv.KV(t), conv.Tensors(ts))
+	return writeFile(ws, conv.KV(t), conv.Tensors(ts))
+}
+
+func writeFile(ws io.WriteSeeker, kv ggml.KV, ts []ggml.Tensor) error {
+	for i := range ts {
+		ts[i].Shape = slices.Clone(ts[i].Shape)
+		slices.Reverse(ts[i].Shape)
+	}
+	return ggml.WriteGGUF(ws, kv, ts)
 }

filename: fs/ggml/gguf.go
patch: @@ -627,8 +627,8 @@ func ggufWriteTensorInfo(ws io.WriteSeeker, t Tensor) error {
 		return err
 	}
 
-	for i := range len(t.Shape) {
-		if err := binary.Write(ws, binary.LittleEndian, t.Shape[len(t.Shape)-i-1]); err != nil {
+	for _, n := range t.Shape {
+		if err := binary.Write(ws, binary.LittleEndian, n); err != nil {
 			return err
 		}
 	}
Repository: vuejs/vue
Pull request: [automated] Patreon sponsors update

This is an automated pull request.

Changed files:
filename: BACKERS.md
patch: @@ -51,6 +51,13 @@ Funds donated via Patreon go directly to support Evan You's full-time work on Vu
         </a>
       </td>
     </tr><tr></tr>
+    <tr>
+      <td align="center" valign="middle">
+        <a href="https://retool.com/?utm_source=sponsor&utm_campaign=vue" target="_blank">
+          <img width="222px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/retool.png">
+        </a>
+      </td>
+    </tr><tr></tr>
   </tbody>
 </table>
 <!--platinum end-->

filename: README.md
patch: @@ -61,6 +61,13 @@ Funds donated via Patreon go directly to support Evan You's full-time work on Vu
         </a>
       </td>
     </tr><tr></tr>
+    <tr>
+      <td align="center" valign="middle">
+        <a href="https://retool.com/?utm_source=sponsor&utm_campaign=vue" target="_blank">
+          <img width="222px" src="https://raw.githubusercontent.com/vuejs/vuejs.org/master/themes/vue/source/images/retool.png">
+        </a>
+      </td>
+    </tr><tr></tr>
   </tbody>
 </table>
 <!--platinum end-->
Repository: electron/electron
Pull request: feat: import shared texture supports nv12.

#### Description of Change

Add NV12 support for import shared texture module.

#### Release Notes

Notes: Added NV12 support for import shared texture.

Changed files:
filename: docs/api/structures/shared-texture-import-texture-info.md
patch: @@ -4,6 +4,7 @@
   * `bgra` - 32bpp BGRA (byte-order), 1 plane.
   * `rgba` - 32bpp RGBA (byte-order), 1 plane.
   * `rgbaf16` - Half float RGBA, 1 plane.
+  * `nv12` - 12bpp with Y plane followed by a 2x2 interleaved UV plane.
 * `colorSpace` [ColorSpace](color-space.md) (optional) - The color space of the texture.
 * `codedSize` [Size](size.md) - The full dimensions of the shared texture.
 * `visibleRect` [Rectangle](rectangle.md) (optional) - A subsection of [0, 0, codedSize.width, codedSize.height]. In common cases, it is the full section area.

filename: shell/common/api/electron_api_shared_texture.cc
patch: @@ -126,6 +126,8 @@ std::string TransferVideoPixelFormatToString(media::VideoPixelFormat format) {
       return "rgba";
     case media::PIXEL_FORMAT_RGBAF16:
       return "rgbaf16";
+    case media::PIXEL_FORMAT_NV12:
+      return "nv12";
     default:
       NOTREACHED();
   }
@@ -566,6 +568,8 @@ struct Converter<ImportSharedTextureInfo> {
         out->pixel_format = media::PIXEL_FORMAT_ABGR;
       else if (pixel_format_str == "rgbaf16")
         out->pixel_format = media::PIXEL_FORMAT_RGBAF16;
+      else if (pixel_format_str == "nv12")
+        out->pixel_format = media::PIXEL_FORMAT_NV12;
       else
         return false;
     }
@@ -730,6 +734,14 @@ v8::Local<v8::Value> ImportSharedTexture(v8::Isolate* isolate,
                               shared_image_usage, "SharedTextureVideoFrame"},
                              std::move(gmb_handle));
 
+  if (!si) {
+    gin_helper::ErrorThrower(isolate).ThrowTypeError(
+        "Failed to create shared image from shared texture handle. Texture "
+        "format or dimension might not be supported on current device or "
+        "platform.");
+    return v8::Null(isolate);
+  }
+
   ImportedSharedTexture* imported = new ImportedSharedTexture();
   imported->pixel_format = shared_texture.pixel_format;
   imported->coded_size = shared_texture.coded_size;
Repository: huggingface/transformers
Pull request: Mark test_prompt_lookup_decoding as flaky

The CI seems a bit unstable and this test is the most common culprit! cc @ydshieh

Changed files:
filename: tests/generation/test_utils.py
patch: @@ -40,6 +40,7 @@
 )
 from transformers.testing_utils import (
     CaptureLogger,
+    is_flaky,
     require_accelerate,
     require_flash_attn,
     require_flash_attn_3,
@@ -729,6 +730,7 @@ def test_assisted_decoding_matches_greedy_search(self, assistant_type):
                 self._check_generate_outputs(output, model.config, use_cache=True)
 
     @pytest.mark.generate
+    @is_flaky
     def test_prompt_lookup_decoding_matches_greedy_search(self):
         # This test ensures that the prompt lookup generation does not introduce output changes over greedy search.
         # This test is mostly a copy of test_assisted_decoding_matches_greedy_search
Repository: ollama/ollama
Pull request: ci: silence deprecated gpu targets warning

this quiets the nvcc warning when building for deprecated gpu targets. the build targets are set explicitly so there's no reason to show these warnings. setting it in CMakePresets allows quieter ci builds while giving any users the information they would need re: deprecated targets

```
nvcc warning : The 'compute_35', 'compute_37', 'compute_50', 'sm_35', 'sm_37' and 'sm_50' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
```

Changed files:
filename: CMakePresets.json
patch: @@ -21,14 +21,16 @@
       "name": "CUDA 11",
       "inherits": [ "CUDA" ],
       "cacheVariables": {
-        "CMAKE_CUDA_ARCHITECTURES": "50;52;53;60;61;70;75;80;86"
+        "CMAKE_CUDA_ARCHITECTURES": "50;52;53;60;61;70;75;80;86",
+        "CMAKE_CUDA_FLAGS": "-Wno-deprecated-gpu-targets"
       }
     },
     {
       "name": "CUDA 12",
       "inherits": [ "CUDA" ],
       "cacheVariables": {
-        "CMAKE_CUDA_ARCHITECTURES": "50;60;61;70;75;80;86;87;89;90;90a;120"
+        "CMAKE_CUDA_ARCHITECTURES": "50;60;61;70;75;80;86;87;89;90;90a;120",
+        "CMAKE_CUDA_FLAGS": "-Wno-deprecated-gpu-targets"
       }
     },
     {
Repository: electron/electron
Pull request: feat: import shared texture supports nv12.

Backport of #48922

See that PR for details.


Notes: Added NV12 support for import shared texture.

Changed files:
filename: docs/api/structures/shared-texture-import-texture-info.md
patch: @@ -4,6 +4,7 @@
   * `bgra` - 32bpp BGRA (byte-order), 1 plane.
   * `rgba` - 32bpp RGBA (byte-order), 1 plane.
   * `rgbaf16` - Half float RGBA, 1 plane.
+  * `nv12` - 12bpp with Y plane followed by a 2x2 interleaved UV plane.
 * `colorSpace` [ColorSpace](color-space.md) (optional) - The color space of the texture.
 * `codedSize` [Size](size.md) - The full dimensions of the shared texture.
 * `visibleRect` [Rectangle](rectangle.md) (optional) - A subsection of [0, 0, codedSize.width, codedSize.height]. In common cases, it is the full section area.

filename: shell/common/api/electron_api_shared_texture.cc
patch: @@ -125,6 +125,8 @@ std::string TransferVideoPixelFormatToString(media::VideoPixelFormat format) {
       return "rgba";
     case media::PIXEL_FORMAT_RGBAF16:
       return "rgbaf16";
+    case media::PIXEL_FORMAT_NV12:
+      return "nv12";
     default:
       NOTREACHED();
   }
@@ -565,6 +567,8 @@ struct Converter<ImportSharedTextureInfo> {
         out->pixel_format = media::PIXEL_FORMAT_ABGR;
       else if (pixel_format_str == "rgbaf16")
         out->pixel_format = media::PIXEL_FORMAT_RGBAF16;
+      else if (pixel_format_str == "nv12")
+        out->pixel_format = media::PIXEL_FORMAT_NV12;
       else
         return false;
     }
@@ -727,6 +731,14 @@ v8::Local<v8::Value> ImportSharedTexture(v8::Isolate* isolate,
                               shared_image_usage, "SharedTextureVideoFrame"},
                              std::move(gmb_handle));
 
+  if (!si) {
+    gin_helper::ErrorThrower(isolate).ThrowTypeError(
+        "Failed to create shared image from shared texture handle. Texture "
+        "format or dimension might not be supported on current device or "
+        "platform.");
+    return v8::Null(isolate);
+  }
+
   ImportedSharedTexture* imported = new ImportedSharedTexture();
   imported->pixel_format = shared_texture.pixel_format;
   imported->coded_size = shared_texture.coded_size;
Repository: ggml-org/llama.cpp
Pull request: vulkan: allow graphics queue only through env var

Improve #20551 to fix the reported issues. Only use graphics queue on RADV on larger GPUs.

Fixes #20597

Changed files:
filename: ggml/src/ggml-vulkan/ggml-vulkan.cpp
patch: @@ -4981,8 +4981,9 @@ static vk_device ggml_vk_get_device(size_t idx) {
         std::vector<vk::QueueFamilyProperties> queue_family_props = device->physical_device.getQueueFamilyProperties();
 
         // Try to find a non-graphics compute queue and transfer-focused queues
-        // On AMD, the graphics queue seems to be faster, so don't avoid it
-        const vk::QueueFlagBits graphics_flag = device->vendor_id == VK_VENDOR_ID_AMD ? (vk::QueueFlagBits)0 : vk::QueueFlagBits::eGraphics;
+        // Allow overriding avoiding the graphics queue because it can increase performance on RADV
+        const bool allow_graphics_queue = (getenv("GGML_VK_ALLOW_GRAPHICS_QUEUE") != nullptr);
+        const vk::QueueFlagBits graphics_flag = allow_graphics_queue ? (vk::QueueFlagBits)0 : vk::QueueFlagBits::eGraphics;
         const uint32_t compute_queue_family_index = ggml_vk_find_queue_family_index(queue_family_props, vk::QueueFlagBits::eCompute, graphics_flag, -1, 1);
         const uint32_t transfer_queue_family_index = ggml_vk_find_queue_family_index(queue_family_props, vk::QueueFlagBits::eTransfer, vk::QueueFlagBits::eCompute | graphics_flag, compute_queue_family_index, 1);
 
@@ -5443,11 +5444,14 @@ static vk_device ggml_vk_get_device(size_t idx) {
 
         ggml_vk_load_shaders(device);
 
+        // Only use transfer queue on AMD non-GCN, when the graphics queue is not enabled
+        const bool prefers_transfer_queue = device->vendor_id == VK_VENDOR_ID_AMD && device->architecture != AMD_GCN && !allow_graphics_queue;
+
         if (!device->single_queue) {
             const uint32_t transfer_queue_index = compute_queue_family_index == transfer_queue_family_index ? 1 : 0;
             ggml_vk_create_queue(device, device->transfer_queue, transfer_queue_family_index, transfer_queue_index, { vk::PipelineStageFlagBits::eTransfer }, true);
 
-            device->async_use_transfer_queue = (getenv("GGML_VK_ASYNC_USE_TRANSFER_QUEUE") != nullptr);
+            device->async_use_transfer_queue = prefers_transfer_queue || (getenv("GGML_VK_ASYNC_USE_TRANSFER_QUEUE") != nullptr);
         } else {
             // TODO: Use pointer or reference to avoid copy
             device->transfer_queue.copyFrom(device->compute_queue);
Repository: vuejs/vue
Pull request: fix: set only flex-wrap

<!--
Please make sure to read the Pull Request Guidelines:
https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md#pull-request-guidelines
-->

This PR replaces the shorthand `flex-flow` with the right long version `flex-wrap`.

<!-- PULL REQUEST TEMPLATE -->
<!-- (Update "[ ]" to "[x]" to check a box) -->

**What kind of change does this PR introduce?** (check at least one)

- [x] Bugfix
- [ ] Feature
- [ ] Code style update
- [ ] Refactor
- [ ] Build-related changes
- [ ] Other, please describe:

**Does this PR introduce a breaking change?** (check one)

- [ ] Yes
- [x] No

If yes, please describe the impact and migration path for existing applications:

**The PR fulfills these requirements:**

- [x] It's submitted to the `dev` branch for v2.x (or to a previous version branch), _not_ the `master` branch
- [ ] When resolving a specific issue, it's referenced in the PR's title (e.g. `fix #xxx[,#xxx]`, where "xxx" is the issue number)
- [ ] All tests are passing: https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md#development-setup
- [ ] New/updated tests are included

If adding a **new feature**, the PR's description includes:
- [ ] A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

**Other information:**


Changed files:
filename: benchmarks/uptime/index.html
patch: @@ -38,7 +38,7 @@
       .days {
         display: flex;
         flex-direction: row;
-        flex-flow: wrap;
+        flex-wrap: wrap;
       }
 
       .uptime-day {
Repository: nodejs/node
Pull request: doc: include OpenJSF handle for security stewards

cc: @nodejs/tsc 

Changed files:
filename: README.md
patch: @@ -889,15 +889,15 @@ releases on a rotation basis as outlined in the
   * [bengl](https://github.com/bengl) -
     **Bryan English** <<bryan@bryanenglish.com>> (he/him)
 * [HeroDevs](https://www.herodevs.com/)
-  * [marco-ippolito](https://github.com/marco-ippolito) -
+  * [marco-ippolito](https://github.com/marco-ippolito) - OpenJSF handle: `Marco Ippolito`
     **Marco Ippolito** <<marcoippolito54@gmail.com>> (he/him)
 * [NodeSource](https://nodesource.com/)
   * [juanarbol](https://github.com/juanarbol) -
     **Juan José Arboleda** <<soyjuanarbol@gmail.com>> (he/him)
-  * [RafaelGSS](https://github.com/RafaelGSS) -
+  * [RafaelGSS](https://github.com/RafaelGSS) - OpenJSF handle: `RafaelGSS`
     **Rafael Gonzaga** <<rafael.nunu@hotmail.com>> (he/him)
 * [Platformatic](https://platformatic.dev/)
-  * [mcollina](https://github.com/mcollina) -
+  * [mcollina](https://github.com/mcollina) - OpenJSF handle: `mcollina`
     **Matteo Collina** <<matteo.collina@gmail.com>> (he/him)
 * [Red Hat](https://redhat.com) / [IBM](https://ibm.com)
   * [joesepi](https://github.com/joesepi) -
Repository: ollama/ollama
Pull request: server: improve spacing for JSON grammar

Pulled out from https://github.com/ollama/ollama/pull/10096 for improving whitespace in grammars 

## Fixing `\n` with grammar
New gemma output
```
❯ go run . run gemma3
# github.com/ollama/ollama
ld: warning: ignoring duplicate libraries: '-lobjc'
>>> /set format json
Set format to 'json' mode.
>>> create a json
        {
                "name": "Example JSON",
                "version":      "1.0",
                "description":  "A simple example JSON document.",
                "author":       "Bard",
                "date": "2023-10-27",
                "data": {
                        "numbers":      [1,     2,      3,      4,      5],
                        "strings":      ["apple",       "banana",       "cherry"],
                        "boolean":      true,
                        "null_value":   null,
                        "object":       {
                                "key1": "value1",
                                "key2": 123,
                                "key3": {
                                        "nested_key":   "nested_value"
                                }
                        }
                }
        }
```


Previous gemma output
```
❯ go run . run gemma3
# github.com/ollama/ollama
ld: warning: ignoring duplicate libraries: '-lobjc'
>>> /set format json
Set format to 'json' mode.
>>> create a json
{}

   
   
   
   
   
   
   
   
   
   
   
   
   
   
```


Changed files:
filename: llm/server.go
patch: @@ -640,20 +640,20 @@ root   ::= object
 value  ::= object | array | string | number | ("true" | "false" | "null") ws
 object ::=
   "{" ws (
-            string ":" ws value
+         string ":" ws value
     ("," ws string ":" ws value)*
-  )? "}" ws
+  )? ws "}" 
 array  ::=
   "[" ws (
             value
     ("," ws value)*
-  )? "]" ws
+  )? ws "]" 
 string ::=
   "\"" (
     [^"\\\x7F\x00-\x1F] |
     "\\" (["\\/bfnrt] | "u" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]) # escapes
-  )* "\"" ws
-number ::= ("-"? ([0-9] | [1-9] [0-9]*)) ("." [0-9]+)? ([eE] [-+]? [0-9]+)? ws
+  )* "\"" 
+number ::= ("-"? ([0-9] | [1-9] [0-9]*)) ("." [0-9]+)? ([eE] [-+]? [0-9]+)? 
 # Optional space: by convention, applied in this grammar after literal chars when allowed
 ws ::= ([ \t\n] ws)?
 `
Repository: facebook/react
Pull request: [DevTools] Allow file:/// urls to be opened in editor

If a `file:///` path is specified as the url of a file, like after source mapping into an ESM file, then we should be able to open it in a code editor.


Changed files:
filename: packages/react-devtools-shared/src/devtools/views/Components/OpenInEditorButton.js
patch: @@ -4,6 +4,7 @@
  * This source code is licensed under the MIT license found in the
  * LICENSE file in the root directory of this source tree.
  *
+ * @flow
  */
 
 import * as React from 'react';
@@ -26,10 +27,14 @@ function checkConditions(
   try {
     const url = new URL(editorURL);
 
-    let [, sourceURL, ,] = source;
+    const [, sourceURL, line] = source;
+    let filePath;
 
     // Check if sourceURL is a correct URL, which has a protocol specified
-    if (sourceURL.includes('://')) {
+    if (sourceURL.startsWith('file:///')) {
+      filePath = new URL(sourceURL).pathname;
+    } else if (sourceURL.includes('://')) {
+      // $FlowFixMe[cannot-resolve-name]
       if (!__IS_INTERNAL_VERSION__) {
         // In this case, we can't really determine the path to a file, disable a button
         return {url: null, shouldDisableButton: true};
@@ -42,20 +47,22 @@ function checkConditions(
         if (endOfSourceMapURLIndex === -1) {
           return {url: null, shouldDisableButton: true};
         } else {
-          sourceURL = sourceURL.slice(
+          filePath = sourceURL.slice(
             endOfSourceMapURLIndex + endOfSourceMapURLPattern.length,
             sourceURL.length,
           );
         }
       }
+    } else {
+      filePath = sourceURL;
     }
 
-    const lineNumberAsString = String(source.line);
+    const lineNumberAsString = String(line);
 
     url.href = url.href
-      .replace('{path}', sourceURL)
+      .replace('{path}', filePath)
       .replace('{line}', lineNumberAsString)
-      .replace('%7Bpath%7D', sourceURL)
+      .replace('%7Bpath%7D', filePath)
       .replace('%7Bline%7D', lineNumberAsString);
 
     return {url, shouldDisableButton: false};