I have a Vite+React+Typescript project where I wast trying to follow the instructions on how to install sidebar. It automatically added some styles to my index.css file. Now, the content pretty muc...
"ethics aside" truly a starter for a qa


A Practical Introduction to Derive Macros in Rust
YouTube Video
Click to view this content.
Hmm, didn't see that. Lemme play with that a little. Maybe I can come up with something. Thank you.

How do I parse the escape characters of the content of a string literal input with nom?
So, I'm basically trying to parse a string literal with nom. This is the code I've come up with:
rust
use nom::{ bytes::complete::{tag, take_until}, sequence::delimited, IResult, }; /// Parses string literals. fn parse_literal<'a>(input: &'a str) -> IResult<&'a str, &'a str> { // escape tag identifier is the same as delimiter, obviously let escape_tag_identifier = input .chars() .nth(0) .ok_or(nom::Err::Error(nom::error::Error::new( input, nom::error::ErrorKind::Verify, )))?; let (remaining, value) = delimited( tag(escape_tag_identifier.to_string().as_str()), take_until(match escape_tag_identifier { '\'' => "'", '"' => "\"", _ => unreachable!("parse_literal>>take_until branched into unreachable."), }), tag(escape_tag_identifier.to_string().as_str()), )(input)?; Ok((remaining, value)) } #[cfg(t

Third party library mocked with Jest still tries to access internals
I have a function as such:
typescript
export type SendMessageParams = { chatSession?: ChatSession, // ... other params ... }; const sendMessage = async ({ chatSession, // ... other params ... }: SendMessageParams): Promise<void> => { // await chatSession?.sendMessage() // somewhere in implementation }; export default sendMessage;
ChatSession is from @google/generative-ai
.
I'd like to mock it in my test file as such:
typescript
let defaultParams: SendMessageParams; beforeEach(() => { jest.mock('@google/generative-ai', () => ({ ChatSession: { sendMessage: async (content: string) => content, }, })); defaultParams = { chatSession: new ChatSession('', ''), // ... other params ... }; }); afterEach(() => { jest.clearAllMocks(); }); it('should send message', async () => { // await sendMessage();

NPM Unpacked Size for shields.io is now available
If you're a library developer for Javascript or Typescript, a new badge to show unpacked size of your packages is now available.
Badge URL format:
undefined
https://img.shields.io/npm/unpacked-size/npmPackageName
Firereact: React hooks, components and utilities for Firebase
React hooks, components and utilities for Firebase - erayerdin/firereact
cross-posted from: https://programming.dev/post/9577952
Firereact is hooks, component and utilities library for Firebase and React.
Features
- Very lightweight,
when unpacked,when minified,when minified+gzipped- Supports Auth, Firestore, Functions, Providers and Storage.
- Provides hooks such as
useUser
for Auth oruseDocument
for Firestore, which can

Firereact: React hooks, components and utilities for Firebase
React hooks, components and utilities for Firebase - erayerdin/firereact
Firereact is hooks, component and utilities library for Firebase and React.
Features
- Very lightweight,
- Supports Auth, Firestore, Functions, Providers and Storage.
- Provides hooks such as
useUser
for Auth oruseDocument
for Firestore, which can listen to realtime changes as well - Provides custom components such as
Thank you, I've used files
to exclude them from the bundle. :)

Vite bundles peer dependencies for library
I've been writing a hook+component library for React and Firebase, the source of which can be seen here.
It reached to a certain stability. My current goal is to reduce the size as much as possible. I've checked documents and stuff and this is the vite.config.ts
that I have:
typescript
import peerDepsExternal from "rollup-plugin-peer-deps-external"; import { defineConfig } from "vite"; import dts from "vite-plugin-dts"; import { peerDependencies } from "./package.json"; export default defineConfig({ build: { lib: { entry: "./src/index.ts", // Specifies the entry point for building the library. name: "firereact", // Sets the name of the generated library. fileName: (format) => `index.${format}.js`, // Generates the output file name based on the format. formats: ["cjs", "es"], // Specifies the output formats (CommonJS and ES modules). }, rollupOptions: { external: [...Object.keys(peerDependencie
Yep, tried ChatGPT on that but screwed up the project and had to revert back to an older tag for it, but I will try this surely.

Help me understand module system in ES
I've decided to write my first library in Typescript, which is here.
I've got some questions that I don't think is suitable for StackOverflow because it's quite case-specific rather than being generic and I've got a couple of them rather than one.
I'm trying to wrap my head around JS/TS module system for some while. There are some problems with my library:
- If a user imports a hook, they have to do
import { useDocument } from 'firereact/firestore/useDocument'
, but it'd be much better if they could doimport { useDocument } from 'firereact/firestore'
. I've tried many ways but I couldn't export it tofirestore/index.ts
I guess. What am I doing wrong? - I have realized that consumers can also import test modules and
firebase.ts
, which are only used for testing and it is not desirable for them to be imported by the consumers. How can I ignore some specific exports while bundling? They are meant to be used internally.
Thanks in advanc
Using an array and unpacking seems the most genius hacky solution to this problem. Imma go with that I guess.

How can I render a custom component in head
with React Helmet?
I use React Helmet. I wanted to inject social meta tags in some of the pages. In order to DRY, I wanted to define these social meta tags as a separate component, which looks as below:
typescript
type SocialMetaProps = { title: string, description: string, } const SocialMeta = ({ title, description }: SocialMetaProps) => { return ( <> <meta property="og:title" content={title} /> <meta property="og:description" content={description} /> <meta property="og:url" content={window.location.href} /> <meta property="twitter:title" content={title} /> <meta property="twitter:description" content={description} /> <meta property="twitter:url" content={window.location.href} /> </> ) } export default SocialMeta
...which looks as such when I use it in a page:
typescript
<Helmet> <title>{resource.title}</title> <SocialMeta title={resource.title} description={resource.shortDescription} /> </Helmet>
The problem with that is that

Freelancing (?) programmers here: How do you estimate how many scrum points a specific project will require? Is there a template?
I know this is kind of a soft problem and is highly dependent on the context of a project.
For my own projects, I use scrum points to estimate how much effort it will require to reach to a certain point. I measured my throughput and it seems like, with the amount of time left from my daily job, I can complete around 100 points every month.
Recently, this idea is stuck in my head. Every (web/mobile) project requires a certain set of requirements such as:
- Authentication and authorization
- Performance metrics and logging
- Storage
- CRUD for each model etc.
Of course, mostly through Firebase.
I was wondering if there's a way, a website or a platform maybe, to define a list of features/stories and get an estimated total points.
This is the guy who has 10 years experience on a 1 year old framework.
I've even installed a browser extension to filter Medium from Google search results. Their pricing is not reasonable nor localized.
Waiting for that 2.0.49 version

Omniscient - A simple process manager and system information app powered by Tauri, Rust, NextJS and Typescript

Contribute to erayerdin/omniscient development by creating an account on GitHub.

This is a process manager and system information app I've written by using Tauri. I've done it to see how Tauri works. PRs are welcome.