Giter Site home page Giter Site logo

tpy's Introduction

๐Ÿ‘‹ Hey, I'm insyri, a highschool student who does software engineering as a hobby.

I started programming seriously in 2021-2022, creating developer tools and small projects. From then, I've evolved to become more intentive and careful with the way I create programs, investigating optimizations heavily within my study.

I'm currently studying Linear Algebra (leading into computer graphics), models of computation, the history and philosophy of mathematics and efficient memory management practices for system-critical programs. I apply these bits of knowledge into some projects of mine, but eventually, I plan to create programs specific to these topics to prove my own mastery to myself.

I'm currently the president of computer science club at my school, providing an introduction to programming architecture and software tooling by developing mini-programs (like Michele Pratusevich's Terminus) and encouraging students to go out and make something they've always wanted to makeโ€” you wanna make a game on Roblox? Go for it, I'll help you find resources.

Before the summer, I showed just how approachable computer science is with the right mindset; from building a simple snow program (with written assessments and proposals of the code!) to hosting an (incomplete) course on learning software development. Over the summer, I'm teaching students the Kotlin programming language. When we come back, we'll be building an app to save students from missing their buses at school.

๐ŸŒŒ software socials

๐Ÿ–ฅ development information

๐Ÿ— projects

rsource is a project aimed to create services around the Roblox StrafesNET ecosystem, including map development support, game unifying creations, and constructing transcendent experiences. View the full introductory showcase at the rsource github organization and at the rsource website.

Note

This project has been postponed and temporarily discontuned as the StrafesNET API, the services that this project is built on, has been out of commision for a long time, and has no anticipated reinstitution date.

A strongly typed Pylon API client. https://pylon.bot/

CI

๐Ÿ“‚ Server for pasting, uploading, and downloading files.


๐Ÿซ learning soon

tpy's People

Contributors

dependabot[bot] avatar dowoge avatar github-actions[bot] avatar insyri avatar liamhtml avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

liamhtml

tpy's Issues

Custom error handlers in `httpRaw()`

Some endpoints have different implications to each kind of HTTP response code, for example, not all 500s are internal server errors, they could be authentication mismatching in specific context.

Array<{
  // Determines if case is applicable; number for HTTP status code, or
  // a function that takes the response object and returns the validity.
  case: number | (r: Response) => boolean,
  // Function to run if `case` matches the response's HTTP status code
  // or is true.
  fn: () => void,
}>

Proposals

  • Add parameter that specifies an array of cases and functions.

Conflicting stylization of tpy

Is it be "Tpy" or "tpy"? I've seen both in documentation. A convention should probably be established and stuck with.

Silent behavior on no body responses

Abstract

The httpRaw method (concerned portion shown below) has a defect where it will resolve the function normally if there is no body. This skips type checks since the empty response it is casted to the generic type of the expected structure and thus lies to users. Without knowing the internal functionality of how it resolves this case, users may find unexpected bugs that can skip this check. Of course, this method isn't exactly expected to be adopting use in projects depending on Tpy, however, since the method is made public, it should be able to be used as normally.

tpy/src/tpy.ts

Lines 350 to 354 in 6c9a2ca

const body = await response.text();
if (response.ok) {
// This is bad, I know. You fix it. Please.
return (body.length === 0 ? {} : JSON.parse(body)) as unknown as T;
}

This original functionality was created with the KV put operations in mind (see put and putArrayBuffer; notice the methods do not capture the response) since those endpoints return no body. If I remember correctly, the reason behind this design choice was to avoid some type collisions internally, mostly a lazy -or uneducated- solution.

Proposal

I imagine those who are accessing endpoints that return no body expect this behavior, this leads me to believe that the proper approach to this would be to tell the type system to expect this, negating the generic type (if there is one) entirely and returning nothing at all or some nullish value.

Since we would also be changing the logic, this would go beyond the type system and implemented into the method itself. This may entail an extra parameter and maybe a type parameter (or at least a conditional operation) to follow this process of logic.

Reconnecting WebSocket on Node.js

Reconnecting WebSockets in TpyWs work in Deno, but not in Node.js. Whether this issue is related to runtime differences or subtle changes in core implementation, there is a better way to implement the reconnecting WebSocket.

Proposals

  • Asynchronous generator function to await and loop over closing events.

`TpyError` enhancements

  • Use cause inside TpyError instead of determination.
  • Add documentation to resolve between message and description.
  • (?) Remove messageContext from public use.

Meta-issue of release TODO's

Main

  • #21
    Reconnecting WebSockets in TpyWs work in Deno, but not in Node.js. Whether this issue is related to runtime differences or subtle changes in core implementation, there is a better way to implement the reconnecting WebSocket. (Idea: Asynchronous generator function to await and loop over closing events.)
  • #20
    Some endpoints have different implications to each kind of HTTP response code, for example, not all 500s are internal server errors, they could be authentication mismatching in specific context. (Idea: add parameter that specifies an array of cases and functions.)
    Array<{
      // Determines if case is applicable; number for HTTP status code, or
      // a function that takes the response object and returns the validity.
      case: number | (r: Response) => boolean,
      // Function to run if `case` matches the response's HTTP status code
      // or is true.
      fn: () => void,
    }>

Subsequent

  • #18
    • Use cause inside TpyError instead of determination.
    • Add documentation to resolve between message and description.
    • (?) Remove messageContext from public use.
  • #22
  • #16
    • Guild.GET.Guild resolves type proper type instead of any.
  • #19

Documentation Todos

(updated from d50b887 to 8a5c7be)

The following need documentation completion. Of tree 8a5c7be.

types/deployments.d.ts

Problem: unknown reason of existence.

Problem: said below.

// TODO: Find pylon's cron specification and document it Deployments.Structures.CronTask.

Problem: unknown reason of existence.

types/guild.d.ts

Problem: only appears as null, need to find it's !null value.

// TODO: specify Guild.GET.Info["deployments"]["last_updated_at"] type.

  • GET.Stats:
    kvOperations, executionMsAvg, cpuMsAvg, events,
    discordApiRequests

Problem: values are sometimes absent, need to find why.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.