sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: filename literal string type
Labels: Suggestion,In Discussion

# Suggestion

## 🔍 Search Terms

- `import`
- `meta`
- `url`
- `__filename`
- `__dirname`

## ✅ Viability Checklist

My suggestion meets these guidelines:

* [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
* [x] This wouldn't change the runtime behavior of existing JavaScript code
* [x] This could be implemented without emitting different JS based on the types of the expressions
* [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
* [x] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).

## ⭐ Suggestion

Provide current filename (relative to current `--project`) as a type

```
tsconfig.json
path/to/file.ts
```

```ts
// path/to/file.ts
function assert(value: "path/to/file.ts") {}
declare var filename: __FILENAME_TYPE__
assert(filename)
```

> Note: `__FILENAME_TYPE__` is a placeholder for whatever makes most sense.

This should be separate from `__filename` (which is an absolute path that can change depending on the location of a typescript project) and `import.meta.url` which is a fully qualified URL and may also change at runtime.

## 📃 Motivating Example

An increasing number of web frameworks are using file system paths as a router with `$parameters.tsx` and such: Next, Gatsby, Remix, Nuxt, etc

```
/pages/
  index.ts     -> /
  /nested/
    index.ts   -> /nested
    $param.ts  -> /nested/:param
```

With the addition of `` `template literal ${types}` `` people are now parsing out parameters from runtime routers. 

```ts
router.get("/path/to/:name", (req) => {
  let name: string = req.params.name // (no any)
})
```

If the current filename was accessible in typescript, you could strictly type path segments without repeating the path name

```ts
// path/to/$name.tsx
import type { Params } from "framework"

export default function renderPage(params: Params<__FILENAME_TYPE__>) {
  let name: string = req.params.name // (no any)
}
```
Repository: TypeScript
Issue: Duplicate auto-import suggestions
Labels: Bug,Help Wanted,Domain: Auto-import

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
- VS Code Version: 1.53.2
- OS Version: Windows 10 x64 19042.804

Steps to Reproduce:

1. `yarn create react-app client --template typescript`
2. `cd client && yarn add react-bootstrap`

<!-- 🔧 Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes

<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported direct to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->

![image](https://user-images.githubusercontent.com/77069043/109523718-55622a80-7ab8-11eb-89a6-3c23ca17f1c5.png)
![image](https://user-images.githubusercontent.com/77069043/109523809-6f037200-7ab8-11eb-9f36-41a2ef31ab52.png)
Repository: TypeScript
Issue: generic type interface with template literal string wrong generate implemented function
Labels: Bug,Help Wanted

*TS Template added by @mjbvz*

**TypeScript Version**: 4.3.0-dev.20210228

**Search Terms**
- implement interface
- quick fix

---

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
- VS Code Version: 1.53.2
- OS Version: Darwin x64 19.6.0
- typescript version: 4.1.5

Steps to Reproduce:

i make generic type interface with template literal string, and i use implements this type in class.
but vscode quick auto make interface feature wrong work. please look below screenshot.

![image](https://user-images.githubusercontent.com/7166022/109411356-d4862e80-79e4-11eb-80bf-0a8d51e4db6d.png)

i expect when i use implements interface and auto make interface function, setName(arg: string), setAddress(arg: number) maked . but in present name: (arg: string) and address: (arg:number) maked. so make type error in vscode...

![image](https://user-images.githubusercontent.com/7166022/109411469-b3720d80-79e5-11eb-9f61-d96ebdfc7e70.png)

but when i make this function myself, not make type error in vscode... 

why generate implement function code wrong work with template literal string?

1. 
2.

<!-- 🔧 Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes

<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported direct to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->
Repository: rust
Issue: Tracking Issue for built-in attribute macro `#[cfg_eval]`
Labels: A-attributes,T-libs-api,C-tracking-issue,A-proc-macros

Feature gate: `#![feature(cfg_eval)]`

This is a tracking issue for built-in attribute macro `#[cfg_eval]` that is used for eagerly expanding all `#[cfg]` and `#[cfg_attr]` attributes in its input ("fully configuring" the input).
The effect is identical to effect of `#[derive(Foo, Bar)]` which also fully configures its input before passing it to macros `Foo` and `Bar`.

### Public API

```rust
#[cfg_eval]
#[my_attr] // Receives `struct S {}` as input, the field is configured away by `#[cfg_eval]`
struct S {
    #[cfg(FALSE)]
    field: u8,
}
```

### Steps / History

- [x] Implementation: https://github.com/rust-lang/rust/pull/82682
- [ ] Final commenting period (FCP)
- [ ] Stabilization PR

### Unresolved Questions

- None yet.
Repository: TypeScript
Issue: Type alias printing regressed in TypeScript 4.2.2
Labels: Bug

# Bug Report

<!--
  Please fill in each section completely. Thank you!
-->

### 🔎 Search Terms

preserve type alias

### 🕗 Version & Regression Information

- This changed between versions 4.1.5 and 4.2.2

### ⏯ Playground Link

[Playground link with relevant code](https://www.typescriptlang.org/play?ts=4.2.2#code/C4TwDgpgBAQgTgQwHYBMA8BpANFAKgPigF4oMoAyKAbygH1aAjRVALjygF8BuAKB9EixmKCCgCqSANZIA9gHckaAsSHJ0AIgCuU2QvU4CvAdACyCEAwhLCJXFAA+q1KInT5iw3wDGAGwQBnfygAMRkZah4oKKgwTQYfAEsvKDgIBBQZJB8QKABbc0s2MwsrBjCfNKRCR20RADMEpFFeDj4RXwRUqC9M-2AoOrC2UJleHh6kPqhgCCmSKkjosDgZMDZBmQA6fJKHRzqEH38ILEWogHpzqAgAD0gvGZQigtLyyvwzqEuoAHMZYDY0SiZRkFWQDicInEOncaBBYKqUB4rSAA)

### 💻 Code

<!-- Please post the relevant code sample here as well-->
```ts
type Brand<K, T> = K & { __brand: T };

type BrandedUnknown<T> = Brand<"unknown", T>;
type Maybe<T> = T | BrandedUnknown<T>;

class Foo {
    public readonly maybe: Maybe<boolean> | undefined;
}

declare const foo: Foo;
const test = {
    prop: foo.maybe || false,
    // 4.1.5 (good): Maybe<boolean>
    // 4.2.2  (bad): boolean | BrandedUnknown<boolean> 
}
```

### 🙁 Actual behavior

`test.prop` has type `boolean | BrandedUnknown<boolean>` which lost the connection to `Maybe<boolean>`

### 🙂 Expected behavior

`test.prop` should have type `Maybe<boolean>` like in previous versions.
Repository: flutter
Issue: Make .last_build_id assemble file hidden on macOS
Labels: tool,platform-mac,c: proposal,P3,team-tool,triaged-tool

https://github.com/flutter/flutter/issues/76958 reported an iOS App Store validation error because of an errant `Runner.app/Frameworks/.last_build_id` file in the archive bundle.  That file is generated by the assemble build system to track when targets can be skipped.  That particular issue will be fixed with https://github.com/flutter/flutter/pull/77007 but it would be nice to support the bundle directories as assemble output directories.

1. Validate making `.last_build_id` a hidden file avoids validation issues.
2. If so, make `.last_build_id` hidden when written by setting the `com.apple.FinderInfo` extended attribute to 32.  The `com.apple.FinderInfo` attribute requires a 32-byte block, so it looks like:
```
xattr -wx com.apple.FinderInfo 2020202020202020401000000000000000000000000000000000000000000000 .last_build_id
```
See `man getattrlist` `ATTR_CMN_FNDRINFO` for info.
Repository: flutter
Issue: [Web] [CanvasKit][Feature Request]: Load fonts as soon as detecting browser locale
Labels: a: text input,c: new feature,a: internationalization,a: typography,platform-web,c: proposal,c: rendering,e: web_canvaskit,P2,team-web,triaged-web

Currently, when I am testing the TexField I saw a weird effect. Below is the demo (web application).

![demo1](https://user-images.githubusercontent.com/44708790/108788895-f4b48880-75b3-11eb-813d-c6a4db59e6bc.gif)

As you can see, initially when you typed in the Chinese character, it will show the gibberish character first then render the correct Chinese character. After the first try, it works kinda fine afterward. But sometimes you can still see the gibberish character interchangeably. However, I am not sure if this is the nature of how it is... but to me, something seems wrong here.

Here is another demo for Japanese!

![demo2_jp](https://user-images.githubusercontent.com/44708790/108790134-ee73db80-75b6-11eb-94ea-045535c072d4.gif)


Based on @yjbanov commented in #76473, it might be flutter loading fonts dynamically. Flutter detects that it doesn't have enough fonts and that is likely the reason. 

<details>
<summary>flutter doctor -v</summary>

```
[√] Flutter (Channel beta, 1.26.0-17.6.pre, on Microsoft Windows [Version 10.0.19041.804], locale zh-TW)
    • Flutter version 1.26.0-17.6.pre at D:\flutterdevelopment\flutter     
    • Framework revision a29104a69b (5 days ago), 2021-02-16 09:26:56 -0800
    • Engine revision 21fa8bb99e
    • Dart version 2.12.0 (build 2.12.0-259.12.beta)

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2) 
    • Android SDK at D:\androidsdk
    • Platform android-30, build-tools 30.0.2
    • ANDROID_SDK_ROOT = D:\androidsdk
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java       
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe      

[√] Android Studio (version 4.1.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code (version 1.53.2)
    • Flutter extension version 3.19.0

[√] Connected device (2 available)
    • Chrome (web) • chrome • web-javascript • Google Chrome 88.0.4324.182
    • Edge (web)   • edge   • web-javascript • Microsoft Edge 88.0.705.56

```
</details>

_Originally posted by @AscentionOne in https://github.com/flutter/flutter/issues/76473#issuecomment-783794373_
Repository: terminal
Issue: Make FontFace ComboBox editable
Labels: Product-Terminal,Issue-Task,Area-SettingsUI

If it were an Editable ComboBox, that makes it the best of both worlds.

You could also present a text warning, if the FontName read from the JSON, does not match a font available to use.

_Originally posted by @mdtauk in https://github.com/microsoft/terminal/issues/9275#issuecomment-788341048_

In a world where #9275 merged, it would be nice to make the ComboBox editable. But we need some kind of validation system in place to do that. This issue tracks doing all of that work.
Repository: pytorch
Issue: [NNC] Simplify after each transformation
Labels: triaged,NNC

`IRSimplifier::simplify()` is used to simplify NNC IR. Currently, this is not applied uniformly. Ideally, this simplification should be done after every transformation. 

One challenge with this is that several transform APIs in `LoopNest` return `For*`. But the result of `simplify` may not be a `For` (say, if it had only one iteration left). 

We need to figure out an approach to perform simplification uniformly.
Repository: youtube-dl
Issue: Clarify meaning of "best" video quality (bitrate vs. framerate) in readme
Labels: request

<!--

######################################################################
  WARNING!
  IGNORING THE FOLLOWING TEMPLATE WILL RESULT IN ISSUE CLOSED AS INCOMPLETE
######################################################################

-->


## Checklist

<!--
Carefully read and work through this check list in order to prevent the most common mistakes and misuse of youtube-dl:
- First of, make sure you are using the latest version of youtube-dl. Run `youtube-dl --version` and ensure your version is 2021.03.02. If it's not, see https://yt-dl.org/update on how to update. Issues with outdated version will be REJECTED.
- Search the bugtracker for similar feature requests: http://yt-dl.org/search-issues. DO NOT post duplicates.
- Finally, put x into all relevant boxes (like this [x])
-->

- [X] I'm reporting a feature request
- [X] I've verified that I'm running youtube-dl version **2021.03.02**
- [X] I've searched the bugtracker for similar feature requests including closed ones


## Description

<!--
Provide an explanation of your issue in an arbitrary form. Please make sure the description is worded well enough to be understood, see https://github.com/ytdl-org/youtube-dl#is-the-description-of-the-issue-itself-sufficient. Provide any additional information, suggested solution and as much context and examples as possible.
-->

In #20926, a developer states that, if a 30-Hz video has higher bitrate than a 60-Hz video, it is "expected behavior" that the 30-Hz video will be chosen as "best". (The code that defines this choice appears to be at the bottom of [`_formats_key()`](https://github.com/ytdl-org/youtube-dl/blob/8f56907afa693290a6b2e05fb7ffc2f15dca33e2/youtube_dl/extractor/common.py#L1375).) However, for some users (e. g., me) this is unexpected behavior. It would be helpful if it were explicitly stated in the readme that "best" quality considers bitrate more important than framerate.

It also might be helpful to add an option that makes framerate more important than bitrate in the determination of which video is "best"--though, of course, users can emulate this behavior themselves with format selection.
Repository: storybook
Issue: Args: Support dynamic PropTypes
Labels: feature request,react,addon: docs,args,addon: controls,block: argstable

## What

Inspect a component's runtime propTypes to determine what to show in its ArgsTable

## Why

Currently, Storybook extracts ArgTypes for JS React components using [react-docgen](https://github.com/reactjs/react-docgen). React-docgen performs a file-by-file static analysis of your components. This is efficient, generally well-supported, and is able to pull out things like JSDoc comments from the source code. However, it has a couple issues:
- PropTypes can be functions, and these are difficult to analyze statically
- PropTypes can be defined in separate files, and these are currently unsupported

By inspecting the runtime propTypes of a component and using this as a fallback (or combining it with the docgen?) we can overcome some of these problems.

We chose not to do this in the original implementation because it can easily obscure issues in the docgen setup. However, in practice many users want it, so we should consider adding this as part of React's ArgType extraction.

## User story

```
As a component developer,
I want Storybook to automatically dynamic PropTypes
So that I don't need to manually document them
```

## Related issues

#13252 #12798 #12816
Repository: node
Issue: How to cache wasm module in nodejs, or it's already cached on startup ?
Labels: wasm

according to this  https://github.com/rustwasm/wasm-bindgen/issues/2473

### Summary
I created comparison between manual javascript haversine function, and wasm based.
the result if i compared including the module initialization, wasm based getting much slower than javascript itself.

### Additional Details
```javascript
console.time("manual")
const haversinee = require("../func/haversine")
const src = {
    lat: -7.0,
    lng: 7.0
}

const dst = {
    lat: -8.0,
    lng: 8.0
}
console.log("manual js : "+ haversinee(src, dst, false))
console.timeEnd("manual")

console.time("wasm")
const {Point, haversine} = require("haversinecalc") // this is the problem

const src_p = new Point(-7.0,7.0)
const dst_p = new Point(-8.0,8.0)

console.log("using wasm : "+ haversine(src_p, dst_p))
console.timeEnd("wasm")
```
## Result with module initialization included

```bash
manual js : 156581.10278754708
manual: 12.337ms
using wasm : 156581.10278754708
wasm: 18.109ms
```
## Result without module initialization

```bash
manual js : 156581.10278754708
manual: 7.709ms
using wasm : 156581.10278754708
wasm: 0.287ms
```
Repository: rust
Issue: Tracking Issue for `-Z normalize-docs`
Labels: T-rustdoc,A-associated-items,C-tracking-issue,S-tracking-impl-incomplete,S-tracking-design-concerns,-Znormalize-docs

<!--
NOTE: For library features, please use the "Library Tracking Issue" template instead.

Thank you for creating a tracking issue! 📜 Tracking issues are for tracking a
feature from implementation to stabilisation. Make sure to include the relevant
RFC for the feature if it has one. Otherwise provide a short summary of the
feature and link any relevant PRs or issues, and remove any sections that are
not relevant to the feature.

Remember to add team labels to the tracking issue.
For a language team feature, this would e.g., be `T-lang`.
Such a feature should also be labeled with e.g., `F-my_feature`.
This label is used to associate issues (e.g., bugs and design questions) to the feature.
-->

This is a tracking issue for the rustdoc feature `-Z normalize-docs`. This normalizes projections like `<Vec<T> as IntoIterator>::IntoIter` to `std::vec::IntoIter<T>` in the generated documentation.

### About tracking issues

Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however *not* meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.

### Steps
<!--
Include each step required to complete the feature. Typically this is a PR
implementing a feature, followed by a PR that stabilises the feature. However
for larger features an implementation could be broken up into multiple PRs.
-->

- [x] Implement the features (https://github.com/rust-lang/rust/pull/77467)
- [ ] Fix the bugs blocking stabilization (https://github.com/rust-lang/rust/issues/81091)
  - [x] Cycles in trait bounds should be recoverable (https://github.com/rust-lang/rust/issues/79459): https://github.com/rust-lang/rust/pull/102037
  - [ ] Recursion limit errors in trait bounds should be recoverable (https://github.com/rust-lang/rust/issues/79506)
- [ ] Stabilization PR ([see instructions on rustc-dev-guide][stabilization-guide])

[stabilization-guide]: https://rustc-dev-guide.rust-lang.org/stabilization_guide.html#stabilization-pr
[doc-guide]: https://rustc-dev-guide.rust-lang.org/stabilization_guide.html#documentation-prs

### Unresolved Questions
<!--
Include any open questions that need to be answered before the feature can be
stabilised.
-->

No unresolved questions known, this is "just hard".

### Implementation history

- initial impl: https://github.com/rust-lang/rust/pull/77467
- reverted due to breakage: https://github.com/rust-lang/rust/pull/79469
- re-added as unstable: https://github.com/rust-lang/rust/pull/79525
Repository: neovim
Issue: on_bytes not triggered on second half of Join
Labels: bug

While working on https://github.com/neovim/neovim/pull/13979 I noticed some strange behavior.

### Actual behaviour
When calling `Join` on the second line of
```rust
fn main() {
    println!("Hello, world!");
}
```

on_bytes is only triggered once, what is received for the change that ultimately results in (note the space after the semicolon):

```rust
fn main() {
    println!("Hello, world!"); }
```
is the following (single) notification. Note the state of the line after on_bytes has been called does not include the space.

```
{
  byte_offset = 42,
  lines = { '    println!("Hello, world!");' },
  new_end_byte_length = 1,
  new_end_column = 1,
  new_end_row = 0,
  old_end_byte_length = 1,
  old_end_column = 0,
  old_end_row = 1,
  start_column = 30,
  start_row = 1,
}
```

The missing space is causing offset errors when I try to use on_bytes to send the updates to the language server client
Repository: pytorch
Issue: 'Tensor' object has no attribute 'astype'
Labels: triaged,module: numpy,function request

## ❓ Questions and Help

### Please note that this issue tracker is not a help form and this issue will be closed.

We have a set of [listed resources available on the website](https://pytorch.org/resources). Our primary means of support is our discussion forum:

- [Discussion Forum](https://discuss.pytorch.org/)

Hi im trying convert pytorch trained model to coreml and while converting i am struct with this issue.
torch = 1.7.1
torchvision = 0.8.2
coremltools = 4.1

Kindly help me in this regard
<img width="1009" alt="Screenshot 2021-03-01 at 10 24 01 PM" src="https://user-images.githubusercontent.com/78093537/109605382-17faad00-7b4b-11eb-82fb-a2b848d5d918.png">



cc @mruberry @rgommers @heitorschueroff
Repository: TypeScript
Issue: Enum is not assignable to type string
Labels: Suggestion,In Discussion

# Bug Report

Strings in an Enum form are not assignable to fields that require type string.

### 🔎 Search Terms

- Enum as a string parameter
- Enum is not assignable to type string
- TS2322

### 🕗 Version & Regression Information

- This is the behavior between versions `4.1.15` and `4.2.2`.

### ⏯ Playground Link

<!--
  A link to a TypeScript Playground "Share" link which shows this behavior

  The TypeScript Workbench can be used for more complex setups, try
  https://www.typescriptlang.org/dev/bug-workbench/

  As a last resort, you can link to a repo, but these will be slower for us to investigate.
-->
[Playground link with relevant code](https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAJQKYEMDG8BmUIjgcilQ3wChSkA7AVzwGEJLNgBzOAb1Lm7gDkUQSOAF4CAFQDK+ADRceAdWAATGAAsRcAEwAGbbJ5wAEklar4ondtIBfckgAekWHCVJMKagBss1ShmCMcACi9gJgnkgAFACUnAZEMNRQlHAAPErAAG5wysLsDEysAHT8gtYAfKkA9BmZ5TZAA)

### 💻 Code

```TypeScript
import React from 'react'

enum Config {
    Name = 'TS',
    Width = 200,
    Height = 200
}

export default function Example(){
    return <div id={Config.Name}></div>
}
```

### 🙁 Actual behavior

The terminal is complaining with the following message:

```
Type 'Config' is not assignable to type 'string | undefined'.
```

### 🙂 Expected behavior

Code works without the error message.