profile
viewpoint

apple/swift 51829

The Swift Programming Language

apple/swift-evolution 11155

This maintains proposals for changes and user-visible enhancements to the Swift Programming Language.

apple/swift-package-manager 7754

The Package Manager for the Swift Programming Language

apple/swift-corelibs-foundation 3888

The Foundation Project, providing core utilities, internationalization, and OS independence

cruise-automation/webviz 848

web-based visualization libraries

apple/swift-corelibs-xctest 822

The XCTest Project, A Swift core library for providing unit test support

apple/swift-llbuild 771

A low-level build system, used by Xcode and the Swift Package Manager

apple/swift-lldb 643

This is the version of LLDB that supports the Swift programming language & REPL.

Pull request review commentmicrosoft/TypeScript

Code fix for accidental calls to get-accessors

+/* @internal */
+namespace ts.codefix {
+    const fixId = "removeAccidentalCallParentheses";
+    const errorCodes = [
+        Diagnostics.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without.code,
+    ];
+    registerCodeFix({
+        errorCodes,
+        getCodeActions(context) {
+            const callExpression = findAncestor(getTokenAtPosition(context.sourceFile, context.span.start), isCallExpression);
+            if (!callExpression) {
+                return undefined;
+            }
+            const changes = textChanges.ChangeTracker.with(context, t => {
+                t.deleteNodeRange(context.sourceFile, callExpression.openParenToken, callExpression.closeParenToken);

Good idea, I didn't think of that!

jtbandes

comment created time in a few seconds

push eventjtbandes/TypeScript

Alexander T

commit sha 6e98431cecdd5304cbd082ed577e0155634cdd24

fix(23716): show generic type in tagged template expression

view details

Swapnil Satish Shinde

commit sha 69769ab670ef4cc07c4818fb2e12ba22897c5f1b

Delete .gitmodules

view details

Daniel Rosenwasser

commit sha 6128f30c3b8e86d5a0686a34a734080442f6c836

Merge pull request #38821 from a-tarasyuk/bug/23716 fix(23716): signature help of tagged template doesn't show instantiated signature

view details

Daniel Rosenwasser

commit sha d45f0d0c9fb933d49a01d41eaa465940cfd78be0

Merge pull request #38783 from Swap76/master Delete .gitmodules

view details

Jacob Bandes-Storch

commit sha 7b9d7f02d4348003f836d1670d2301bc55b79931

Merge remote-tracking branch 'upstream/master' into fix-accidental-accessor-call

view details

push time in 3 days

push eventjtbandes/TypeScript

Nathan Shively-Sanders

commit sha 3ffe25316682ab1c95a1d9fef56d9dbcb5a2453c

Always error when property overrides accessor or vice versa Previously this was only an error when useDefineForClassFields: true, but now it's an error for all code. This is a rare mistake to make, and usually only occurs in code written before `readonly` was available. Codefix to come in subsequent commits.

view details

Nathan Shively-Sanders

commit sha 71b7695113e470c665f9258da903466f1eded348

add fourslash tests for codefix

view details

Nathan Shively-Sanders

commit sha e287c8321aac8fc2a59172d9e6153791f633f44f

Codefix invokes generate get-set accessor refactor 1. Add add-all test 2. Add codefix that delegates to get-set accessor refactor. Needs massive amounts of cleanup and deduplication.

view details

Nathan Shively-Sanders

commit sha 3030cd8eff237c00e2e6f9b433973c35d7120bf7

refactoring done except for deduping

view details

Nathan Shively-Sanders

commit sha 6eacc9c1e2835f9c18996a1c3c6d896fbcc762c9

move into new, centrally (?) located file

view details

Nathan Shively-Sanders

commit sha 3428e275e66eda357a1a94b33be1a7c1929a0f2c

Reorder tsconfig and move one more function

view details

Nathan Shively-Sanders

commit sha 4d541d2b7430d4a6e85c9191654a8d83fd3d2019

Minor cleanup 1. Fix lint. 2. Make code easier to read. 3. Turns some asserts into bails instead.

view details

Josh Goldberg

commit sha b14b231d267e5cf3208d19540974ca8e6f73fb74

Report primitive type in literal-to-primitive relation complaints

view details

Josh Goldberg

commit sha af4ea605f214aac0e526dbba9e2a5086e50dde39

Fixed a couple of tsserver unit tests

view details

Josh Goldberg

commit sha 769a2f2cfc234cc4c83cd36532fb0cbcb14df113

Eased up on some of the more aggressive reporting changes

view details

Josh Goldberg

commit sha cb19b3d251d83989c7056ff161163b9c965adb7a

Again fixed up manual unit tests

view details

Josh Goldberg

commit sha 1b3c7a28c1883cc76f17fc3c2cc291a2cf1ebd1b

This had better be the last unit test fix...

view details

Josh Goldberg

commit sha 035b9ac1c16e88ef1b508b018476769d0237f0f1

Lint fix

view details

Josh Goldberg

commit sha d12b741004bf4cea14875328e605a70a290e41bf

Excluded type unions from the generale source types

view details

Josh Goldberg

commit sha 99cdb64839afd3a21faf01c3b45e4a2ef2738e4a

Used DH's suggested heuristic

view details

Josh Goldberg

commit sha d4825ab90fe2d13a66450d71a1b2d190413d114f

I did everything you said I followed all the rules

view details

kingwl

commit sha 6f4deaea7893880d2eef2029d43e6796b1551fdf

Fix tranced es5 classes after new scope

view details

Nathan Shively-Sanders

commit sha 802e87b1eb2b7f115908a66f2ec4a015d8dd8319

Merge branch 'master' into always-error-on-property-override-accessor

view details

Daniel

commit sha 8cf2466110690dd32a20e5c2452d817fe8e7e67b

Merge remote-tracking branch 'origin/master' into literal-to-primitive-relation-reporting

view details

Daniel

commit sha a04ecb592c91c1b68e4893174ae420f21a6f3492

Check constraints deeply on singleton types.

view details

push time in 3 days

delete branch cruise-automation/webviz

delete branch : hernan/gltext_glyph_descent

delete time in 4 days

delete branch jtbandes/TypeScript

delete branch : diagnose-accidental-accessor-call

delete time in 8 days

PR opened microsoft/TypeScript

Code fix for accidental calls to get-accessors

Backlog bug: #24554 This is a follow-up to #37800 which adds a code fix associated with the new error message. cc @sandersn for review :)

The cleanest way I found to implement this was updating the parser to keep references to the open/close paren tokens. Unfortunately I wasn't able to make forEachChild handle these properly, (see commit history in this branch) so I just skip these nodes. Let me know if there's a better way!

 class Test24554 {
     get property(): number { return 1; }
 }
 function test24554(x: Test24554) {
-    return x.property();
+    return x.property;
 }
 function test_2(x: { y: Test24554 }) {
-    return x.y.property ( /* bye */ );
+    return x.y.property;
 }
+103 -8

0 comment

9 changed files

pr created time in 8 days

push eventjtbandes/TypeScript

Nathan Shively-Sanders

commit sha 5f46d42ad111e8cfc689b47c0532b120d42d2698

Error on missing BigInt in es2020 (#37899) * Error on missing BigInt in ES2020 too. Previously it was only on ESNext, but bigint ships in ES 2020. There are no tests for this; passing `false` doesn't cause any tests to fail at least. * add tests

view details

Alexander T

commit sha a8e1ad4e6204b919d82d453a94238c1808fae14f

fix(37781): import missing argument types for a new method (#37857)

view details

Wesley Wigham

commit sha 141ee01c8cd5e04a69b66db7e8d3da6da13c7499

Retain imports in declaration emit if they augment an export of the importing file (#37820) * Retain imports in declaration emit if they augment an export of the importing file * (sp) * Check that a merge occurs, just because

view details

Pierre-Antoine Mills

commit sha eb569a5c74720b55ad30e109f635ebf0060ac7f9

chore(ts-toolbelt): remove deprecated test (#37932)

view details

Wesley Wigham

commit sha 6a5508b34356438f3c470cd486bffb6473a1d47e

Update __exportStar helper to skip default and __esModule members (#37236) * Update __exportStar helper to skip default and __esModule * Accept new baselines * Remove esmodule check from helper

view details

TypeScript Bot

commit sha cede6ef30ebf674583c71ba5b201b750d1630f46

Update user baselines (#37935) Co-authored-by: typescript-bot <typescript@microsoft.com>

view details

Wesley Wigham

commit sha 8dd6b3a389255d5b09d4f6ec259631395ac44893

Accept recent tests with updated baseline code (#37945)

view details

Wesley Wigham

commit sha edd4e0a42bc8bb124aab11ff89f42d72689faf4f

Add fastpath to isRelatedTo for type references (#37481) * Add fastpath to isRelatedTo for type references * Do not check intersections or unions to ignore propegating reference flags, properly set comparing jsx flag * Re-remove unneeded check * Just check for TypeFlags.Object * Remove else clause

view details

Ashley Claymore

commit sha 4538640d8a99ff0f6044479462ae844abb69e910

Added error when Enum member initaliser references itself (#34655) Fixes #34606

view details

csigs

commit sha 49f5fbb2c76309cd17a7aba0f0663705e2239ff9

LEGO: check in for master to temporary branch.

view details

csigs

commit sha 04069db8467ea71d70c0eb0e1e432cb38d016ab0

LEGO: Merge pull request 37969 LEGO: Merge pull request 37969

view details

csigs

commit sha e505c79091cfd5729f5ef54b50711ffcbbfe5aa3

LEGO: check in for master to temporary branch.

view details

csigs

commit sha 15c3e99cbd315629e8c2c1444ea879a75aa22d8a

LEGO: Merge pull request 37976 LEGO: Merge pull request 37976

view details

Anders Hejlsberg

commit sha 92cd3ae299df987083f2f2c15f088bf97f7d1c24

No iteration type errors during CFA (#37965) * No iteration type errors during CFA * Add regression test

view details

okmttdhr

commit sha 06e05f25e18998beb47bdae3e545ed8eb2de0331

Improve error message for computed enums (#37790) * Add error message for computed enums * Add test case for computed enums * Accept baselines * Fix returned value when error

view details

Joe Previte

commit sha 583e70b3d1aeb752090ccba9477bde6b769d4c24

fix(refactor): keep comments after refactor (#35937) * add two tests: Refactor: Remove braces from arrow function * refactor: simplify test and add another test * fix: copyTrailingAsLeadingComments in addOrRemoveBracesToArrowFunction * test: add additional test * fix: clean up changes * fix: add check for newEdit * fix: add function for semi colon modifier * feat: grab all comments during refactor * refactor: update addOrRemoveBraces logic * fix: remove duplicate function call * Update src/services/refactors/addOrRemoveBracesToArrowFunction.ts * remove blank line remove blank line Co-authored-by: Jesse Trinity <42591254+jessetrinity@users.noreply.github.com>

view details

Nathan Shively-Sanders

commit sha 6fbaeeb42f7e4fbf3a0c19c4ea5b1821393581c5

Typo at Uint8Array[Symbol.toStringTag] (#37989) * Update es2015.symbol.wellknown.d.ts * Update baselines Co-authored-by: sirian <sirianru@gmail.com>

view details

Alexander T

commit sha a16c44180a921e9f4b18fa275d3cba6f3f69c97a

fix(37940): add space after parameter decorator (#37959)

view details

Wesley Wigham

commit sha cdc384006c96720654297488abbd91e854f99950

Fix crash on declaration emit for globalThis (#37992)

view details

TypeScript Bot

commit sha ca1f4672339aefacbf494484d4b3451077dc6400

Update user baselines (#37946) Co-authored-by: typescript-bot <typescript@microsoft.com>

view details

push time in 8 days

PR closed jtbandes/TypeScript

Code fix for accidental accessor calls

Follow up to microsoft/TypeScript#37800 <!-- Thank you for submitting a pull request!

Please verify that:

  • [ ] There is an associated issue in the Backlog milestone (required)
  • [ ] Code is up-to-date with the master branch
  • [ ] You've successfully run gulp runtests locally
  • [ ] There are new or updated unit tests validating the change

Refer to CONTRIBUTING.MD for more details. https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md -->

+1332 -1359

0 comment

126 changed files

jtbandes

pr closed time in 8 days

pull request commentmicrosoft/TypeScript

Better error message for accidental calls to get-accessors

Great, thanks! I will send out another PR for the code fix in the near future.

jtbandes

comment created time in 11 days

pull request commentcruise-automation/webviz

Avoid duplicating position buffer during line rendering

If it works, looks great!

hhsaez

comment created time in 12 days

pull request commentcompiler-explorer/compiler-explorer

Add libuv to C & C++ libraries

Ok, thanks! Where can I follow the status of the linking support? Is any help needed?

jtbandes

comment created time in 12 days

delete branch cruise-automation/webviz

delete branch : update-readme-with-autobuild

delete time in 13 days

PR opened compiler-explorer/compiler-explorer

Reviewers
Add libuv to C & C++ libraries

<!-- THIS COMMENT IS INVISIBLE IN THE FINAL PR, BUT FEEL FREE TO REMOVE IT Thanks for taking the time to improve CE. We really appreciate it. Before opening the PR, please make sure that the tests & linter pass their checks, by running make check. In the best case scenario, you are also adding tests to back up your changes, but don't sweat it if you don't. We can discuss them at a later date. Feel free to append your name to the CONTRIBUTORS.md file Thanks again, we really appreciate this! -->

Not sure if I'm doing this right — feedback welcome! How do I test this locally? Depends on https://github.com/compiler-explorer/infra/pull/350.

+16 -2

0 comment

2 changed files

pr created time in 15 days

push eventjtbandes/compiler-explorer

Jacob Bandes-Storch

commit sha d5ff0f31abd1d30b65e97172520cc9622caa8bc6

Add libuv to C++ libraries

view details

push time in 15 days

push eventjtbandes/compiler-explorer

Jacob Bandes-Storch

commit sha b7eae2a9dbecf87377884f7ed632c06e65af879a

Add libuv to C libraries

view details

push time in 15 days

fork jtbandes/compiler-explorer

Run compilers interactively from your web browser and interact with the assembly

https://godbolt.org/

fork in 15 days

push eventjtbandes/infra

Jacob Bandes-Storch

commit sha 71f796292d8c861d2794866f30cb157b34c38577

check_file: include/uv.h

view details

push time in 15 days

PR opened compiler-explorer/infra

Add libuv to libraries.yaml

Hi! I'm interested in adding libuv to the available C and C++ libraries.

I found an old comment that said "We don't link against libraries when we build", but based on the other available libs I'm guessing this is no longer true? Is there a way for me to test this change locally? I didn't really see any documentation about it, just found this file :)

+7 -0

0 comment

1 changed file

pr created time in 15 days

push eventjtbandes/infra

Jacob Bandes-Storch

commit sha 69a1d743bc74f2e896252e02554b9c1e4144fd56

Add libuv to libraries.yaml

view details

push time in 15 days

fork jtbandes/infra

Infrastructure to set up the public Compiler Explorer instances and compilers

https://godbolt.org/

fork in 15 days

issue commentcruise-automation/webviz

webviz won't connect to robot?

What errors are you seeing?

bumblebeerobotics

comment created time in 22 days

pull request commentmicrosoft/TypeScript

Better error message for accidental calls to get-accessors

Ping @sandersn 🙌 (Not really in a hurry, I'm sure you are quite busy — just want to avoid falling through the cracks!)

jtbandes

comment created time in a month

pull request commentmicrosoft/TypeScript

Better error message for accidental calls to get-accessors

Alright, I've moved the changes into invocationErrorDetails and removed the related info. (Considered keeping it but the code flow around chains vs related info is already convoluted and I didn't want to make it worse.) Let me know what you think!

jtbandes

comment created time in a month

push eventjtbandes/TypeScript

Nathan Shively-Sanders

commit sha 5f46d42ad111e8cfc689b47c0532b120d42d2698

Error on missing BigInt in es2020 (#37899) * Error on missing BigInt in ES2020 too. Previously it was only on ESNext, but bigint ships in ES 2020. There are no tests for this; passing `false` doesn't cause any tests to fail at least. * add tests

view details

Alexander T

commit sha a8e1ad4e6204b919d82d453a94238c1808fae14f

fix(37781): import missing argument types for a new method (#37857)

view details

Wesley Wigham

commit sha 141ee01c8cd5e04a69b66db7e8d3da6da13c7499

Retain imports in declaration emit if they augment an export of the importing file (#37820) * Retain imports in declaration emit if they augment an export of the importing file * (sp) * Check that a merge occurs, just because

view details

Pierre-Antoine Mills

commit sha eb569a5c74720b55ad30e109f635ebf0060ac7f9

chore(ts-toolbelt): remove deprecated test (#37932)

view details

Wesley Wigham

commit sha 6a5508b34356438f3c470cd486bffb6473a1d47e

Update __exportStar helper to skip default and __esModule members (#37236) * Update __exportStar helper to skip default and __esModule * Accept new baselines * Remove esmodule check from helper

view details

TypeScript Bot

commit sha cede6ef30ebf674583c71ba5b201b750d1630f46

Update user baselines (#37935) Co-authored-by: typescript-bot <typescript@microsoft.com>

view details

Wesley Wigham

commit sha 8dd6b3a389255d5b09d4f6ec259631395ac44893

Accept recent tests with updated baseline code (#37945)

view details

Wesley Wigham

commit sha edd4e0a42bc8bb124aab11ff89f42d72689faf4f

Add fastpath to isRelatedTo for type references (#37481) * Add fastpath to isRelatedTo for type references * Do not check intersections or unions to ignore propegating reference flags, properly set comparing jsx flag * Re-remove unneeded check * Just check for TypeFlags.Object * Remove else clause

view details

Ashley Claymore

commit sha 4538640d8a99ff0f6044479462ae844abb69e910

Added error when Enum member initaliser references itself (#34655) Fixes #34606

view details

csigs

commit sha 49f5fbb2c76309cd17a7aba0f0663705e2239ff9

LEGO: check in for master to temporary branch.

view details

csigs

commit sha 04069db8467ea71d70c0eb0e1e432cb38d016ab0

LEGO: Merge pull request 37969 LEGO: Merge pull request 37969

view details

csigs

commit sha e505c79091cfd5729f5ef54b50711ffcbbfe5aa3

LEGO: check in for master to temporary branch.

view details

csigs

commit sha 15c3e99cbd315629e8c2c1444ea879a75aa22d8a

LEGO: Merge pull request 37976 LEGO: Merge pull request 37976

view details

Anders Hejlsberg

commit sha 92cd3ae299df987083f2f2c15f088bf97f7d1c24

No iteration type errors during CFA (#37965) * No iteration type errors during CFA * Add regression test

view details

okmttdhr

commit sha 06e05f25e18998beb47bdae3e545ed8eb2de0331

Improve error message for computed enums (#37790) * Add error message for computed enums * Add test case for computed enums * Accept baselines * Fix returned value when error

view details

Joe Previte

commit sha 583e70b3d1aeb752090ccba9477bde6b769d4c24

fix(refactor): keep comments after refactor (#35937) * add two tests: Refactor: Remove braces from arrow function * refactor: simplify test and add another test * fix: copyTrailingAsLeadingComments in addOrRemoveBracesToArrowFunction * test: add additional test * fix: clean up changes * fix: add check for newEdit * fix: add function for semi colon modifier * feat: grab all comments during refactor * refactor: update addOrRemoveBraces logic * fix: remove duplicate function call * Update src/services/refactors/addOrRemoveBracesToArrowFunction.ts * remove blank line remove blank line Co-authored-by: Jesse Trinity <42591254+jessetrinity@users.noreply.github.com>

view details

Nathan Shively-Sanders

commit sha 6fbaeeb42f7e4fbf3a0c19c4ea5b1821393581c5

Typo at Uint8Array[Symbol.toStringTag] (#37989) * Update es2015.symbol.wellknown.d.ts * Update baselines Co-authored-by: sirian <sirianru@gmail.com>

view details

Alexander T

commit sha a16c44180a921e9f4b18fa275d3cba6f3f69c97a

fix(37940): add space after parameter decorator (#37959)

view details

Wesley Wigham

commit sha cdc384006c96720654297488abbd91e854f99950

Fix crash on declaration emit for globalThis (#37992)

view details

TypeScript Bot

commit sha ca1f4672339aefacbf494484d4b3451077dc6400

Update user baselines (#37946) Co-authored-by: typescript-bot <typescript@microsoft.com>

view details

push time in a month

issue commentfacebook/jest

babel-jest does not transpile import/export in node_modules when Babel 7 is used

babel.config.js is a JS file, not a JSON file. You need to use module.exports = ...

dantman

comment created time in a month

issue commentfacebook/jest

babel-jest does not transpile import/export in node_modules when Babel 7 is used

I ran into a similar error when trying to import a package from node_modules whose index.js is an ES Module. After a lot of painful debugging, I was able to resolve it by moving my babel configuration out of package.json, into babel.config.js, as described here: https://github.com/facebook/jest/issues/6053#issuecomment-383632515 Combined with a custom transformIgnorePatterns (see here), this allowed babel-jest to correctly transform the file in node_modules.

dantman

comment created time in a month

issue commentjest-community/vscode-jest

Unexpected identifier error when running jest test with babel env

I ran into a similar error when trying to import a package from node_modules whose index.js is an ES Module. After a lot of painful debugging, I was able to resolve it by moving my babel configuration out of package.json, into babel.config.js, as described here: https://github.com/facebook/jest/issues/6053#issuecomment-383632515 Combined with a custom transformIgnorePatterns (see here), this allowed babel-jest to correctly transform the file in node_modules.

shrutika-s

comment created time in a month

Pull request review commentmicrosoft/TypeScript

Better error message for accidental calls to get-accessors

 namespace ts {             };
         }
         function invocationError(errorTarget: Node, apparentType: Type, kind: SignatureKind, relatedInformation?: DiagnosticRelatedInformation) {
-            const { messageChain, relatedMessage: relatedInfo } = invocationErrorDetails(apparentType, kind);
-            const diagnostic = createDiagnosticForNodeFromMessageChain(errorTarget, messageChain);
-            if (relatedInfo) {
-                addRelatedInfo(diagnostic, createDiagnosticForNode(errorTarget, relatedInfo));
+            let diagnostic;
+            if (isCallExpression(errorTarget.parent) && errorTarget.parent.arguments.length === 0) {
+                // Diagnose get accessors incorrectly called as functions
+                const { resolvedSymbol } = getNodeLinks(errorTarget);
+                if (resolvedSymbol && resolvedSymbol.flags & SymbolFlags.GetAccessor) {
+                    diagnostic = createDiagnosticForNode(errorTarget, Diagnostics.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without);

invocationErrorDetails currently doesn't have enough information (access to the node/symbol) to produce the new error. I could rethink its signature, but that seemed more invasive than just putting it here. I'll take another look later if you think it's better that way!

jtbandes

comment created time in a month

pull request commentmicrosoft/TypeScript

Better error message for accidental calls to get-accessors

Hi @sandersn just a friendly ping on this PR! No rush but I don't want it to languish for too long either :)

jtbandes

comment created time in a month

pull request commentmicrosoft/TypeScript

Better error message for accidental calls to get-accessors

Alright, got the code fix working, except that I had to omit the (/) tokens from forEachChild and change the test harness 😕 : https://github.com/jtbandes/TypeScript/pull/1/files#diff-e4047651bbe0a47423c7db850216a6afR122

jtbandes

comment created time in a month

PR opened jtbandes/TypeScript

Code fix for accidental accessor calls

Follow up to microsoft/TypeScript#37800 <!-- Thank you for submitting a pull request!

Please verify that:

  • [ ] There is an associated issue in the Backlog milestone (required)
  • [ ] Code is up-to-date with the master branch
  • [ ] You've successfully run gulp runtests locally
  • [ ] There are new or updated unit tests validating the change

Refer to CONTRIBUTING.MD for more details. https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md -->

+107 -8

0 comment

9 changed files

pr created time in a month

create barnchjtbandes/TypeScript

branch : fix-accidental-accessor-call

created branch time in a month

push eventjtbandes/TypeScript

push time in a month

push eventjtbandes/TypeScript

Jacob Bandes-Storch

commit sha a4322d1be3ed4b0d975f520b3f6d8c9d4d8e8c5e

fix forEachChild and update some baselines

view details

push time in a month

pull request commentmicrosoft/TypeScript

Better error message for accidental calls to get-accessors

I added a code fix, but to make it easier I modified the parser to save the open/close paren tokens in CallExpression. Is that alright?

jtbandes

comment created time in a month

push eventjtbandes/TypeScript

Jacob Bandes-Storch

commit sha cd155600377901ed35eb7e6d1ded05fcff217ca1

add code fix

view details

push time in a month

push eventjtbandes/TypeScript

Jacob Bandes-Storch

commit sha d00f2b53adb1dafbba33ac07227b21a62d4acb53

replace the original not-callable error

view details

Jacob Bandes-Storch

commit sha aa5838c307da79d5aa6c237c423a32dc900a17df

add code fix

view details

push time in a month

pull request commentcruise-automation/webviz

Changing onDirty & paint to be more performance friendly

Thanks for pushing this through! Nice API improvement.

joshribakoff

comment created time in a month

pull request commentmicrosoft/TypeScript

Better error message for accidental calls to get-accessors

I see, I guess starting with "This expression is not callable because…" alleviates my concern. And I suppose we can still keep the "Type {0} has no call signatures" sub-error.

jtbandes

comment created time in 2 months

pull request commentmicrosoft/TypeScript

Better error message for accidental calls to get-accessors

Thanks for the feedback!

But it requires a unique error code, which means replacing "This expression is not callable".

That partially answers my question about the best way to make the code fix. But is it really desirable to replace this error message? I guess I'm worried about the rare cases where the remove () suggestion is wrong, and then the new error message wouldn't really make sense. Should we try to also preserve the "not callable" error (the actual "root cause"), or do you really think it's best to replace it?

jtbandes

comment created time in 2 months

pull request commentZamiell/hanabi-live

use Prettier for formatting

It looks like there actually is a setting for trailingCommas: "all" which I will enable when I get a chance.

they are constructing if statements that break the line length rule by a few characters You mean the printWidth: 120 I set (which was an arbitrary choice) or some other length rule?

I do also like eslint --fix on save, but eslint doesn't do nearly as much basic whitespace/formatting as prettier does. Well, unless you configure the prettier plugin, then your eslint --fix will (I think) rerun prettier as well.

There is some discussion about airbnb style vs prettier at https://github.com/airbnb/javascript/issues/1548

And here's some popularity data https://www.npmtrends.com/eslint-config-airbnb-vs-prettier-vs-standard-vs-eslint-config-prettier-vs-eslint-plugin-prettier

jtbandes

comment created time in 2 months

issue commentMicrosoftDocs/live-share

Blocking External Users

Hi @lostintangent, just wondering if there have been any updates on this roadmap since last year when this issue was opened?

RDavies2019

comment created time in 2 months

delete branch jtbandes/hanabi-live

delete branch : docker

delete time in 2 months

pull request commentZamiell/hanabi-live

use Prettier for formatting

until it can actually conform fully to the airbnb guide

what's the motivation for conforming so strictly to the guide? The eslint configs/plugins provided by prettier ensure that there are no conflicts with the rules, so the prettier output will pass lint.

jtbandes

comment created time in 2 months

pull request commentcruise-automation/rosbag.js

Do not inline everything in generated parse code

Sounds like a job for inline snapshots :)

MatthewSteel

comment created time in 2 months

PR opened Zamiell/hanabi-live

add Dockerfile and docker-compose.yml

Usage: docker-compose up --build.

+95 -4

0 comment

5 changed files

pr created time in 2 months

push eventjtbandes/hanabi-live

Zamiell

commit sha 5cb015a5c85826cbb26195fe3ab7cd6303fd1c1a

adding clear empty tables command

view details

Zamiell

commit sha 5be1ef5b23541f41c1f214f7f18ed7e384169a20

adding new admin script

view details

James

commit sha b6a2cbff91d0cc5a0f67503fb70cf8b748f7c147

Update INSTALL.md

view details

James

commit sha 6812e68d8fa3d008ff147ff91ef1e25f6da1264b

Update INSTALL.md

view details

Zamiell

commit sha cc30385e1426faedaa18e3d5abda1a92e68a2da0

better comment

view details

Zamiell

commit sha 132ace63378103b68a1e7209c3a3841c16170cc8

bugfix for sentry with no sentry DSN specified

view details

James

commit sha eaaf669699d82f20e94fdcfe2ca147450ec2a4a3

Update INSTALL.md

view details

James

commit sha ec14ac73f44a300843e3ab741b8d74c00a3603a5

Update INSTALL.md

view details

Zamiell

commit sha 0c74555b1ba01536a639053d98029d45d1fa632d

part 2 of previous commit (checking .env)

view details

Zamiell

commit sha 88d2ee0746f536c5f6fab40eb4ca4fd5ad76ba27

certbot replaces letsencrypt

view details

Zamiell

commit sha e637053ad6e91726a06cebcdf7fe5bd9ff098c25

bugfix for go build in install script

view details

James

commit sha 12a0d033130ab53e51901a5c8179997e4268b005

Update INSTALL.md

view details

James

commit sha 9d4202b3de7dffa6a11869d13f6952b357ae9d1c

Update INSTALL.md

view details

James

commit sha 2cf90c378699140c8d8a154d10dfd4c57afbf7a6

Update INSTALL.md

view details

Zamiell

commit sha 459117ea712991320ac53c4a76f633f23ed6e49d

adding doc for google drive upload

view details

Zamiell

commit sha 74214e870d55a739c898df9a4aa48617967fd4f5

adding supervisor service file

view details

James

commit sha d84f643c0bcb17e51a3089db5352ebc1c98d15f9

Update INSTALL.md

view details

James

commit sha 6a42536491cc7e2016098d33832cb648631968d6

Update INSTALL.md

view details

James

commit sha 033b6906dcaa9033361ccfdd6a6f613f911913bb

Update notes.txt

view details

Bojia Chen

commit sha db99e198cc7edaed1cde8c6f3c0fde91760e8944

Update INSTALL.md Add sudo to a few commands that need elevated permissions. Update git clone link

view details

push time in 2 months

push eventjtbandes/hanabi-live

Jacob Bandes-Storch

commit sha 730633bf765a83bf9161215e8cb0aaafaa7b236b

actually add .vscode/extensions.json

view details

push time in 2 months

PR opened Zamiell/hanabi-live

use Prettier for formatting
  • Install prettier and the prettier eslint plugin (so that lint.sh will include it)
  • Add .vscode/extensions.json with recommended extensions

Disadvantage: all the changes in this PR. I admit Prettier makes some less than perfect choices especially around binary operators.

Advantage: turn on Format On Save in VSCode, never have to format manually again

+1738 -2334

0 comment

81 changed files

pr created time in 2 months

push eventjtbandes/hanabi-live

Jacob Bandes-Storch

commit sha efb3d137d35bcc3a0cb6193da45778acd4de9b14

a few manual hacks to make prettier results better

view details

push time in 2 months

push eventjtbandes/hanabi-live

Jacob Bandes-Storch

commit sha 21cd03f64e5e78ddf99ccf3f7125c3cf698514c9

install prettier

view details

Jacob Bandes-Storch

commit sha 6c71e56e18aa7c714be8df47c432bdc1980a383b

run prettier --write

view details

push time in 2 months

push eventjtbandes/hanabi-live

Jacob Bandes-Storch

commit sha c856d9b36368215f99d539dcc80169a1e8bbc51d

install prettier

view details

Jacob Bandes-Storch

commit sha f09ca5c030ff18528fcf0459314e5479addef73f

run prettier --write

view details

push time in 2 months

create barnchjtbandes/hanabi-live

branch : prettier

created branch time in 2 months

push eventjtbandes/TypeScript

Anders Hejlsberg

commit sha 5a4024dd9d2d6c67ce017eba01cec7397f446f71

Generic functions are never context sensitive (#37811) * Functions with type parameters are never contextsensitive * Add tests

view details

Anders Hejlsberg

commit sha a2609b1f1b58f9b6ef62cb3b6ff47efb35059eee

Extra check in assignment of intersections with generic constituents (#37537) * Consolidated extra property check with intersections * Fix comment * Add tests * Properly propagate intersectionState * Route property check through recursive type tracking logic * Accept new baselines * Skip check when apparent type of source is never * Accept new baselines * Only check when apparent type of source is a structured type

view details

Nathan Shively-Sanders

commit sha 7ca6334dbd1d58984dc364b7b7fb3e453e3b1649

Look for outer type parameters on VariableStatements (#37819) This only applies in JS, where `@template` tags can apply to initialisers of variable declarations: ```js /** * @template T * @returns {(b: T) => T} */ const seq = a => b => b ``` Fixes #36201

view details

Bannerets

commit sha c47aca0da321663415b7fc2ed000f66c4d7bcb5d

Accurate Array.prototype.flat definition (#32131) * Better Array.prototype.flat definition * Use more meaningful names * Rename 'Flat' to 'FlatArray'

view details

Andrew Branch

commit sha 3e86f15f5101a354625427befbd907e3bac57b30

Disambiguate types with same name from different namespaces in mapToTypeNodes (#37543) * Disambiguate types with same name from different namespaces in mapToTypeNodes * Update baseline with additional example * Fix typo

view details

Orta

commit sha 3398c9bfe1e474e2f81e5ea05d01645e329e5860

Make skipLibCheck: true the default in --init (#37808)

view details

Eli Barzilay

commit sha dcc6c9461e1ff6015cff5bec3ccd9872cbf762b1

Minor improvement Get the `declaration` container just once instead of in three places. (Minor change: one place used to start looking from `declaration.parent`, but that shouldn't make any difference.) Also, don't pass it to the helper functions since they're local anyway.

view details

Eli Barzilay

commit sha e4babd40e00f572c3f308e47c8d98e2d7df550a4

Skip `isBlockScopedNameDeclaredBeforeUse` error in interface or type declarations Fixes #35947.

view details

Alexander T

commit sha e897eb1b2a7585f2300e41c7a4d9f549b07ed739

fix(37817): omit comments in name accessor (#37822)

view details

zhangciwu

commit sha 126c6ab80d2dca28d4a3d1889f19ad3504c1f74d

Fix easy misunderstanding "! ===" (#37838) * Remove unnecessary Non-null assertion operator * Wrap Non-null assertion operator inside parentheses

view details

Ron Buckton

commit sha 5a7916962d84c23c8b637664b7f854a9b59cd250

Fix metadata serialization for invalid jsdoc types (#37836)

view details

Wesley Wigham

commit sha b4838c8b62491286eae66556986e54dafd755149

Use comments from host variable declaration when exporting a signature in js declarations (#37594)

view details

csigs

commit sha f5de3138def4c876693b5b54a599828ae3134b56

LEGO: check in for master to temporary branch.

view details

csigs

commit sha fd6f92255bd421efc01a202226207c002341e3e4

LEGO: Merge pull request 37848 LEGO: Merge pull request 37848

view details

Ron Buckton

commit sha 5db4e7add37892ee27eb24677c713ffdd8bc6dae

Fix async function block return expr error in js (#37845)

view details

Nathan Shively-Sanders

commit sha f31b5a278f03b2e2d2713ed64230f853ae6b4545

fix build break by updating missed baseline

view details

Wesley Wigham

commit sha 3d3854c93de833a6e2c56e3de2498b83634eec3e

Set contextual type on elaborated error node rather than passing it, so its discriminated (#37828)

view details

Andrew Branch

commit sha 57f90766127f4f1dcfe62c5e19d905ba80051d78

Remove extraneous string escape from convert to template string refactor (#37743) * Add failing test * Remove extraneous string escape * Revert unnecessary change

view details

Andrew Branch

commit sha 24a17acf2cdcb4049be0665c69ca5ec9fa58d059

Error on invalid uses of namespace export (#37715)

view details

Andrew Branch

commit sha 813efb49af119e6c2c720c6ad50d4c3d89d6036f

Lock playwright version (#37869)

view details

push time in 2 months

Pull request review commentcruise-automation/webviz

fixes debounced paint issues

 export class WorldviewBase extends React.Component<BaseProps, State> {     if (this.props.cameraState) {       worldviewContext.cameraStore.setCameraState(this.props.cameraState);     }--    // queue up a paint operation on the next frame, if we haven't already-    if (!this._tick) {-      this._tick = requestAnimationFrame(() => {-        this._tick = undefined;-        try {-          worldviewContext.paint();-        } catch (error) {-          // Regl automatically tries to reconnect when losing the canvas 3d context.-          // We should log this error, but it's not important to throw it.-          if (error.message === "(regl) context lost") {

Or @troygibb? https://github.com/cruise-automation/webviz/pull/265

josh-ribakoff-cruise

comment created time in 2 months

Pull request review commentmicrosoft/TypeScript

Better error message for accidental calls to get-accessors

 namespace ts {                     error(node, Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, typeToString(funcType));
                 }
                 else {
-                    let relatedInformation: DiagnosticRelatedInformation | undefined;
-                    if (node.arguments.length === 1) {
+                    const relatedInformation: DiagnosticRelatedInformation[] = [];
+                    if (node.arguments.length === 0) {
+                        // Diagnose get accessors incorrectly called as functions
+                        const { resolvedSymbol } = getNodeLinks(node.expression);
+                        if (resolvedSymbol && resolvedSymbol.flags & SymbolFlags.GetAccessor) {
+                            relatedInformation.push(createDiagnosticForNode(node.expression, Diagnostics._0_is_a_get_accessor_did_you_mean_to_use_it_without, getTextOfNode(node.expression)));

I wasn't sure how to get back to the original declaration. Would it be ok to add a special-case check here whether the node.expression is a PropertyAccessExpression? (seems a bit roundabout.)

jtbandes

comment created time in 2 months

Pull request review commentmicrosoft/TypeScript

Better error message for accidental calls to get-accessors

         "category": "Error",
         "code": 6231
     },
+    "'{0}' is a 'get' accessor; did you mean to use it without '()'?": {

I could see the wording that mentions () being better if we could actually provide a code fix that deletes the (). I had some questions about that in my PR description, would you happen to have experience with code fixes and could help me figure out how to implement it cleanly?

jtbandes

comment created time in 2 months

issue commentmicrosoft/TypeScript

Can we give better error messages on invoked accessors?

Hi @DanielRosenwasser, I've submitted a PR to improve this (#37800) — is there any procedure I should follow to get it reviewed?

DanielRosenwasser

comment created time in 2 months

create barnchjtbandes/hanabi-live

branch : docker

created branch time in 2 months

push eventjtbandes/hanabi-live

push time in 2 months

push eventjtbandes/hanabi-live

Jacob Bandes-Storch

commit sha 55563242993dcf1c7c538b19e1fd50419cfa8615

WIP dockerfile

view details

push time in 2 months

fork jtbandes/hanabi-live

A web server that allows people to play Hanabi, a cooperative card game of logic and reasoning.

https://hanabi.live

fork in 2 months

PR opened microsoft/TypeScript

Better error message for accidental calls to get-accessors

Fixes #24554 by adding a new Message when resolveCallExpression fails to find any call signatures, if the node.expression references a GetAccessor. Example test case with new message:

==== tests/cases/compiler/accessorAccidentalCallDiagnostic.ts (1 errors) ====
    // https://github.com/microsoft/TypeScript/issues/24554
    class Test24554 {
        get property(): number { return 1; }
    }
    function test24554(x: Test24554) {
        return x.property();
                 ~~~~~~~~
!!! error TS2349: This expression is not callable.
!!! error TS2349:   Type 'Number' has no call signatures.
!!! related TS6232 tests/cases/compiler/accessorAccidentalCallDiagnostic.ts:6:12: 'x.property' is a 'get' accessor; did you mean to use it without '()'?
    }

This is my first attempt to contribute to TS, so I'm eager for any feedback! Specifically here are some questions I'd like someone familiar with the code to answer:

  • Is resolveCallExpression a good place to add this? The discussion on #27897 mentioned changing checkPropertyAccessExpression, but that seemed hard to me because the PropertyAccessExpression isn't really aware of its parent CallExpression (well, I guess it might be able to access parent, but that doesn't seem great).
  • Any caveats to using getNodeLinks(node.expression).resolvedSymbol? That was the easiest way I found to reach the function and determine whether it's a GetAccessor, but it also seems to implicitly depend on something else having resolved the symbol first.
  • Is relatedInformation the right place to attach such a message? I'm a bit confused about the diagnostic "chain" and how relatedInfo fits in, but this seems to work.
  • I'd be interested in adding a code fix to delete the () as well. I started down that path, but it seems like fixes can't be triggered on relatedInformation, just on errors (I was able to create a new fix that got triggered on This_expression_is_not_callable errors, but it didn't trigger if I register it only for my new diagnostic message.) And since the fix's getCodeActions(context) function doesn't receive the diagnostic itself, just the code, it doesn't seem feasible to register it for all This_expression_is_not_callable errors and look at their relatedInformation to see if my new did you mean to use it without '()'? is attached. One approach I could consider is making it a separate error, but then it wouldn't be attached to the existing "not callable" error. Any advice here?
+111 -6

0 comment

9 changed files

pr created time in 2 months

push eventjtbandes/TypeScript

Jacob Bandes-Storch

commit sha f92edb7abf514f18dc3c42bb7eb90bec1b03c15f

Better error message for accidental calls to get-accessors

view details

push time in 2 months

create barnchjtbandes/TypeScript

branch : diagnose-accidental-accessor-call

created branch time in 2 months

fork jtbandes/TypeScript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

https://www.typescriptlang.org

fork in 2 months

issue commentmicrosoft/TypeScript

String type autocomplete doesn't work with paren

Bump! @weswigham should this one be closed too?

Kingwl

comment created time in 2 months

issue commentmicrosoft/TypeScript

Suggest `Did you mean 'typeof Foo'` when using value Foo as a type

@amcasey Should this issue be closed now as #37359 is merged? Looks like #32543 would have auto-closed this ticket but it was abandoned in favor of #37359.

mohsen1

comment created time in 2 months

issue commentcruise-automation/webviz

[feature request]Visualization Pose Array/Objects List in 3D Panel

What lane information are you referring to? The Polygon msg just contains a list of points: http://docs.ros.org/melodic/api/geometry_msgs/html/msg/Polygon.html

Shiming94

comment created time in 2 months

delete branch cruise-automation/webviz

delete branch : hernan/gltext

delete time in 2 months

Pull request review commentcruise-automation/webviz

fixes debounced paint issues

 export class WorldviewBase extends React.Component<BaseProps, State> {     if (this.props.cameraState) {       worldviewContext.cameraStore.setCameraState(this.props.cameraState);     }--    // queue up a paint operation on the next frame, if we haven't already-    if (!this._tick) {-      this._tick = requestAnimationFrame(() => {-        this._tick = undefined;-        try {-          worldviewContext.paint();-        } catch (error) {-          // Regl automatically tries to reconnect when losing the canvas 3d context.-          // We should log this error, but it's not important to throw it.-          if (error.message === "(regl) context lost") {

I think you might need to keep this somewhere, maybe @davidswinegar can advise more but I think this error was causing lots of problems for us in sentry.

josh-ribakoff-cruise

comment created time in 2 months

Pull request review commentcruise-automation/webviz

removes debounce, consolidates painting in single game loop

 export class WorldviewContext {     this.counters.render = Date.now() - start;   } -  _debouncedPaint = debounce(this.paint, 10);+  tick = () => {+    cancelAnimationFrame(this._frame);+    this._frame = window.requestAnimationFrame(() => {+      if (this._dirty) {+        this.paint();+        this._dirty = false;+      }+      this.tick();

I see, yeah, I guess I'm arguing for going back to something like this:

onDirty = () => {
  if (!this._frame) this._frame = requestAnimationFrame(this.paint);
}
componentDidUpdate() {
  if (!this._frame) this._frame = requestAnimationFrame(this.paint);
}
paint = () => {
  /*webgl rendering here*/
  this._frame = null;
}

Do you think this implementation would still be problematic for your use case? It seems like the best of both words, where the actual paints will never be delayed longer than necessary, and you can call onDirty as often as you like.

josh-ribakoff-cruise

comment created time in 2 months

Pull request review commentcruise-automation/webviz

removes debounce, consolidates painting in single game loop

 export class WorldviewContext {     this.counters.render = Date.now() - start;   } -  _debouncedPaint = debounce(this.paint, 10);+  tick = () => {+    cancelAnimationFrame(this._frame);+    this._frame = window.requestAnimationFrame(() => {+      if (this._dirty) {+        this.paint();+        this._dirty = false;+      }+      this.tick();

Disclaimer: I am not really an owner of this library anymore, so I think you should feel free to abandon this conversation and take someone else's opinion if you're blocked. I'm just speculating as a bystander. I find the conversation interesting but I don't want to slow you down too much :)

If we delete the recursion, this will then run 1x only. That means only the first map tile loading would cause a paint, and subsequent map tile loading would not cause a paint.

I don't think this is right in general. Suppose one map tile loads, and calls onDirty. If the second one loads before the animation frame, great, its onDirty will do nothing (or replace the current frame request, but that's effectively nothing) and the next animation frame will repaint both of them (effectively using the browser's animation timer as a way of batching the two updates). On the other hand, if the second one loads after the first animation frame, its onDirty call will just schedule another frame. That's fine too, since the paint calls won't actually happen faster than the browser can render them.

Since paint is a synchronous call, I'm ignoring the case of "the second one loads during the first animation frame". On the other hand, the debouncePromise code I wrote was meant to handle the case of an asynchronous bit of work, and that's why it has a second flag for callPending. With async work (paint), if a second call comes in while the first one is being serviced (painted), you need to give the second one another opportunity to run, but only after the first one has finished (since you don't want to be painting 2 things at once).

I admit debouncePromise was probably not the best name (I think I just forgot / didn't know the terminology of debounce vs throttle). I agree with your points about "classic" throttle and debounce both making assumptions about performance limits or leaving it open to perf degradations. My debouncePromise doesn't have a timer or animation frame, though, it exists only for the purpose of batching requests while ensuring there is always a trailing-edge call. I also realize I should've added more comments to it 😓

You might be able to tweak your current implementation pretty easily, since the Worldview paint() is synchronous. On the other hand you might be able to use debouncePromise easily too, like this:

function rafPromise(): Promise<void> {
  return new Promise((resolve) => window.requestAnimationFrame(resolve));
}
debouncedPaint = debouncePromise(async () => {
  await rafPromise();
  paint();
});
josh-ribakoff-cruise

comment created time in 2 months

Pull request review commentcruise-automation/webviz

removes debounce, consolidates painting in single game loop

 export class WorldviewContext {     this.counters.render = Date.now() - start;   } -  _debouncedPaint = debounce(this.paint, 10);+  tick = () => {+    cancelAnimationFrame(this._frame);+    this._frame = window.requestAnimationFrame(() => {+      if (this._dirty) {+        this.paint();+        this._dirty = false;+      }+      this.tick();

I think it just makes me sad when web apps do things on recurring timers or tight loops and it slows down my browser 😛 Keep in mind that some apps have several Worldviews on a single page.

Doesn't it still work if you just delete this line? If someone calls onDirty, that will lead to a paint call on the next available animation frame. If they don't, nothing else happens.

Might also be worth looking at debouncePromise: https://github.com/cruise-automation/webviz/blob/master/packages/webviz-core/src/util/debouncePromise.js

josh-ribakoff-cruise

comment created time in 2 months

Pull request review commentcruise-automation/webviz

removes debounce, consolidates painting in single game loop

 export class WorldviewContext {     this.counters.render = Date.now() - start;   } -  _debouncedPaint = debounce(this.paint, 10);+  tick = () => {+    cancelAnimationFrame(this._frame);

I guess I'm just not sure if it might be slightly more efficient to keep the existing request rather than making a new request, if you're calling this frequently. probably doesn't matter much.

josh-ribakoff-cruise

comment created time in 2 months

Pull request review commentcruise-automation/webviz

removes debounce, consolidates painting in single game loop

 export class WorldviewContext {     this.counters.render = Date.now() - start;   } -  _debouncedPaint = debounce(this.paint, 10);+  tick = () => {+    cancelAnimationFrame(this._frame);

I just mean if (!this._frame) this._frame = ...

josh-ribakoff-cruise

comment created time in 2 months

Pull request review commentcruise-automation/webviz

removes debounce, consolidates painting in single game loop

 export class WorldviewContext {     this.counters.render = Date.now() - start;   } -  _debouncedPaint = debounce(this.paint, 10);+  tick = () => {+    cancelAnimationFrame(this._frame);+    this._frame = window.requestAnimationFrame(() => {+      if (this._dirty) {+        this.paint();+        this._dirty = false;+      }+      this.tick();

I still think it's a waste of CPU that we should avoid

josh-ribakoff-cruise

comment created time in 2 months

pull request commentcruise-automation/webviz

removes debounce, consolidates painting in single game loop

Is it recommended to call paint() only in a requestAnimationFrame loop, from the top level of the app

Historically, I don't think calling onDirty() (assuming that is what you mean by paint()?) in a loop was ever a recommended usage pattern. I believe we added it for things like map tiles and GLTFScene, which load static external resources, so they need to re-render once when the data loads. The usage pattern we always used was a top-down update, where the parent of Worldview would re-render whenever the data needed to change.

e.g. instead of

function Child1() {
  const externalData = useMyExternalFrequentlyUpdatingState1()
  const worldviewCtx = useRef()
  useLayoutEffect(() => worldviewCtx.current?.onDirty(), [externalData])
  return <WorldviewCtx>{(ctx)=>{
    worldviewCtx.current=ctx
    return <MyPrimitive>{externalData}</MyPrimitive>
  }}</WorldviewCtx>
}
function Parent() {
  return <Worldview>
    <Child1 />
    <Child2 />
  </Worldview>
}

, which is pretty awkward, you'd have

function Parent() {
  const externalData = useMyExternalFrequentlyUpdatingState()
  return <Worldview>
    <Child1>{externalData.child1Data}</Child1>
    <Child2>{externalData.child2Data}</Child2>
  </Worldview>
}

, which Just Works™.

That said, I think it's reasonable that some apps would prefer a design where the state is held internally in child components; the side effect is that now we have to actually define/optimize for this usage pattern. So thanks for doing the hard work of thinking through it carefully.

if we need to add a "trailing edge" to support consumers who call outside of the animation frame context

I think a trailing edge would always be necessary. The use case for onDirty was a way of telling Worldview that its children need to be redrawn because they changed internally. If there's no trailing edge on the throttle, then some changes might not ever get rendered.

josh-ribakoff-cruise

comment created time in 2 months

Pull request review commentcruise-automation/webviz

removes debounce, consolidates painting in single game loop

 export class WorldviewContext {     this.counters.render = Date.now() - start;   } -  _debouncedPaint = debounce(this.paint, 10);+  tick = () => {+    cancelAnimationFrame(this._frame);

Since the raf callback doesn't capture any local state, why do you need to cancel the pending frame if there is one already?

josh-ribakoff-cruise

comment created time in 2 months

Pull request review commentcruise-automation/webviz

removes debounce, consolidates painting in single game loop

 export class WorldviewContext {     this.counters.render = Date.now() - start;   } -  _debouncedPaint = debounce(this.paint, 10);+  tick = () => {+    cancelAnimationFrame(this._frame);+    this._frame = window.requestAnimationFrame(() => {+      if (this._dirty) {+        this.paint();+        this._dirty = false;+      }+      this.tick();

Was this recursive call intentional? A user of Worldview whose data never updates shouldn't have to pay the cost of re-rendering at 60fps.

josh-ribakoff-cruise

comment created time in 2 months

pull request commentvadimdemedes/dom-chef

Convert to Typescript; Export it as ES Module only

This looks exciting. You mentioned that types are ignored if using JSX — do you have plans to add types for JSX?

Currently, I have the following in my project. It uses TS's builtin HTMLElementTagNameMap and tweaks the types so they work well with dom-chef. I wonder if I might be able to get rid of it some day when dom-chef has full TS type definitions for JSX 🙂

type Merge<T, U> = Omit<T, keyof U> & U;

// Since dom-chef doesn't provide type definitions (https://github.com/vadimdemedes/dom-chef/issues/36),
// we can just ask TypeScript to treat JSX elements like actual DOM elements, which is pretty close
// to the actual behavior of dom-chef.
// See: https://www.typescriptlang.org/docs/handbook/jsx.html
declare namespace JSX {
  type JSXChildren = null | undefined | string | Node | JSXChildren[];

  type IntrinsicElements = {
    [K in keyof HTMLElementTagNameMap]: Merge<
      // The HTMLLabelElement API uses 'htmlFor' as the property name for <label> elements,
      // as does React, but with dom-chef we need to use 'for' instead.
      Partial<Omit<HTMLElementTagNameMap[K], "htmlFor">>,
      {
        children?: JSXChildren;
        style?: Partial<HTMLElementTagNameMap[K]["style"]>;
        dangerouslySetInnerHTML?: { __html: string };
      }
    >;
  };
}

(and this doesn't support SVG at all btw.)

fregante

comment created time in 2 months

issue commentcruise-automation/webviz

[feature request] support multiple remote-bag-urls.

It's already covered in #378!

jasonimercer

comment created time in 2 months

issue commenteemeli/yaml

parse does not properly handle floats of the form ".8"

Thanks for the quick responses!

ycz

comment created time in 2 months

issue commenteemeli/yaml

parse does not properly handle floats of the form ".8"

This regexp is a bit strange IMO: (?:\.([0-9]+)|(?:0|[1-9][0-9]*)\.([0-9]*)) — is "00.1" not supposed to be a valid float?

ycz

comment created time in 2 months

issue commentcruise-automation/webviz

[feature request] support multiple remote-bag-urls.

Yes, in fact we are also tracking this request internally. (It's become more relevant in today's work-from-home climate.) I don't want to promise a timeline on behalf of the folks actually working on it, but I think it's likely to be implemented soon, so stay tuned! Thanks for the request!

jasonimercer

comment created time in 2 months

pull request commentcruise-automation/webviz

Fix glyph size when rendering text

duplicate the BUFFER offset for the y-coordinate to make sure the descent is not cropped

Not sure if this is right either. Here is my mental model:

So, the difference between info.x/info.y and the srcOffset should be only 1x buffer, unless this picture is wrong.

I guess the question is, where does the descender actually fall within this box?

hhsaez

comment created time in 2 months

pull request commentcruise-automation/webviz

Fix glyph size when rendering text

we're not taking into account the small margin (named BUFFER in the code) for each glyph

Isn't this what the srcOffset is doing? Is the descender actually going outside the BUFFER area? It seems like your change has made all the text slightly smaller and I'm not sure if that was intentional (probably doesn't matter since the size is kind of arbitrary anyway).

hhsaez

comment created time in 2 months

issue commentcruise-automation/rosbag.js

Get progress of readMessages

The ReadResult contains progress info at the level of chunks:

  // the offset of the chunk being read
  // starts at 0 and eventually increments to totalChunks
  // useful for computing read progress as a percentage
  chunkOffset: number,

  // the total chunks to eventually be consumed
  // during the current read operation
  totalChunks: number,
khvr000

comment created time in 3 months

Pull request review commentcruise-automation/webviz

<GLText> improvements for text rendering

 function makeTextCommand() { }  export default function GLText(props: Props) {+  const context = useContext(WorldviewReactContext);+  const { dimension } = context;+   const [command] = useState(() => makeTextCommand());   // HACK: Worldview doesn't provide an easy way to pass a command-level prop into the regl commands,   // so just attach it to the command object for now.   command.autoBackgroundColor = props.autoBackgroundColor;++  command.scaleInvariant = !!props.scaleInvariantFontSize;

Or just use

  command.scaleInvariant = props.scaleInvariantFontSize != null;

here?

hhsaez

comment created time in 3 months

Pull request review commentcruise-automation/webviz

<GLText> improvements for text rendering

 import { GLText } from "./jsx/allLiveEditors"; The prop types are identical to `<Text />`, except that additionally each Text object supports an optional `billboard?: boolean` property. If true (the default), text will always face the camera; if false, text may be rotated in 3D according to `pose.orientation`.  <GLText />++## Scale Invariance++`<GLText />` also supports rendering text at a constant scale regardless of the zoom level by using the optional `scaleInvariantFontSize?: number` property. If set (default is `undefined`), the text will be rendered always at the same size, resembling the behavior of the `<Text />` command. 

Oh I see, so the scaleInvariantFontSize is multiplied by the scale? That makes sense, although I think the documentation isn't clear about this, maybe you can update to clarify more

hhsaez

comment created time in 3 months

Pull request review commentcruise-automation/webviz

<GLText> improvements for text rendering

 const frag = `   uniform mat4 projection;   uniform sampler2D atlas;   uniform float cutoff;+  uniform bool scaleInvariant;+  uniform float scaleInvariantSize;    varying vec2 vTexCoord;   varying float vEnableBackground;   varying vec4 vForegroundColor;   varying vec4 vBackgroundColor;   varying vec4 vHighlightColor;   varying float vEnableHighlight;+  varying float vBillboard;+   void main() {     float dist = texture2D(atlas, vTexCoord).a;      // fwidth(dist) is used to provide some anti-aliasing. However it's currently only used     // when the solid background is enabled, because the alpha blending and     // depth test don't work together nicely for partially-transparent pixels.     float edgeStep = smoothstep(1.0 - cutoff - fwidth(dist), 1.0 - cutoff, dist);++    if (scaleInvariant && vBillboard == 1.0 && scaleInvariantSize < 0.03) {

Yes, I think I ran into an issue where regl / WebGL 1 don't support uniform bool in fragment shaders (or something like that)

hhsaez

comment created time in 3 months

Pull request review commentcruise-automation/webviz

<GLText> improvements for text rendering

 function makeTextCommand() { }  export default function GLText(props: Props) {+  const context = useContext(WorldviewReactContext);+  const { dimension } = context;+   const [command] = useState(() => makeTextCommand());   // HACK: Worldview doesn't provide an easy way to pass a command-level prop into the regl commands,   // so just attach it to the command object for now.   command.autoBackgroundColor = props.autoBackgroundColor;++  command.scaleInvariant = !!props.scaleInvariantFontSize;

nit: what about scaleInvariantFontSize={0}? (Not that this would be desirable anyway)

hhsaez

comment created time in 3 months

Pull request review commentcruise-automation/webviz

<GLText> improvements for text rendering

 import { GLText } from "./jsx/allLiveEditors"; The prop types are identical to `<Text />`, except that additionally each Text object supports an optional `billboard?: boolean` property. If true (the default), text will always face the camera; if false, text may be rotated in 3D according to `pose.orientation`.  <GLText />++## Scale Invariance++`<GLText />` also supports rendering text at a constant scale regardless of the zoom level by using the optional `scaleInvariantFontSize?: number` property. If set (default is `undefined`), the text will be rendered always at the same size, resembling the behavior of the `<Text />` command. 

Hmm, additional thought — it seems like this design doesn't allow different text markers to be different sizes (while all being scale-invariant), is that correct?

hhsaez

comment created time in 3 months

Pull request review commentcruise-automation/webviz

<GLText> improvements for text rendering

 const frag = `   uniform mat4 projection;   uniform sampler2D atlas;   uniform float cutoff;+  uniform bool scaleInvariant;+  uniform float scaleInvariantSize;    varying vec2 vTexCoord;   varying float vEnableBackground;   varying vec4 vForegroundColor;   varying vec4 vBackgroundColor;   varying vec4 vHighlightColor;   varying float vEnableHighlight;+  varying float vBillboard;+   void main() {     float dist = texture2D(atlas, vTexCoord).a;      // fwidth(dist) is used to provide some anti-aliasing. However it's currently only used     // when the solid background is enabled, because the alpha blending and     // depth test don't work together nicely for partially-transparent pixels.     float edgeStep = smoothstep(1.0 - cutoff - fwidth(dist), 1.0 - cutoff, dist);++    if (scaleInvariant && vBillboard == 1.0 && scaleInvariantSize < 0.03) {

Just curious if you have run into any precision issues with vBillboard == 1.0? I recall that while working on this originally I had some strange experiences with the varying interpolation producing values that were very close but not exactly 1.0, so just want to confirm that you aren't experiencing this.

hhsaez

comment created time in 3 months

Pull request review commentcruise-automation/webviz

<GLText> improvements for text rendering

 import { GLText } from "./jsx/allLiveEditors"; The prop types are identical to `<Text />`, except that additionally each Text object supports an optional `billboard?: boolean` property. If true (the default), text will always face the camera; if false, text may be rotated in 3D according to `pose.orientation`.  <GLText />++## Scale Invariance++`<GLText />` also supports rendering text at a constant scale regardless of the zoom level by using the optional `scaleInvariantFontSize?: number` property. If set (default is `undefined`), the text will be rendered always at the same size, resembling the behavior of the `<Text />` command. 

Sorry if this has been asked before; I haven't read through all the prior comments. Did you consider reusing the scale.z for this (as Text does; http://wiki.ros.org/rviz/DisplayTypes/Marker#View-Oriented_Text_.28TEXT_VIEW_FACING.3D9.29_.5B1.1.2B-.5D), rather than using a separate prop for scaleInvariantFontSize?

hhsaez

comment created time in 3 months

issue commentcruise-automation/webviz

npm run build error

Hello, did you try running npm run bootstrap first? Can you please share the full console log including the commands you ran?

heshiwen1989

comment created time in 3 months

issue closedtextmate/swift.tmbundle

Support for raw string literals

Support for raw string literals

SE-0200, implemented in Swift 5, added support for raw string literals, which are string literals that add # characters to their delimiters, and that partially ignore escape sequences like \n and \\. The above-linked Swift Evolution proposal goes into greater detail about their design, but a quick overview follows.

Overview of raw string literals

Traditional string literals interpret character sequences beginning with \ as escape sequences, but raw string literals interpret these as literal characters:

"\n" // newline
#"\n"# // backslash, n

"\\n" // backslash, n
#"\\n"# // backslash, backslash, n

"\u{2603}" // ☃
#"\u{2603}"# // backslash, u, opening brace, 2, 6, 0, 3, closing brace

"\\u{2603}" // backslash, u, opening brace, 2, 6, 0, 3, closing brace
#"\\u{2603}"# // backslash, backslash, u, opening brace, 2, 6, 0, 3, closing brace

let num = 42
"\(num)" // 42
#"\(num)"# // backslash, opening parenthesis, n, u, m, closing parenthesis
"\\(num)" // 42
#"\\(num)"# // backslash, backslash, opening parenthesis, n, u, m, closing parenthesis

You can use any number of # characters as the delimiters of a raw string literal:

// All of the following strings are equivalent:
"good morning"
#"good morning"#
##"good morning"##
###"good morning"###
// et cetera

If you want to use an escape sequence in a raw string literal, the escape sequence includes the same number of # characters as the delimiters:

// All of the following strings are equivalent:
"\n" // newline
#"\#n"#
##"\##n"##

// All of the following strings are equivalent:
"\u{2603}" // ☃
#"\#u{2603}"#
##"\##u{2603}"##

// All of the following strings are equivalent:
"\(num)" // 42
#"\#(num)"#
##"\##(num)"##

Note, the reason you can use any number of # characters is to allow literal \# sequences in a raw string literal without escaping:

// All of the following strings are equivalent:
"\\#n" // backslash, hash, n (need to escape \\ to get \)
#"\#\#n"# // (need to escape \#\ to get \ before #)
##"\#n"## // (no need to escape)

Swift also allows combining raw string literals with multiline string literals:

// All of the following strings are equivalent
let one = "good\\n\nmorning" // g, o, o, d, backslash, n, newline, m, o, r, n, i, n, g
let two = """
    good\\n
    morning
    """
let three = #"""
    good\n
    morning
    """#

The issue: swift.tmbundle doesn’t support raw string literals

As seen in some of the examples above, swift.tmbundle highlights raw string literals as if they were traditional string literals. That means that some valid sequences involving \ characters are marked as invalid, and some invalid sequences involving \ characters are only partially marked as invalid:

"\d" // invalid escape sequence \d (correctly marked)
#"\d"# // backslash, d (incorrectly marked as invalid escape sequence \d)
#"\#d"# // invalid escape sequence \#d (incorrectly marked as shorter invalid escape sequence \#)
##"\#d"## // backslash, hash, d (incorrectly marked as invalid escape sequence \#`)
##"\##d"## // invalid escape sequence \##d (incorrectly marked as shorter invalid escape sequence \#)

closed time in 3 months

erikstrottmann
more