profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/tanhauhau/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Tan Li Hau tanhauhau @Shopee Singapore https://twitter.com/lihautan Frontend Developer at @Shopee 🇲🇾💻in 🇸🇬

sw-yx/spark-joy 5481

✨😂easy ways to add design flair, user delight, and whimsy to your product.

svelte-society/recipes-mvp 271

this repo has been archived - pls head to https://github.com/svelte-society/sveltesociety.dev/tree/master/src/pages/recipes to contribute recipes!

Shopee/shopee-react-knowledgeable 64

⚛︎ To share knowledge and have fun.

kahkhang/Inquirer.sh 51

Modern terminal prompt inspired by inquirer.js

Cryrivers/manta-style 39

🚀 The futuristic API Mock Server for Frontend

tanhauhau/babel-ast-explorer 27

ast-explorer + babel-repl

tanhauhau/babel-preset-env 8

How setting preset-env affects your babel configurations

tanhauhau/babel 2

:tropical_fish: Babel is a compiler for writing next generation JavaScript.

issue openedpopeindustries/inline-source

publishing a new version?

Hi, I've noticed the last version published (7.2.0) has been more than a year ago, and you've consistently upgrade dependencies (such as terser v4 -> v5), i wonder would you be considering publishing a new version to npm?

created time in 13 days

issue commentsveltejs/svelte

[AGAIN] Incorrect error message "... received an unexpected slot "default".

@YamiOdymel @frederikhors yup.

@YamiOdymel just want to confirm, whether the one you are reporting is the same root cause of the issue from svelte kit

YamiOdymel

comment created time in a month

issue commentsveltejs/svelte

[AGAIN] Incorrect error message "... received an unexpected slot "default".

@YamiOdymel it would be great if you could provide a repl (https://svelte.dev/repl) / github repo that could replicate this issue?

YamiOdymel

comment created time in a month

issue commentsveltejs/svelte

Make @html not insert linebreaks after every child

Without any repro, I believe this is because your generated content contains newline.

{@html} do not process html string passed to it.

if you think it's due to something else, it'll be most helpful if you could create a repro over https://svelte.dev/repl

infovore

comment created time in a month

issue commentsveltejs/svelte

<style bind:styles={styles}> and <style styles={styles}> - CSS Binding and Passing scoped styles between components and scoped svelte CSS import.

a copy of the entire contents of the style tag is saved in "air".

maybe can elaborate more on this "air" ?

I have no idea how to pass the indicator less dynamically

me too. and i dont think it's possible at the current state of Svelte

lukaszpolowczyk

comment created time in 2 months

Pull request review commentsveltejs/svelte

[fix] hydration & claim

 export function query_selector_all(selector: string, parent: HTMLElement = docum 	return Array.from(parent.querySelectorAll(selector)) as ChildNodeArray; } +export function head_selector(nodeId: string, head: HTMLElement) {+	const result = [];+	let started = 0;+	for (const node of head.childNodes) {+		if (node.nodeType === 8 /* comment node */ && node.textContent.trim() === 'HTML_TAG_END') {+			started -= 1;+			result.push(node);+		} else if (node.nodeType === 8 /* comment node */ && node.textContent.trim() === 'HTML_TAG_START') {+			started += 1;+			result.push(node);+		} else if (started > 0) {+			result.push(node);+		} else if (node.nodeType === 1 /* element node */ && (<Element>node).getAttribute('data-svelte') === nodeId) {+			result.push(node);+		}+	}+	return result;+}+

If you have multiple <svelte:head> elements, wouldn't this be selecting {@html} elements from another <svelte:head> element?

hbirler

comment created time in 2 months

PullRequestReviewEvent

pull request commentsveltejs/svelte

[feat] parser instead of regex for preprocessor

hmm.. fair enough, would it make sense to have an option on the preprocessors to decide whether to use regex or parser?

tanhauhau

comment created time in 2 months

pull request commentsveltejs/svelte

[fix] collapse whitespace in class / style attribute

But the collapsing only done for class and style attribute for elements, which shouldn't matter right?

tanhauhau

comment created time in 2 months

PR opened sveltejs/svelte

[fix] collapse whitespace in class / style attribute

collapse whitespace within class and style attribute of an element

Fixes #6004

Before submitting the PR, please make sure you do the following

  • [x] Prefix your PR title with [feat], [fix], [chore], or [docs].
  • [x] This message body should clearly illustrate what problems it solves.
  • [x] Ideally, include a test that fails without this PR but passes with it.

Tests

  • [x] Run the tests with npm test and lint the project with npm run lint
+179 -4

0 comment

4 changed files

pr created time in 2 months

create barnchtanhauhau/svelte

branch : tanhauhau/gh-6004

created branch time in 2 months

issue closedsveltejs/svelte

{} in an attribute list causes the compiler/linter to crash instead of producing a meaningful error

Describe the bug {} in an attribute list causes the compiler/linter to crash instead of producing a meaningful error.

To Reproduce

<span {}></span>

https://svelte.dev/repl/e8b23903c76b4e9daf28185841799a87?version=3.35.0

The result is an exception TypeError: Cannot read property 'length' of null which doesn't really indicate what happened and where (in VSCode this shows at (1, 1)).

Expected behavior A meaningful error like Variable name or spread operator expected.

Stacktraces <details> <summary>Stack trace</summary>

bundler.js:11 TypeError: Cannot read property 'length' of null at read_attribute (compiler.js:16002) at tag (compiler.js:15862) at new Parser$1 (compiler.js:16787) at parse$3 (compiler.js:16919) at Object.compile (compiler.js:29918) at Object.transform (bundler.js:11) at bundler.js:11 </details>

  • Svelte version: 3.35.0

closed time in 2 months

CherryDT

issue commentsveltejs/svelte

{} in an attribute list causes the compiler/linter to crash instead of producing a meaningful error

yes i think we can close this issue for now, given that we have a meaningful error now.

for improving editor intellisense developer experience, we can explore that in #4818

CherryDT

comment created time in 2 months

push eventtanhauhau/svelte

Tan Li Hau

commit sha 7756f4b9b2868ac0a0459d5ebd2822019e958fd6

throw error for missing attribute value

view details

push time in 2 months

Pull request review commentsveltejs/svelte

[docs] Fix the speed of the typewriter example to scale correctly

 		}  		const text = node.textContent;-		const duration = text.length * speed;+		const duration = text.length / (speed * 0.01) ;

what happens if the speed is 0 then? should there be some minimum speed?

duarte-pompeu

comment created time in 2 months

PullRequestReviewEvent
PullRequestReviewEvent

push eventtanhauhau/svelte

Daniel Sandoval

commit sha b554e343e893cd5247a6dc1c373ed8f3b4367bd5

[docs] "What's new in Svelte" August newsletter (#6604)

view details

push time in 2 months

PR opened sveltejs/svelte

[feat] better error for unclosed curly brace in props

Fixes #6288

Before submitting the PR, please make sure you do the following

  • [x] Prefix your PR title with [feat], [fix], [chore], or [docs].
  • [x] This message body should clearly illustrate what problems it solves.
  • [x] Ideally, include a test that fails without this PR but passes with it.

Tests

  • [x] Run the tests with npm test and lint the project with npm run lint
+30 -1

0 comment

4 changed files

pr created time in 2 months

create barnchtanhauhau/svelte

branch : tanhauhau/gh-6288

created branch time in 2 months

push eventtanhauhau/svelte

Tan Li Hau

commit sha 094a42a2355fc53abcf7a3836bde788d2a1f5b22

fix test

view details

push time in 2 months

push eventtanhauhau/svelte

Tan Li Hau

commit sha 24b8d45f675f226acf7c1b83f41467153c399e50

parser instead of regex for preprocessor

view details

push time in 2 months

PR opened sveltejs/svelte

[feat] parser instead of regex for preprocessor

Replace the regex to a simple parser, allow us to fix #5292 and support #4701

  • allow return attributes, fixes #5900
  • introduce another type for preprocessor expression instead of reusing the existing script
    • the returned code for expression has to be an expression, if the preprocessor transformed it into a multiline statements, it will crash the compiler later on.

Before submitting the PR, please make sure you do the following

  • [x] Prefix your PR title with [feat], [fix], [chore], or [docs].
  • [x] This message body should clearly illustrate what problems it solves.
  • [x] Ideally, include a test that fails without this PR but passes with it.

Tests

  • [ ] Run the tests with npm test and lint the project with npm run lint
+703 -66

0 comment

23 changed files

pr created time in 2 months

push eventtanhauhau/svelte

Tan Li Hau

commit sha 7d101745522ea8783952dbc3bc7c19ee0b9796f6

parser instead of regex for preprocessor

view details

push time in 2 months

push eventtanhauhau/svelte

Tan Li Hau

commit sha 5593c588f52b81b3e6ce93afd95ae832e6702bb2

parser instead of regex for preprocessor

view details

push time in 2 months

push eventtanhauhau/svelte

Tan Li Hau

commit sha 5e63586f8b186328720fda11a279ab019d2e099d

wip

view details

push time in 2 months

push eventtanhauhau/svelte

Tan Li Hau

commit sha 9c7bdf18d1de1134f8eee09aa5d7ccdc5ed2cbbd

replacing regex with parser for preprocess

view details

push time in 2 months

create barnchtanhauhau/svelte

branch : tanhauhau/preproces-parse

created branch time in 2 months

push eventtanhauhau/svelte

tanhauhau

commit sha 20bb9e3de526a7812e91f3368221fa5a2ca95c88

fix browser test

view details

push time in 2 months

issue commentsveltejs/svelte

Cannot read property '$$' of undefined

Trying to repro this on repl but didn't see any errors:

https://svelte.dev/repl/89cbc1de70ad4277b1af151b54dbe3d6?version=3.41.0

matteobruni

comment created time in 2 months