JavaScript community
- Async State Management For Web Componentspositive-intentions.com Dim: Async State Management | positive-intentions
I'm working on creating something I can call "functional web components".
- Creating QR Codes with Javascript to use as a Data Channelpositive-intentions.com QR Codes as a Data Channel | Welcome to positive-intentions
Explore the new "File Sharing by QR Code" feature in our decentralized chat app. Learn how we use JavaScript-based QR technology for offline data exchange and the innovative potential of this experimental approach.
https://positive-intentions.com/blog/qr-codes-as-a%20data-channel
QR Codes as a Data Channel
the demo in the blog article is a bit cluncky. here is a better link for it: https://chat.positive-intentions.com/#/qr
- Getting started with Injee for JavaScript and ReactJS developers
YouTube Video
Click to view this content.
- React-Like Functional Web Componentspositive-intentions.com Todo list With Functional Web Components | Welcome to positive-intentions
I'm working on creating something I can call "functional web components".
Functional Web Components
https://positive-intentions.com/blog/dim-todo-list
Github: https://github.com/positive-intentions/dim
Demo: https://dim.positive-intentions.com
- How to create functional webcomponents
https://positive-intentions.com/blog/dim-functional-webcomponents/
im investigating an idea i have about functional webcomponents after some experience with Lit.
Lit is a nice lightweight UI framework, but i didnt like that it was using class-based components.
Vue has a nice approach but i like working with the syntax that React used and i wondered if with webcomponents i could create a functional UI framework that didnt need to be transpiled.
i think the article is already quite long, so i think i will create a separate one as a tutorial for it.
note: im not trying to push "yet another ui framework", this is an investigation to see what is possible. this article is intended as educational.
- arrival-time, a simple and powerful progress time estimation (ETA) for JavaScriptgithub.com GitHub - vitonsky/arrival-time: Simple and powerful progress time estimation (ETA) for JavaScript
Simple and powerful progress time estimation (ETA) for JavaScript - vitonsky/arrival-time
- LogTape: Simple logging library with zero dependencies for Deno/Node.js/Bun/browsersgithub.com GitHub - dahlia/logtape: Simple logging library with zero dependencies for Deno/Node.js/Bun/browsers
Simple logging library with zero dependencies for Deno/Node.js/Bun/browsers - dahlia/logtape
- Third party library mocked with Jest still tries to access internals
cross-posted from: https://programming.dev/post/12974961
> 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(); > }); >
> > When I runnpm run test
, I get the error saying: > >plain > FAIL tests/logic/actions/sendMessage.test.ts > ● should send message > > ReferenceError: fetch is not defined > > 43 | const sendMessageInner = async (messages: Message[]) => { > 44 | setMessageListState(messages); > > 45 | const result = await chatSession?.sendMessage(content); > | ^ > 46 | const responseText = result?.response.text(); > 47 | if (responseText) { > 48 | const responseMessage: Message = { > > at makeRequest (node_modules/@google/generative-ai/dist/index.js:246:9) > at generateContent (node_modules/@google/generative-ai/dist/index.js:655:28) > at node_modules/@google/generative-ai/dist/index.js:890:25 > at ChatSession.sendMessage (node_modules/@google/generative-ai/dist/index.js:909:9) > at sendMessageInner (src/logic/actions/sendMessage.ts:45:20) > at src/logic/actions/sendMessage.ts:72:7 > at sendMessage (src/logic/actions/sendMessage.ts:59:3) > at Object.<anonymous> (tests/logic/actions/sendMessage.test.ts:44:3) > >
> > ...which hints thatchatSession.sendMessage
method still uses the real implementation instead of mock. > > I'd like to know why this happens and what the solution would be. > > Thanks in advance. > > *** > > # Environment > > - Node 20.11.0 (lts/iron) > - Jest 29.7.0 > -@google/generative-ai
0.5.0 (if relevant) - Validation of javascript forms - name, password, password retype validation and Number Validation
Validation of javascript forms - name, password, password retype validation and Number Validation
It is critical to check the user-submitted form since it may include incor- rect information. As a result, validation is required to authenticate the user. Because JavaScript allows form validation on the client side, data processing is faster than server-side validation.15 JavaScript form validation is preferred by the majority of web developers. We can validate name, password, email, date, cell numbers, and other data using JavaScript. https://chat-to.dev/post?id=12 #javascript #web #programmer
- ISO a delete-in-place javascript library
ChatGPT used to have this, and there was a popular forum that had it (though I can't remember what it was/is), where, when you'd click a "delete" link, the confirmation was RIGHT THERE: "delete" faded out, "OK / Cancel" faded in. In the same space. It was really elegant and unobtrusive.
Does anyone know if there's a library out there for it? I searched over github and google, but didn't find anything, probably because I couldn't get the search terms specific enough.
- Google Announces Project IDX, an Experiemental AI-Focused Full-Stack IDEdevelopers.googleblog.com Introducing Project IDX, An Experiment to Improve Full-stack, Multiplatform App Development
Introducing Project IDX: An experimental new initiative aimed at bringing your entire full-stack, multiplatform app development workflow to the cloud.
- Favorite JavaScript related talks?
Hoping to get the ball rolling on this sub more. There’s too much action in the JavaScript scene for this community to only get a few post a month.
I’ll start with a classic, What the Heck is the Event Loop Anyway?
- Guys I need your help, where exactly the road map of Javascript Learning
Guys I need your help, where exactly the road map of Javascript Learning
- What I've been working on for the past day and a half - React Native iOS client
Video
Click to view this content.
- NakedJSX - Jsx without Reactnakedjsx.org NakedJSX - Use JSX without React
NakedJSX is a command-line tool for generating HTML files from JSX. The output is pure HTML and CSS - unless you choose to add your own JavaScript.
- Announcing TypeScript 5.0 Betadevblogs.microsoft.com Announcing TypeScript 5.0 Beta - TypeScript
Today we’re excited to announce our beta release of TypeScript 5.0! This release brings many new features, while aiming to make TypeScript, smaller, simpler, and faster. We’ve implemented the new decorators standard, functionality to better support ESM projects in Node and bundlers,
- Deno 1.30: Built-in Node modulesdeno.com Deno 1.30: Built-in Node modules
Deno 1.30 supports built-in Node modules, deno.json is an import map, deno fmt can format without semicolons, and more...
- Deno in 2022: npm, Edge Functions, Series A, Fresh, and moredeno.com Deno in 2022: npm, Edge Functions, Series A, Fresh, and more
2022 was a big year for Deno. Here are the biggest updates from the past year and what's coming up next.
- howto avoid using npm?
I'm writing some javascript (for the web) for the first time in a long time and I am realizing that I would be well served by using a bit of tooling like eslint and standardjs.
I am reluctantly willing to
apt install nodejs
but I am not willing to usenpm
because of my impression that it is a fractal of yolocurl | bash
philosophy which will randomly install and automatically run malware or indistinguishable-from-malware garbage I don't want.So, my question is: how can I install things like standardjs without using npm?
Please do not tell me that I should just use npm.
- Speeding up the JavaScript ecosystem - module resolutionmarvinh.dev Speeding up the JavaScript ecosystem - module resolution
Whether you’re building, testing and/or linting JavaScript, module resolution is always at the heart of everything. Despite its central place in our tools, not much time has been spent on making that aspect fast. With the changes discussed in this blog post tools can be sped up by as much as 30%.
- What does it look like for the web to lose? - Chris Coyierchriscoyier.net What does it look like for the web to lose? - Chris Coyier
There is always some degree of tension between “native apps” and “the web” as platforms. If you’re going to write a native app for Android devices, well, I’ll quote from the Android Developer documentation: Android apps can be written using Kotlin, Java, and C++ languages. The Android SDK tools comp...
- Top 5 Accessibility Issues in 2022 - Intopiaintopia.digital Top 5 Accessibility Issues in 2022 - Intopia
In 2022, the most critical accessibility issues were: keyboard accessibility, supporting smaller viewports/zoom, using semantic markup and ARIA attributes correctly, and managing focus visually and programmatically.
- Generative Art: Animated Gosper Curves in JS/TSblog.coderspirit.xyz Animated Gosper Curves in JS
An introduction to generative art by example, with animated Gosper Curves.
An introductory article on how to leverage some basic mathematical tricks and widely available browser APIs to generate beautiful animations.
- adryd325/oneko.js: cat follow mouse (real)github.com GitHub - adryd325/oneko.js: cat follow mouse (real). Browser port of the classic xneko/oneko program. Issues temporarily disabled due to mental health issues related to maintaining open source projects.
cat follow mouse (real). Browser port of the classic xneko/oneko program. Issues temporarily disabled due to mental health issues related to maintaining open source projects. - GitHub - adryd325/on...
- Fast, disk space efficient package manager | pnpmpnpm.io Fast, disk space efficient package manager | pnpm
Fast, disk space efficient package manager
- NodeJS packages don't deserve your trust. (a proposal for building a capabilities-based sandbox to fix this)
via https://news.ycombinator.com/item?id=30988034
- JavaScript library updated to wipe files from Russian computerswww.theregister.com JavaScript library updated to wipe files from Russia systems
Package used by big apps now drops anti-war text files on desktops
- A Proposal For Type Syntax in JavaScript - TypeScriptdevblogs.microsoft.com A Proposal For Type Syntax in JavaScript - TypeScript
Today we’re excited to announce our support and collaboration on a new Stage 0 proposal to bring optional and erasable type syntax to JavaScript. Because this new syntax wouldn’t change how surrounding code runs, it would effectively act as comments. We think this has the potential to make TypeScrip...
- A new year, a new MDN - Mozilla Hacks - the Web developer bloghacks.mozilla.org A new year, a new MDN – Mozilla Hacks - the Web developer blog
If you’ve accessed the MDN website today, you probably noticed that it looks quite different.
cross-posted from: https://lemmy.ml/post/185607
> Some questions: > > - Would you pay to use MDN? > - Do you think MDN Plus is more like a Technical support service or a way to restrict content that used to be free? > - Do you think there are other ways Mozilla can monetize?
- 3 reasons to use 'var' in JavaScript - DEV Communitydev.to 3 reasons to use 'var' in JavaScript
The var keyword was JavaScript's first way to declare a variable. It fits, right? Var, variable, it's...
- Structure and Interpretation of Computer Programs, JavaScript Edition - Wikipedia
cross-posted from: https://lemmy.ml/post/152366
> cross-posted from: https://lemmy.ml/post/152365 > > > > The book (HTML) uses JavaScript sublanguages that we call Source. > > > > playground
- Dev corrupts NPM libs 'colors' and 'faker' breaking thousands of appswww.bleepingcomputer.com Dev corrupts NPM libs 'colors' and 'faker' breaking thousands of apps
Users of popular open-source libraries 'colors' and 'faker' were left stunned after they saw their applications, using these libraries, printing gibberish data and breaking. Some surmised if the NPM libraries had been compromised, but it turns out there's more to the story.
- Announcing the Deno Company | Deno Blogdeno.com Announcing the Deno Company
We have raised money to enable the millions of web programmers out there to maximally leverage their craft.
cross-posted from: https://lemmy.ml/post/85715
> One of the great advantages of Deno is the absence of a package manager, this section is practically monopolized by two corporations (MS with npm and FB with yarn); Deno has shown itself to be a more independent ecosystem with respect to its counterpart, Node. Do you think that this decision taken by the core team was the right one? would you have preferred it to become a foundation instead of a company? Will it become a more independent solution or will it end up like Node with OpenJS? being a front entity for a few big techs that lobby the ecosystem?
- mozilla/rhino: Rhino is an open-source implementation of JavaScript written entirely in Javagithub.com GitHub - mozilla/rhino: Rhino is an open-source implementation of JavaScript written entirely in Java
Rhino is an open-source implementation of JavaScript written entirely in Java - GitHub - mozilla/rhino: Rhino is an open-source implementation of JavaScript written entirely in Java
- Asabeneh/Functional-Programming-in-JavaScript: A complete summary of functional programming in JavaScriptgithub.com GitHub - Asabeneh/Functional-Programming-in-JavaScript: A complete summary of functional programming in JavaScript
A complete summary of functional programming in JavaScript - GitHub - Asabeneh/Functional-Programming-in-JavaScript: A complete summary of functional programming in JavaScript
- sorrycc/awesome-javascript: 🐢 A collection of awesome browser-side JavaScript libraries, resources and shiny things.github.com GitHub - sorrycc/awesome-javascript: 🐢 A collection of awesome browser-side JavaScript libraries, resources and shiny things.
🐢 A collection of awesome browser-side JavaScript libraries, resources and shiny things. - GitHub - sorrycc/awesome-javascript: 🐢 A collection of awesome browser-side JavaScript libraries, resour...