git clone https://github.com/bogeeee/restfuncs.git
cd restfuncs
npm install --ignore-scriptsThis autoinstalls dependencies for every sub-package / workspace ;)
npm run tests
You would want to test your code changes with the examples, or use them as a playground, then (from the root):
npm run buildThis compiles the transformer and the /**/dist/mjs which are what's used from the browser/vite bundler. Then cd into the examples and npm run dev then.
eventually remove the /package-lock.json if examples still stick to old packages
Instead of the super slow npm run build from the root package, you could try dev:fastbuild (but does not rebuild the client for the browser) or look at dev:playground. Just try what works best.
cookieSessionmeans the raw session from the cookie. ContraryServerSessioninstances may have the same fields, as these are copied/mapped, but a different lifecycle: it can exist, even if the cookieSession is not yet initialized (there was no cookie sent)Serviceis often used as a synonym forServerSession- **class**. Often used, when referred in the static context / the static fields of that class, i.e. theoptions`.socketvs.http side: Refers to, that the communication goes either through an engine.io socket (websocket or similar) vs. through classic http requests. The classic http client-server communication was implemented first and is considered the always available and the source of truth when it comes to holding the cookie session or deciding whether requests are allowed.Meta: Information, about a remote method which is added at compile time.Callback, orClientCallback: A function that is sent from the client to the server as an event-callback (see the event-callback feature in readme.md)Downcall: When the server calls such a callback function (a call from the server to client).
ChannelItem: A ClientCallback, UploadFile or a Stream.DTO/ChannelItemDTO: As the above can't be serialized directly, a handle to these is sent to the server.
- Read ServerSession breakdown.
- Read ServerSocketConnection breakdown
- Advanced: Read, how ClientCallbacks work from a security perspective, then study the
ServerSocketConnection#handleMethodCall_resolveChannelItemDTOsmethod and theServerSession#validateMethodArgumentsmethod.