helloadhavan/github_issues huggingface dataset:
Repository: vuejs/vue
Pull request: Add promise support to nextTick

This might seem like a very naive implementation, but I _think_ it should work as expected. When we pass a callback to `nextTick`, we just defer it (ideally to the microtask queue), with our preferred strategy being native promises. In cases where promises are polyfilled, it seems projects like Bluebird actually use [very similar scheduling fallbacks](https://github.com/petkaantonov/bluebird/blob/master/src/schedule.js) to `nextTick`, so we should see similar results.


Changed files:
filename: src/core/instance/render.js
patch: @@ -26,7 +26,7 @@ export function initRender (vm: Component) {
 
 export function renderMixin (Vue: Class<Component>) {
   Vue.prototype.$nextTick = function (fn: Function) {
-    nextTick(fn, this)
+    return nextTick(fn, this)
   }
 
   Vue.prototype._render = function (): VNode {

filename: src/core/util/env.js
patch: @@ -87,13 +87,17 @@ export const nextTick = (function () {
   }
 
   return function queueNextTick (cb: Function, ctx?: Object) {
-    const func = ctx
-      ? function () { cb.call(ctx) }
-      : cb
-    callbacks.push(func)
-    if (!pending) {
-      pending = true
-      timerFunc()
+    if (cb) {
+      var func = ctx
+        ? function () { cb.call(ctx) }
+        : cb
+      callbacks.push(func)
+      if (!pending) {
+        pending = true
+        timerFunc()
+      }
+    } else if (typeof Promise !== 'undefined') {
+      return Promise.resolve(ctx)
     }
   }
 })()

filename: test/unit/features/instance/methods-lifecycle.spec.js
patch: @@ -109,5 +109,22 @@ describe('Instance methods lifecycle', () => {
         done()
       })
     })
+
+    if (typeof Promise !== 'undefined') {
+      it('should be called after DOM update in correct context, when using Promise syntax', done => {
+        const vm = new Vue({
+          template: '<div>{{ msg }}</div>',
+          data: {
+            msg: 'foo'
+          }
+        }).$mount()
+        vm.msg = 'bar'
+        vm.$nextTick().then(function (ctx) {
+          expect(ctx).toBe(vm)
+          expect(vm.$el.textContent).toBe('bar')
+          done()
+        })
+      })
+    }
   })
 })

filename: test/unit/modules/util/next-tick.spec.js
patch: @@ -0,0 +1,25 @@
+import { nextTick } from 'core/util/env'
+
+describe('nextTick', () => {
+  it('accepts a callback', done => {
+    nextTick(done)
+  })
+
+  it('returns undefined when passed a callback', () => {
+    expect(typeof nextTick(() => {})).toBe('undefined')
+  })
+
+  if (typeof Promise !== 'undefined') {
+    it('returns a Promise when provided no callback', done => {
+      nextTick().then(done)
+    })
+
+    it('returns a Promise with a context argument when provided a falsy callback and an object', done => {
+      const obj = {}
+      nextTick(undefined, obj).then(ctx => {
+        expect(ctx).toBe(obj)
+        done()
+      })
+    })
+  }
+})
Repository: facebook/react
Pull request: Fix `key` Warning for Flattened Positional Children

## Summary

https://github.com/facebook/react/pull/29088 introduced a regression triggering this warning when rendering flattened positional children:

> Each child in a list should have a unique "key" prop.

The specific scenario that triggers this is when rendering multiple positional children (which do not require unique `key` props) after flattening them with one of the `React.Children` utilities (e.g. `React.Children.toArray`).

The refactored logic in `React.Children` incorrectly drops the `element._store.validated` property in `__DEV__`. This diff fixes the bug and introduces a unit test to prevent future regressions.

## How did you test this change?

```
$ yarn test ReactChildren-test.js
```

Changed files:
filename: packages/react/src/__tests__/ReactChildren-test.js
patch: @@ -868,6 +868,45 @@ describe('ReactChildren', () => {
     ]);
   });
 
+  it('should warn for flattened children lists', async () => {
+    function ComponentRenderingFlattenedChildren({children}) {
+      return <div>{React.Children.toArray(children)}</div>;
+    }
+
+    const container = document.createElement('div');
+    const root = ReactDOMClient.createRoot(container);
+    await expect(async () => {
+      await act(() => {
+        root.render(
+          <ComponentRenderingFlattenedChildren>
+            {[<div />]}
+          </ComponentRenderingFlattenedChildren>,
+        );
+      });
+    }).toErrorDev([
+      'Warning: Each child in a list should have a unique "key" prop.',
+    ]);
+  });
+
+  it('does not warn for flattened positional children', async () => {
+    function ComponentRenderingFlattenedChildren({children}) {
+      return <div>{React.Children.toArray(children)}</div>;
+    }
+
+    const container = document.createElement('div');
+    const root = ReactDOMClient.createRoot(container);
+    await expect(async () => {
+      await act(() => {
+        root.render(
+          <ComponentRenderingFlattenedChildren>
+            <div />
+            <div />
+          </ComponentRenderingFlattenedChildren>,
+        );
+      });
+    }).toErrorDev([]);
+  });
+
   it('should escape keys', () => {
     const zero = <div key="1" />;
     const one = <div key="1=::=2" />;

filename: packages/react/src/jsx/ReactJSXElement.js
patch: @@ -953,7 +953,7 @@ export function createElement(type, config, children) {
 }
 
 export function cloneAndReplaceKey(oldElement, newKey) {
-  return ReactElement(
+  const clonedElement = ReactElement(
     oldElement.type,
     newKey,
     // When enableRefAsProp is on, this argument is ignored. This check only
@@ -966,6 +966,11 @@ export function cloneAndReplaceKey(oldElement, newKey) {
     __DEV__ && enableOwnerStacks ? oldElement._debugStack : undefined,
     __DEV__ && enableOwnerStacks ? oldElement._debugTask : undefined,
   );
+  if (__DEV__) {
+    // The cloned element should inherit the original element's key validation.
+    clonedElement._store.validated = oldElement._store.validated;
+  }
+  return clonedElement;
 }
 
 /**
Repository: ggml-org/llama.cpp
Pull request: Documentation: Further revisions to the Vulkan section in build.md

Changes:

- **Documentation**: Grammar and revisions for the "For Linux users" section of build.md's Vulkan instructions.
- **Documentation**: Updated the test command in the "For Linux users" section of build.md's Vulkan instructions.

Purpose:

I was rereading the Vulkan section after my previous PR relating to it and I thought that it was too rough. So I made these changes to hopefully improve it.

Changed files:
filename: docs/build.md
patch: @@ -387,12 +387,12 @@ docker run -it --rm -v "$(pwd):/app:Z" --device /dev/dri/renderD128:/dev/dri/ren
 
 ### For Linux users:
 
-First, follow the the official [Getting Started with the Linux Tarball Vulkan SDK](https://vulkan.lunarg.com/doc/sdk/latest/linux/getting_started.html) guide.
+First, follow the official LunarG instructions for the installation and setup of the Vulkan SDK in the [Getting Started with the Linux Tarball Vulkan SDK](https://vulkan.lunarg.com/doc/sdk/latest/linux/getting_started.html) guide.
 
 > [!IMPORTANT]
 > After completing the first step, ensure that you have used the `source` command on the `setup_env.sh` file inside of the Vulkan SDK in your current terminal session. Otherwise, the build won't work. Additionally, if you close out of your terminal, you must perform this step again if you intend to perform a build. However, there are ways to make this persistent. Refer to the Vulkan SDK guide linked in the first step for more information about any of this.
 
-Second, after verifying that you have done everything in the Vulkan SDK guide provided in the first step, run the following command to verify that everything is set up correctly:
+Second, after verifying that you have followed all of the SDK installation/setup steps, use this command to make sure before proceeding:
 ```bash
 vulkaninfo
 ```
@@ -403,10 +403,11 @@ cmake -B build -DGGML_VULKAN=1
 cmake --build build --config Release
 ```
 
-Finally, after finishing your build, you should be able to do this:
+Finally, after finishing your build, you should be able to do something like this:
 ```bash
-# Test the output binary (with "-ngl 33" to offload all layers to GPU)
-./build/bin/llama-cli -m "PATH_TO_MODEL" -p "Hi you how are you" -n 50 -e -ngl 33 -t 4
+# Test the output binary
+# "-ngl 99" should offload all of the layers to GPU for most (if not all) models.
+./build/bin/llama-cli -m "PATH_TO_MODEL" -p "Hi you how are you" -ngl 99
 
 # You should see in the output, ggml_vulkan detected your GPU. For example:
 # ggml_vulkan: Using Intel(R) Graphics (ADL GT2) | uma: 1 | fp16: 1 | warp size: 32
Repository: vuejs/vue
Pull request: Modifiers key modifier for directive on of Vue.js 2.0

add ctrl, shift and alt modifiers for v-on


Changed files:
filename: src/compiler/codegen/events.js
patch: @@ -18,7 +18,11 @@ const keyCodes = {
 const modifierCode = {
   stop: '$event.stopPropagation();',
   prevent: '$event.preventDefault();',
-  self: 'if($event.target !== $event.currentTarget)return;'
+  self: 'if($event.target !== $event.currentTarget)return;',
+  ctrl: 'if(!$event.ctrlKey)return;',
+  shift: 'if(!$event.shiftKey)return;',
+  alt: 'if(!$event.altKey)return;',
+  meta: 'if(!$event.metaKey)return;'
 }
 
 export function genHandlers (events: ASTElementHandlers, native?: boolean): string {

filename: test/unit/modules/compiler/codegen.spec.js
patch: @@ -224,6 +224,22 @@ describe('codegen', () => {
       '<input @input.self="onInput">',
       `with(this){return _h('input',{on:{"input":function($event){if($event.target !== $event.currentTarget)return;onInput($event)}}})}`
     )
+    assertCodegen(
+      '<input @input.ctrl="onInput">',
+      `with(this){return _h('input',{on:{"input":function($event){if(!$event.ctrlKey)return;onInput($event)}}})}`
+    )
+    assertCodegen(
+      '<input @input.shift="onInput">',
+      `with(this){return _h('input',{on:{"input":function($event){if(!$event.shiftKey)return;onInput($event)}}})}`
+    )
+    assertCodegen(
+      '<input @input.alt="onInput">',
+      `with(this){return _h('input',{on:{"input":function($event){if(!$event.altKey)return;onInput($event)}}})}`
+    )
+    assertCodegen(
+      '<input @input.meta="onInput">',
+      `with(this){return _h('input',{on:{"input":function($event){if(!$event.metaKey)return;onInput($event)}}})}`
+    )
   })
 
   it('generate events with multiple modifers', () => {
Repository: electron/electron
Pull request: fix: fixed white flash on call to BrowserWindow.show

Backport of #47151

See that PR for details.


Notes: fixed white flash on call to BrowserWindow.show


Changed files:
filename: shell/browser/api/electron_api_base_window.h
patch: @@ -104,8 +104,8 @@ class BaseWindow : public gin_helper::TrackableObject<BaseWindow>,
   virtual void Focus();
   virtual void Blur();
   bool IsFocused() const;
-  void Show();
-  void ShowInactive();
+  virtual void Show();
+  virtual void ShowInactive();
   void Hide();
   bool IsVisible() const;
   bool IsEnabled() const;

filename: shell/browser/api/electron_api_browser_window.cc
patch: @@ -280,7 +280,6 @@ v8::Local<v8::Value> BrowserWindow::GetWebContents(v8::Isolate* isolate) {
 }
 
 void BrowserWindow::OnWindowShow() {
-  web_contents()->WasShown();
   BaseWindow::OnWindowShow();
 }
 
@@ -289,6 +288,19 @@ void BrowserWindow::OnWindowHide() {
   BaseWindow::OnWindowHide();
 }
 
+void BrowserWindow::Show() {
+  web_contents()->WasShown();
+  BaseWindow::Show();
+}
+
+void BrowserWindow::ShowInactive() {
+  // This method doesn't make sense for modal window.
+  if (IsModal())
+    return;
+  web_contents()->WasShown();
+  BaseWindow::ShowInactive();
+}
+
 // static
 gin_helper::WrappableBase* BrowserWindow::New(gin_helper::ErrorThrower thrower,
                                               gin::Arguments* args) {

filename: shell/browser/api/electron_api_browser_window.h
patch: @@ -67,6 +67,8 @@ class BrowserWindow : public BaseWindow,
   void SetBackgroundMaterial(const std::string& material) override;
   void OnWindowShow() override;
   void OnWindowHide() override;
+  void Show() override;
+  void ShowInactive() override;
 
   // BrowserWindow APIs.
   void FocusOnWebView();
Repository: nodejs/node
Pull request: tools: fix update-icu script

Closes: https://github.com/nodejs/node/issues/60506



Changed files:
filename: tools/dep_updaters/update-icu.sh
patch: @@ -32,15 +32,11 @@ CURRENT_VERSION="$(grep "#define U_ICU_VERSION " "$ICU_VERSION_H" | cut -d'"' -f
 # This function exit with 0 if new version and current version are the same
 compare_dependency_version "icu-small" "$NEW_VERSION" "$CURRENT_VERSION"
 
-DASHED_NEW_VERSION=$(echo "$NEW_VERSION" | sed 's/\./-/g')
+NEW_VERSION_TGZ="icu4c-${NEW_VERSION}-sources.tgz"
 
-LOW_DASHED_NEW_VERSION=$(echo "$NEW_VERSION" | sed 's/\./_/g')
+NEW_VERSION_TGZ_URL="https://github.com/unicode-org/icu/releases/download/release-${NEW_VERSION}/${NEW_VERSION_TGZ}"
 
-NEW_VERSION_TGZ="icu4c-${LOW_DASHED_NEW_VERSION}-src.tgz"
-
-NEW_VERSION_TGZ_URL="https://github.com/unicode-org/icu/releases/download/release-${DASHED_NEW_VERSION}/$NEW_VERSION_TGZ"
-
-NEW_VERSION_MD5="https://github.com/unicode-org/icu/releases/download/release-${DASHED_NEW_VERSION}/icu4c-${LOW_DASHED_NEW_VERSION}-sources.md5"
+NEW_VERSION_MD5="https://github.com/unicode-org/icu/releases/download/release-${NEW_VERSION}/icu4c-${NEW_VERSION}-sources.md5"
 
 CHECKSUM=$(curl -sL "$NEW_VERSION_MD5" | grep "$NEW_VERSION_TGZ" | grep -v "\.asc$" | awk '{print $1}')
Repository: vuejs/vue
Pull request: fix markStaticRoots with v-else 

Fix a bug introduced by the PR #4200 , node.elseBlock should be walked together with node.children. I created a [jsfiddle](https://jsfiddle.net/b8hsvv6x/1/) here. It will break with v-if and v-else as root element.


Changed files:
filename: src/compiler/optimizer.js
patch: @@ -77,14 +77,12 @@ function markStaticRoots (node: ASTNode, isInFor: boolean) {
     }
     if (node.children) {
       for (let i = 0, l = node.children.length; i < l; i++) {
-        const child = node.children[i]
-        isInFor = isInFor || !!node.for
-        markStaticRoots(child, isInFor)
-        if (child.type === 1 && child.elseBlock) {
-          markStaticRoots(child.elseBlock, isInFor)
-        }
+        markStaticRoots(node.children[i], isInFor || !!node.for)
       }
     }
+    if (node.elseBlock) {
+      markStaticRoots(node.elseBlock, isInFor)
+    }
   }
 }
 

filename: test/unit/features/directives/once.spec.js
patch: @@ -213,6 +213,35 @@ describe('Directive v-once', () => {
     }).then(done)
   })
 
+  it('should work inside v-for with nested v-else', done => {
+    const vm = new Vue({
+      data: {
+        list: [{ id: 0, text: 'a', tester: true, truthy: 'y' }]
+      },
+      template: `
+        <div v-if="0"></div>
+        <div v-else>
+          <div v-for="i in list" :key="i.id">
+            <span v-if="i.tester" v-once>{{ i.truthy }}</span>
+            <span v-else v-once>{{ i.text }}</span>
+          </div>
+        </div>
+      `
+    }).$mount()
+
+    expectTextContent(vm, 'y')
+    vm.list[0].truthy = 'yy'
+    waitForUpdate(() => {
+      expectTextContent(vm, 'y')
+      vm.list[0].tester = false
+    }).then(() => {
+      expectTextContent(vm, 'a')
+      vm.list[0].text = 'nn'
+    }).then(() => {
+      expectTextContent(vm, 'a')
+    }).then(done)
+  })
+
   it('should warn inside non-keyed v-for', () => {
     const vm = new Vue({
       data: {

filename: test/unit/modules/compiler/optimizer.spec.js
patch: @@ -209,4 +209,18 @@ describe('optimizer', () => {
     expect(ast.children[0].children[0].staticRoot).toBe(true)
     expect(ast.children[0].children[0].staticInFor).toBe(true)
   })
+
+  it('mark static trees inside v-for with nested v-else and v-once', () => {
+    const ast = parse(`
+      <div v-if="1"></div>
+      <div v-else>
+        <div v-for="i in 10" :key="i">
+          <div v-if="1">{{ i }}</div>
+          <div v-else v-once>{{ i }}</div>
+        </div>
+      <div>`, baseOptions)
+    optimize(ast, baseOptions)
+    expect(ast.elseBlock.children[0].children[0].elseBlock.staticRoot).toBe(false)
+    expect(ast.elseBlock.children[0].children[0].elseBlock.staticInFor).toBe(true)
+  })
 })
Repository: ggml-org/llama.cpp
Pull request: nix: fix allowUnfreePredicate for packages with multiple licenses

The `allowUnfreePredicate` in `pkgsCuda` wraps `p.meta.license` in a list, but `meta.license` can already be a list for packages with multiple licenses. This causes flake evaluation to fail when it tries to access `.free` on the nested list.

Fix by using `lib.toList` which handles both single licenses and license lists.

Changed files:
filename: .devops/nix/nixpkgs-instances.nix
patch: @@ -4,7 +4,7 @@
   # the module `{ pkgs ... }: { /* config */ }` implicitly uses
   # `_module.args.pkgs` (defined in this case by flake-parts).
   perSystem =
-    { system, ... }:
+    { lib, system, ... }:
     {
       _module.args = {
         # Note: bringing up https://zimbatm.com/notes/1000-instances-of-nixpkgs
@@ -33,7 +33,7 @@
                 "CUDA EULA"
                 "cuDNN EULA"
               ]
-            ) (p.meta.licenses or [ p.meta.license ]);
+            ) (p.meta.licenses or (lib.toList p.meta.license));
         };
         # Ensure dependencies use ROCm consistently
         pkgsRocm = import inputs.nixpkgs {
Repository: nodejs/node
Pull request: tools: fix linter for semver-major release proposals

As we can see in https://github.com/nodejs/node/pull/59896, the linter fails because it can't find in the proposal the commits listed in the CHANGELOG. That's not surprising since the semver-major proposal only contains the release commit – something I forgot to take into account when working on https://github.com/nodejs/node/pull/57892.

<!--
Before submitting a pull request, please read:

- the CONTRIBUTING guide at https://github.com/nodejs/node/blob/HEAD/CONTRIBUTING.md
- the commit message formatting guidelines at
  https://github.com/nodejs/node/blob/HEAD/doc/contributing/pull-requests.md#commit-message-guidelines

For code changes:
1. Include tests for any bug fixes or new features.
2. Update documentation if relevant.
3. Ensure that `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes.

If you believe this PR should be highlighted in the Node.js CHANGELOG
please add the `notable-change` label.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
-->


Changed files:
filename: tools/actions/lint-release-proposal-commit-list.mjs
patch: @@ -23,8 +23,9 @@ const commitListingStart = changelog.indexOf('\n### Commits\n');
 let commitList;
 if (commitListingStart === -1) {
   // We're preparing a semver-major release.
-  commitList = changelog.replace(/(^.+\n### Semver-Major|\n### Semver-(Minor|Patch)) Commits\n/gs, '')
-    .replaceAll('**(SEMVER-MAJOR)** ', '');
+  assert.match(changelog, /\n### Semver-Major Commits\n/);
+  // The proposal should contain only the release commit.
+  commitList = '';
 } else {
   // We can't assume the Commits section is the one for this release in case of
   // a release to transition to LTS (i.e. with no commits).
Repository: facebook/react
Pull request: [eslint-plugin-react-hooks] Inline meta fields


rollup doesn't inline cjs requires (although it can with an external plugin), so requiring package.json was causing issues internally at Meta since that file doesn't exist there.

We could teach our build scripts to do so but given that the eslint meta field is optional anyways I opted to just hardcode the name and omit the version.


Changed files:
filename: packages/eslint-plugin-react-hooks/src/index.js
patch: @@ -10,8 +10,6 @@
 import RulesOfHooks from './RulesOfHooks';
 import ExhaustiveDeps from './ExhaustiveDeps';
 
-const {name, version} = require('../package.json');
-
 // All rules
 export const rules = {
   'rules-of-hooks': RulesOfHooks,
@@ -32,7 +30,7 @@ const legacyRecommendedConfig = {
 
 // Base plugin object
 const reactHooksPlugin = {
-  meta: {name, version},
+  meta: {name: 'eslint-plugin-react-hooks'},
   rules,
 };
Repository: huggingface/transformers
Pull request: misc don't recreate it

# What does this PR do?

Typo for misc warning

Changed files:
filename: src/transformers/core_model_loading.py
patch: @@ -317,8 +317,8 @@ def convert(
         config=None,
         hf_quantizer=None,
         missing_keys: Optional[MutableSet[str]] = None,
+        misc: Optional[MutableMapping[str, str]] = None,
     ):
-        misc = {}
         for pattern, futures in self.collected_tensors.items():
             self.collected_tensors[pattern] = [future.result() for future in futures]
 
@@ -358,8 +358,8 @@ def convert(
         config=None,
         hf_quantizer=None,
         missing_keys: Optional[MutableSet[str]] = None,
+        misc: Optional[MutableMapping[str, str]] = None,
     ):
-        misc = {}
         for pattern, futures in self.collected_tensors.items():
             self.collected_tensors[pattern] = [future.result() for future in futures]
 
@@ -782,6 +782,7 @@ def convert_and_load_state_dict_in_model(
                     config=model.config,
                     hf_quantizer=hf_quantizer,
                     missing_keys=missing_keys,
+                    misc=misc,
                 )
                 for target_name, param in realized_value.items():
                     param = param[0] if isinstance(param, list) else param