Coder Social home page Coder Social logo

Net v2.0.0 about rbx-net HOT 5 CLOSED

roblox-aurora avatar roblox-aurora commented on May 27, 2024 2
Net v2.0.0

from rbx-net.

Comments (5)

Vorlias avatar Vorlias commented on May 27, 2024 1

With v2, I'm contemplating fully removing function objects in favour of the async functions (RemoteEvent driven functions). Much friendlier for tools like NoahWillCode's event log, and also actually supports using async callbacks and calling clients.

from rbx-net.

Vorlias avatar Vorlias commented on May 27, 2024

The middleware in RbxNet is typed similarly to Rodux now.

e.g. converting an "id" to an NPC

const toNPC: Middleware<[NPCEntity], [string]> = (next) => {
    return (sender, npcId) => {
        const npc = NPCManager.GetNPCById(npcId);
        if (npc) {
            next(sender, npc); // this will pass the NPC as an argument
        }
        // If `next` is never called, it will silently fail. I'm considering a sort of "reject" function as well.
    }
};

const TradeWithNPC = new Net.ServerEvent("TradeWithNPC", [Net.Typed(t.string), toNPC]);
TradeWithNPC.Connect((player, npc) => {
    // npc is of type NPCEntity
});

from rbx-net.

Vorlias avatar Vorlias commented on May 27, 2024

I'm considering now moving the connect-related middleware to the connect function itself. Probably a more sensible option. :?

from rbx-net.

iamacup avatar iamacup commented on May 27, 2024

Hey

A couple of points on the state of 2.x - It looks great!

  • The majority of the code seems to need to be wrapped with /* eslint-disable roblox-ts/no-any */ to stop fatal linting errors (for default rules from roblox-ts) - i assume this is because the types are not finalised yet? i might be able to help if thats the case.
  • It looks like git is out of sync with NPM and/or the docs are versioned wrong - 2.0.0.alpha.7 is the latest version on master at git but NPM has 2.0.0.alpha.6

I submited a docs-only pull request to fix up some errors in the 2.x docs as well :)

great work!

from rbx-net.

Vorlias avatar Vorlias commented on May 27, 2024

Hey

A couple of points on the state of 2.x - It looks great!

* The majority of the code seems to need to be wrapped with `/* eslint-disable roblox-ts/no-any */` to stop fatal linting errors (for default rules from roblox-ts) - i assume this is because the types are not finalised yet? i might be able to help if thats the case.

* It looks like git is out of sync with NPM and/or the docs are versioned wrong - `2.0.0.alpha.7` is the latest version on master at git but NPM has `2.0.0.alpha.6`

I submited a docs-only pull request to fix up some errors in the 2.x docs as well :)

great work!

Haven't run into any linting issues with the roblox-ts linter, although it is a bit buggy and usually vscode requires a restart if that happens.

The NPM version should be updated to 2.0.0-rc.0 in a moment. This should be a more akin to what the release will look like. (which includes changes from .7)

from rbx-net.

Related Issues (20)

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.