---
title: "A way to automatically generate regexes from examples"
publication: "JavaScript Weekly"
issue: 602
published_at: "2022-08-12"
canonical_url: "https://javascriptweekly.com/issues/602"
---

Plus TypeScript 4.8 RC, why the UK government ditched jQuery, and let's play some code golf. |        

#​602 — August 12, 2022 

[Unsubscribe](https://javascriptweekly.com/leave/*|UID|*)|[Read on the Web](https://javascriptweekly.com/issues/602)   

☀️ We're taking a rare week off next week for a brief summer vacation so there won't be any issue on August 19 – we'll be back on August 26, complete with a sun tan wind burn, and all the latest JavaScript news, of course :-)
__
_Peter Cooper, your editor._  

JavaScript Weekly  

[Astro 1.0: The Fast Islands-Based Frontend Framework](https://astro.build/blog/astro-1/) — Despite its relative youth, Astro has had a big impact already with a wide range of users and support for, well, almost every other framework or dev tool going. It's based around ‘islands’ where fast HTML can stand in for components which can then be lazily loaded in as user interactions demand. 1.0 introduces new image and picture components, MDX/Markdown support, and SSR builds. There’s [a new homepage](https://astro.build/)too. 

Fred Schott   

[Patterns.dev: Modern Web App Design Patterns](https://www.patterns.dev/) — A free book you can download in PDF format or enjoy on the Web. Learn about lots of fundamentals, from how different styles of rendering or importing resources work to performance optimizations and case studies. There’s a lot to enjoy and [a fantastic team](https://www.patterns.dev/about/) behind it, too. 

Lydia Hallie, Addy Osmani, and Others   [![\](https://copm.s3.amazonaws.com/71dd1128.png)](https://www.grapecity.com/developer-use-cases/javascript-spreadsheet-tools?utm_source=CooperPress&utm_medium=JavaScript-Weekly&utm_campaign=SpreadJS-JS-Weekly-Primary-Sponsor-8-22) 

[Add Excel-Like Spreadsheet Experiences to Your JS Apps](https://www.grapecity.com/developer-use-cases/javascript-spreadsheet-tools?utm_source=CooperPress&utm_medium=JavaScript-Weekly&utm_campaign=SpreadJS-JS-Weekly-Primary-Sponsor-8-22) — SpreadJS is the industry-leading JavaScript spreadsheet for adding advanced spreadsheet features to your enterprise apps. Build finance, analysis, budget, and other apps. Excel I/O, 500+ calc functions, tables, charts, and more. [View demos now](https://www.grapecity.com/developer-use-cases/javascript-spreadsheet-tools?utm_source=CooperPress&utm_medium=JavaScript-Weekly&utm_campaign=SpreadJS-JS-Weekly-Primary-Sponsor-8-22). 

SpreadJS from GrapeCity sponsor   

**IN BRIEF:** 

- Three months on from 4.7, [TypeScript 4.8 is now in release candidate stage.](https://devblogs.microsoft.com/typescript/announcing-typescript-4-8-rc/) Most of the enhancements relate to inference, type narrowing, and file watching.
- 🔒 [GitHub is proposing to use SigStore](https://github.blog/2022-08-08-new-request-for-comments-on-improving-npm-security-with-sigstore-is-now-open/) as a way for users and tools to verify npm package provenance as a way to improve security.
- The [▶️ latest episode of the TC39er podcast](https://tc39er.us/posts/episode-21-robin-ricard/) features an interview with Bloomberg's Robin Ricard, known for his work on the [Records and Tuples](https://github.com/tc39/proposal-record-tuple) proposal.
- Lizz Parody walks us through [the proposal to support type annotations](https://fusebit.io/blog/type-annotations-javascript/) within _JavaScript_ code (yes, not TypeScript!)   

**RELEASES:** 

[Playwright 1.25.0](https://github.com/microsoft/playwright/releases/tag/v1.25.0) – Browser remote control and runner toolkit.
 [Lerna 5.4](https://github.com/lerna/lerna) – Build system for multiple JS projects in one repo.
 [Fastify 4.4](https://github.com/fastify/fastify) – Fast, low overhead web framework.
 [NodeBB 2.4](https://github.com/NodeBB/NodeBB) – Node.js based forum software.
 [Color.js 0.4](https://github.com/LeaVerou/color.js/releases/tag/v0.4.0) – Color conversion & manipulation library.  

📒 Articles & Tutorials 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/nwmbqmtmmobotkw37kbi.jpg)](https://getbutterfly.com/code-golfing-tips-tricks-how-to-minify-your-javascript-code/)  

[Code Golfing Tips and Tricks for Smaller JavaScript Code](https://getbutterfly.com/code-golfing-tips-tricks-how-to-minify-your-javascript-code/) — Writing code that’s as terse as possible isn’t _usually_ desirable – it's not fun for your coworkers, and your build process might minify your code anyway! But if you _need_ to squeeze into as few characters as possible and some messiness is tolerable.. this is a thorough list of ideas and a learning experience in its own right! (_Much of this comes from [this classic "byte saving techniques" page,](https://github.com/jed/140bytes/wiki/Byte-saving-techniques) BTW_.) 

Ciprian   

['How and Why We Removed jQuery from GOV.UK'](https://insidegovuk.blog.gov.uk/2022/08/11/how-and-why-we-removed-jquery-from-gov-uk/) — We’ve mentioned the UK government digital team’s culling of jQuery in passing a few times this year, but now there’s a (brief) explanation of how it happened. 

Andy Sellick (GDS)   

[How to Monitor a Node.js Application](https://newrelic.com/blog/best-practices/nodejs-application-monitoring?utm_source=javascript-weekly&utm_medium=community&utm_campaign=global-fy23-q2-nodejs-application-monitoring) — Set up monitoring for an open source application with New Relic using instant observability for Node.js quickstart. 

New Relic sponsor   

[How To Use Multithreading in Node.js](https://www.digitalocean.com/community/tutorials/how-to-use-multithreading-in-node-js) — A practical walkthrough to how Node uses threads and how and why you might use worker threads yourself in a web app. 

Stanley Ulili (for DigitalOcean)   

▶[Record and Tuple: Immutable Data Structures in JS](https://portal.gitnation.org/contents/record-and-tuple-immutable-data-structures-in-js) — A JSNation 2022 talk looking at the motivation behind a proposal currently advancing through TC39. _(22 minutes.)_ 

Robin Ricard   

[Modelling Stable Fluids with Three.js](https://mofu-dev.com/en/blog/stable-fluids/) — Math, math, shaders, and more math. 

Misaki Nakano   

[Will Bun Take Node's Crown?](https://semaphoreci.com/blog/javascript-bun) — Another comparison. 
Tomas Fernandez opinion   

▶[Let's Build Tetris: A Multi-Part Series](https://www.youtube.com/playlist?list=PLfJ9SccGPvnWzW1qm2sGTG3O0SIwIIbhq#tetris) 
Joe Boyle  

🛠 Code & Tools 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/mxerxpa8uawbvvhq4znd.jpg)](https://pemistahl.github.io/grex-js/)  

[Grex: A Way to Generate Regular Expressions from Provided Examples](https://pemistahl.github.io/grex-js/) — This demo is quite fun to play with. Grex is a Rust-based improvement of a JavaScript project which, by way of WebAssembly can be used from JavaScript once again. It’s quite a neat idea and while it’s not perfect, it can provide you with some inspiration for crafting regexes. [GitHub repo](https://github.com/pemistahl/grex-js). 

Peter M. Stahl   

[Cloudscape: AWS's React Component Design System](https://cloudscape.design/) — Built for and used by Amazon Web Services, you get [66 components](https://cloudscape.design/components/overview/), opinionated guides on design best practices, and [many demos](https://cloudscape.design/demos/overview/). 

Amazon Web Services   

[Don’t Let Your Issue Tracker Be a Four-Letter Word. Use Shortcut](https://shortcut.com/?utm_source=cooperJSWeekly&utm_medium=spon_nl&utm_campaign=prospecting&utm_content=fourletter) — The best issue tracking software is one that software developers are actually happy to use. 

Shortcut (formerly Clubhouse.io) sponsor   

[Million 1.12: A Fast and Small Virtual DOM Implementation](https://millionjs.org/) — Focused on performance and shipping at under 1KB compressed, Million is ideal if you want an agnostic VDOM implementation to use when building your own framework or just to go a little lower level. _“Think of it as if React’s API and Svelte’s compiler had a baby.”_ 

Million   

[React Rating: Easy Star Ratings Component](https://react-rating.onrender.com/) — SVG-based. No dependencies. Check out [the many examples](https://react-rating.onrender.com/) to see if it gets your ⭐️⭐️⭐️⭐️⭐️ 

Simone Mastromattei   

[Size Limit 8.0: Performance Budgeting Tool for JavaScript](https://github.com/ai/size-limit) — Calculate the real ‘cost’ to run your JS app or lib to maintain an eye on performance and raise an error (in CI, say) when things go awry. Supports ES modules and tree shaking. 

Andrey Sitnik   

[svg2pdf.js: Browser Based SVG to PDF Converter](https://github.com/yWorks/svg2pdf.js) — There’s an [online playground](http://raw.githack.com/yWorks/svg2pdf.js/master/) to give you a feel for what it can do. 

yWorks GmbH   

[brotli-wasm: Brotli Compressor and Decompressor](https://github.com/httptoolkit/brotli-wasm) — Covers both Node _and_ the browser by means of WebAssembly. 

HTTP Toolkit   

[Never Code an Email API Template Again](https://www.courier.com/?utm_campaign=demand-gen&utm_source=email&utm_medium=javascript-weekly-8-12&utm_content=email-api-homepage) 

Courier.com sponsor   

[Grakkit: A Modern JS Dev Environment for Minecraft](https://github.com/grakkit/grakkit) — Brings together JS and Minecraft by way of GraalVM. 

Grakkit Project   

[React Colorful 5.6: A Small Color Picker Component for (P)react](https://omgovich.github.io/react-colorful/) — Nice demo that changes the color of the homepage. 
Vlad Shilov   

[React DayPicker v8: A Date Picker Component](https://react-day-picker.js.org/) 
Giampaolo Bellavite   

[string-left-right: Find the First Non-Whitespace Character to the Left or Right of a Given Index](https://www.codsen.com/os/string-left-right/) 
Roy Revelt   

**OTHER QUICK RELEASES:** 

[Jayson 4.0](https://github.com/tedeh/jayson) – JSON-RPC client/server for Node.
 [vite-plugin-eslint 1.8](https://github.com/gxmari007/vite-plugin-eslint) – ESLint plugin for Vite.
 [Faker 7.4](https://github.com/faker-js/faker) – Generate massive amounts of fake data.
 [COBE 0.6](https://github.com/shuding/cobe) – 5KB WebGL globe lib. ([Demo.](https://cobe.vercel.app/))
 [html-to-image 1.10](https://github.com/bubkoo/html-to-image) – Generate images from DOM nodes.
 [Juice 8.1](https://github.com/Automattic/juice) – Inlines CSS stylesheets into your HTML source.     

💻 Jobs  

[Node.js Developer (Remote or Warsaw)](https://cksource.com/careers/?utm_source=jsweekly&utm_medium=email&utm_campaign=aug12#node-js-developer) — Join our backend team responsible for CKEditor Cloud Services and develop an Open Source product used by millions of users worldwide. 
CKEditor   

[Find JavaScript Jobs with Hired](https://hired.com/join/?utm_source=newsletter&utm_medium=sponsor&utm_campaign=%28b2c%29%28l-all%29%28r-all%29%28cooper-javascriptweekly%29&utm_content=find-your-next-job) — Create a profile on Hired to connect with hiring managers at growing startups and Fortune 500 companies. It's free for job-seekers. 
Hired      

😮 **WOW OF THE WEEK**  

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/hzxxj5qzwaimdiv6skwp.jpg)](https://www.youtube.com/watch?v=-xJZ9I4iqg8)  

If you've got a few minutes, [▶️ this video of a recent winning 'demo'](https://www.youtube.com/watch?v=-xJZ9I4iqg8) from a demoscene contest is pretty mindblowing. 

The code was written in 2022, but is running on a 1981 IBM PC using CGA graphics and if you're old enough to have used such a machine (like me!) it's amazing what they've managed to squeeze out of it. As one commenter (Jeff Haluska) said: _"I have been programming for about 25 years and Area 5150 has me questioning everything I know about computers."_         

Published by [Cooperpress](https://cooperpress.com/) and edited by [Peter Cooper](https://twitter.com/cooperx86) 

'JavaScript' is a trademark of Oracle Corporation in the US
We are not endorsed by or affiliated with Oracle. 

[Change your email address](https://javascriptweekly.com/edit_subscription/*|UID|*) or [stop getting this newsletter](https://javascriptweekly.com/leave/*|UID|*). 

© Cooper Press Ltd · Fairfield Enterprise Centre, Louth, LN11 0LS, United Kingdom
