Skip to Content
  • Website
  • Login
Codsen
  • Home
  • Open Source
  • Articles
  • About

Articles→Tag→TS

tsΣ=9

See all tags
Article  ·  Tuesday, 19 July 2022
Observation regarding RTL getby and findby interchangeability

Observation regarding RTL getby and findby interchangeability

At first glance, it seems that React Testing Library (abbreviated RTL) await waitFor + get can be replaced with find everywhere, but it’s not so.

Read article
all posted tagged reactall posted tagged testingall posted tagged jsall posted tagged ts
a thought  ·  Saturday, 27 August 2022

Latest typescript-eslint rule prefer-optional-chain is buggy

The typescript-eslintopens in a new tab ESLint plugin’s rule prefer-optional-chain is buggy on 5.35.1, it’s blocking me from bumping all deps in the monorepo. It took me around 4 hours to investigate, extract and raise https://github.com/typescript-eslint/typescript-eslint/issues/5556opens in a new tab

People also raisedopens in a new tab similar issues regarding the latest prefer-optional-chain.

I hope maintainers will fix it soon.

Until it’s fixed, don’t bump it beyond 5.33.1.

all posted tagged tsall posted tagged lintingall posted tagged a thought
Article  ·  Tuesday, 12 July 2022
New requirements for npm packages in TypeScript 4.7+

New requirements for npm packages in TypeScript 4.7+

The latest TS doesn’t support the types key at the package.json root level. Paul Zaczkiewicz raised an issueopens in a new tab on our GH tracker about it, and together we were able to come up with a repoductionopens in a new tab (later I also discovered a related ticketopens in a new tab on TS issues board). From there on, it was easy to solve; here’s how.

Read article
all posted tagged jsall posted tagged tsall posted tagged infra
Article  ·  Sunday, 12 June 2022
Syntax highlighting in Remix

Syntax highlighting in Remix

Syntax highlighting is done using either highlight.jsopens in a new tab or prism.jsopens in a new tab. Once you’ve picked one, you’ll have to set it up for code blocks: 1. within MDX and 2. outside MDX. That’s how it works on all kinds of frameworks, not just Remix, although I’ll post examples for Remix.

This setup is mostly a trivial task; however, there are a few niggles worth mentioning.

Read article
all posted tagged jsall posted tagged tsall posted tagged reactall posted tagged remixall posted tagged metaall posted tagged mdx
Article  ·  Monday, 01 August 2022
Sync state with URL params in Remix

Sync state with URL params in Remix

This weekend I was tinkering with string-strip-html GUI; I wanted to sync the state with URL params so that users could bookmark the page and visit later and automatically get those settings restored.

Here’s an MVP based on a forked Remix.js starter template on StackBlitz.

Read article
all posted tagged reactall posted tagged remixall posted tagged ts
Article  ·  Monday, 18 July 2022
Styling the react-codemirror instances

Styling the react-codemirror instances

When building the string-strip-html GUI, I wanted: line wrapping, full-screen flexbox layout, with scrollbars on Codemirror box only. That’s a common layout seen on code-oriented sites like Codepen or Stackblitz. I created a minimal proof-of-concept sandbox to prove it works.

Read article
all posted tagged metaall posted tagged reactall posted tagged ts
Article  ·  Thursday, 11 March 2021
An observation regarding TypeScript and type safety

An observation regarding TypeScript and type safety

Consider a function written in TS, which multiplies two numbers…

Read article
all posted tagged jsall posted tagged ts
Article  ·  Monday, 20 June 2022
Importing SVG in Remix MDX

Importing SVG in Remix MDX

A decade ago, Chris Coyier from CSS-Tricks describedopens in a new tab ways to consume SVG, which can be distilled into two groups: to link and to embed.

Fast forward to 2022, the market has shifted from WordPress+PHP to React+TypeScript, but the same dilemma “to link or to embed?” still applies because, at the bottom of it, we’re still dealing with the same HTML and CSS as we did a decade ago.

So what’s the best way to import SVG in MDX?

Read article
all posted tagged jsall posted tagged tsall posted tagged remixall posted tagged mdx
Article  ·  Thursday, 19 May 2022
rollup vs esbuild: iife is not umd

rollup vs esbuild: iife is not umd

Back in the day, before native ES Modules, UMD builds were superior to IIFE because we could unit test them.

And while Rollup and Webpack can produce UMD, esbuild can only make IIFE, so that was an argument against using the esbuild.

Read article
all posted tagged jsall posted tagged ts

Codsen the company

UK Companies House 🏢 assigned Codsen Ltd a number #9204532 back on Friday, September 5th, 2014. That makes Codsen 8 years, 6 months and 16 days old.

Cookies

We don’t use cookies. This website only tracks anonymised website traffic via Fathomopens in a new tab which is GDPR compliant and all its data is housed exclusively in EU. Our analytics are publicopens in a new tab, see our Privacy Policy.

Activities

🐛 See a bug? Raise an issueopens in a new tab
💘 Check out the Indiewebopens in a new tab and Libera manifestoopens in a new tab

Trivia

Built with 💿 Remixopens in a new tab framework. See more in Trivia section.
Page performance: TTFBopens in a new tab loading FCPopens in a new tab loading.

Copyright

All rights reserved © Codsen Ltd 2022
All our open source packages are under MIT licenceopens in a new tab