victor-homyakov
Repos
112
Followers
45
Following
1

Events

started
Created at 2 weeks ago
Created at 1 month ago

Fix endless rerenders in MapExplorer

Merge pull request #54 from victor-homyakov/fix-endless-loop-map-explorer

Fix endless rerenders in MapExplorer

Created at 1 month ago
victor-homyakov delete branch fix-endless-loop-map-explorer
Created at 1 month ago

Build webapp using vite (#52)

  • Replace rollup with vite
  • Fix some TS errors
  • Fix some SASS errors

Fix endless rerenders in MapExplorer

Created at 1 month ago

Build webapp using vite (#52)

  • Replace rollup with vite
  • Fix some TS errors
  • Fix some SASS errors
Created at 1 month ago
pull request opened
Fix endless rerenders in MapExplorer

Right now MapExplorer has a problem that leads to endless rerenders:

  • const state = initGroupingState(props) every time has a new property state.selectedGroup because objects for groups are created every time from scratch at getGroupingValues(), there is no caching or memoization
  • useEffect() relies on [state.selectedGroup, fileDeoptInfo], but state.selectedGroup on every render is different, so shallow compare with previous version will return false even when deep compare would show they are similar; therefore useEffect() is called on each rerender
  • after the render useEffect() may call setSelectedEntry(state.selectedGroup.entry), starting endless rerender loop

Schematically, the execution loop has next steps:

MapExplorer() // render
const state = initGroupingState(props); // create new object instance for state.selectedGroup
useEffect(/*...*/, [state.selectedGroup, fileDeoptInfo]) // trigger useEffect because shallow equality check fails for state.selectedGroup
useEffect(() => {/*...*/setSelectedEntry(state.selectedGroup.entry);/*...*/}) // trigger new rerender
MapExplorer() // rerender -> loop
Created at 1 month ago
victor-homyakov create branch fix-endless-loop-map-explorer
Created at 1 month ago

Fix typo "unintialized" -> "uninitialized"

Merge pull request #50 from victor-homyakov/fix-unitialized-name

Fix typo "unintialized" -> "uninitialized"

Upgrade dependencies and switch to NPM (#51)

  • Upgrade some deps

  • Upgrade husky pre-commit hook

  • Switch to using npm

  • Reformat files using prettier

  • Move tape dep to root package json

  • Update more deps

  • Update workflow task versions

Created at 2 months ago
victor-homyakov delete branch fix-unitialized-name
Created at 2 months ago
pull request opened
Fix typo "unintialized" -> "uninitialized"
Created at 2 months ago
victor-homyakov create branch fix-unitialized-name
Created at 2 months ago
Created at 2 months ago
Created at 2 months ago
opened issue
dayjs(string, formats) mutates passed array of formats

Describe the bug Runnable code: https://runkit.com/victor-homyakov/day-js-second-param-mutation

const dayjs = require('dayjs');
const FORMATS = ['DD-MM-YYYY', 'DD.MM.YYYY'];
console.log('1', FORMATS, Object.keys(FORMATS));
const d1 = dayjs('22.11.2022', FORMATS);
console.log('2', FORMATS, Object.keys(FORMATS));

Console output:

1 ["DD-MM-YYYY", "DD.MM.YYYY"] ["0", "1"]
2 ["DD-MM-YYYY", "DD.MM.YYYY"] ["0", "1", "date", "args"]

Expected behavior Expected console output:

1 ["DD-MM-YYYY", "DD.MM.YYYY"] ["0", "1"]
2 ["DD-MM-YYYY", "DD.MM.YYYY"] ["0", "1"]

Information

  • Day.js Version: from 1.9.0 to 1.11.6, maybe older versions
  • OS: MacOS
  • Time zone: GMT+04:00

Details

The problem is in the code at https://github.com/iamkun/dayjs/blob/v1.11.6/src/index.js#L41

const dayjs = function (date, c) {
  // skipped...
  const cfg = typeof c === 'object' ? c : {}
  cfg.date = date
  cfg.args = arguments

The type of any array is 'object': typeof [] === 'object'. When called as daysjs(string, array), it uses the passed array as a configuration object cfg, and writes to it two fields date, args.

Created at 2 months ago
Created at 2 months ago
Change Log shows the year 2002 instead of 2022 for last two releases

Description

https://github.com/gitkraken/vscode-gitlens/blob/main/CHANGELOG.md#1310---2002-11-17

## 13.1.0 - 2002-11-17
...
## 13.0.4 - 2002-11-03

image

GitLens Version

13.1.0

VS Code Version

No response

Git Version

No response

Logs, Screenshots, Screen Captures, etc

No response

Created at 2 months ago
started
Created at 2 months ago