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

Articles→Tag→JS

jsΣ=10

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
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  ·  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  ·  Wednesday, 16 September 2020
Why object-path package is great

Why object-path package is great

The npm package object-pathopens in a new tab is a getter/setter for nested arrays and plain objects. Here we use it directly and also align our API’s to it. Here’s why.

Read article
all posted tagged apiall posted tagged js
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
Article  ·  Friday, 02 April 2021
html-crush bug fixed

html-crush bug fixed

One line in Babel config, env preset’s loose set to true was causing a spread operator to disappear on only CommonJS builds (not ES Modules or UMD), which led to broken logic (program could not calculate opts.breakToTheLeftOf correctly any more), program inserted extra blank lines. A crazy bug, isn’t it?

Read article
all posted tagged js
Article  ·  Wednesday, 03 March 2021
codsen-parser vs. hyntax

codsen-parser vs. hyntax

Imagine the HTML: <a></b>.

Parser-wise, how would you design the AST architecture, considering cases like that?

Read article
all posted tagged js
Article  ·  Sunday, 28 February 2021
chalk vs. colorette

chalk vs. colorette

Tooling choices are a subjective matter. Lately, I’ve been observing coloretteopens in a new tab taking over erroding chalkopens in a new tab, and I have few thoughts on this subject.

Read article
all posted tagged js

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