Blink | An IDL compiler written in Luau for ROBLOX buffer networking. | 0.14.8

There were some issues around nested maps following this release, please upgrade to the patched latest release instead

2 Likes

Iā€™ve been using Blink for a few projects so far and itā€™s all been fine, I love it :+1:
Any chance the plugin could be uploaded to marketplace and updated there too?

1 Like

Glad to hear youā€™ve found it useful, if you have any published games Iā€™d be happy to link them on the README if youā€™re fine with that

Iā€™m currently waiting for ROBLOX to release support for updating plugins through Open Cloud, Iā€™d like to be able to just have a github action auto update the marketplace version with every release. Though Iā€™m also looking into alternatives like using the old cookie based endpoints for the time being since there havenā€™t really been any news about Open Cloud support for it since some time.

3 Likes

Blink 0.12.2

This release contains bug fixes and minor additions.

There is an issue with the Roblox Studio plugin in 0.12.2, I recommend sticking to 0.12.1 until a patch can be released

Added

  • Added a --yes / --y option to the CLI, passing it will result in all prompts being automatically accepted

Improvements

  • Added set autocompletion to the Roblox Studio companion plugin

Fixes

  • Fixed float16 struct values generating incorrect luau syntax
  • Fixed squiggly lines not rendering in the Roblox Studio companion plugin due to ROBLOX font changes
  • Fixed error hover information not being moved to the mouse when hovering over an error
2 Likes

Gonna be a while before they release, but Iā€™m really thankful for this system honestly. I was this close to just making my own networking thing ala Zap except in Studio, Blink is a godsend for those of us who donā€™t use Rojo or external tooling (yet)

Gotcha. I donā€™t mind checking github / this thread for updates and doing the ole drag nā€™ drop until then haha

2 Likes

Blink 0.13.0

This release contains new features and fixes.

Added

  • Added new --watch option to the CLI #9
  • Added ManySync and ManyAsync call types

Fixes

  • Fixed parser resolving imports from the entry file instead of from the file that made the import
3 Likes

Might look into this to replace knit in a bowling game Iā€™ve been working on with a team

Blink 0.14.0

This release contains new features and fixes.

https://github.com/1Axen/blink
https://github.com/1Axen/blink/releases/tag/v0.14.0

Added

  • Added an event polling API, check out the docs for an example.
  • Added struct merging using ..[IDENTIFIER], check out the docs for an example.

Fixes

  • Manual replication function now respects casing option.
3 Likes

Blink 0.14.8

This release contains improvements and bug fixes.

https://github.com/1Axen/blink
https://github.com/1Axen/blink/releases/tag/v0.14.8

Studio plugin is now available on the creator store, you can find it here:
https://create.roblox.com/store/asset/77231976488966/Blink-Editor

Improvements

  • Studio Plugin now has a more unique icon, thanks to @checkraisefold for making it.
  • Studio Plugin buttons are now much more reliable.
  • Typescript functions now output Promise<T> when using yield: Promise.

Fixes

  • Fixed multi-line comments not working.
  • Fixed Studio Plugin generation errors being unreadable.
  • Fixed Studio Plugin not loading saved files if it remained open in-between Studio sessions.
1 Like

https://create.roblox.com/store/asset/77231976488966/Blink-Editor doesnā€™t work

it just says ā€œYou need permissions to access this contentā€

Thatā€™s embarrassing, should be fixed now!

2 Likes

oh yea
i have a suggestion
you can try implementing something called ā€œthread recyclingā€
from what I know, it helps with performance bc garbage collector doesnā€™t constantly clean up a threads like task.spawn, and instead re-uses a thread constantly when possible
GoodSignal and FastSignal do this, apparently

hereā€™s one implementation, you can use this the same way you use task.spawn

local FreeThread: thread?
local function RunInThread<T...>(func: (T...) -> (), ...: T...): ()
	local HoldThread = FreeThread :: thread
	FreeThread = nil
	func(...)
	FreeThread = HoldThread
end

local function CreateThread(): ()
	FreeThread = coroutine.running()
	while true do RunInThread(coroutine.yield()) end
end

local function spawn<T...>(functionOrThread: (T...) -> () | thread, ...: T...): thread
	if type(functionOrThread) == "thread" then return task.spawn(functionOrThread, ...) end
	if not FreeThread then task.spawn(CreateThread) end
	return task.spawn(FreeThread :: thread, functionOrThread, ...)
end

might be useful for things like ManyAsync events + a lot of .On

1 Like

How to send arrays through an event, I used maps as [u8]: string but that didnt work.

BlinkServer.SendMap:FireAll({[1] = selectedMaps[1], [2] = selectedMaps[2] ,[3] = selectedMaps[3]})

OR

BlinkServer.SendMap:FireAll(selectedMaps)
  10:40:40.682  ReplicatedStorage.Blink.Server:243: invalid argument #3 to 'writeu8' (number expected, got string)  -  Server - Server:243
  10:40:40.683  Stack Begin  -  Studio
  10:40:40.683  Script 'ReplicatedStorage.Blink.Server', Line 243 - function WriteEVENT_SendMap  -  Studio - Server:243
  10:40:40.683  Script 'ReplicatedStorage.Blink.Server', Line 482 - function FireAll

I get this error

You can declare an array of string like so:

type array = string[]

Event methods are called with a . instead of a :, using the latter will lead to undefined behaviour.
Ex: Blink.Event.FireAll() instead of Blink.Event:FireAll()

2 Likes

is there a way to send varargs through events?

You can use unknown:

event varargs {
	data: unknown[] ā€” an array of unknown
}
ā€” sender
blink.varargs.fire({ā€¦})
ā€” receiver
blink.varargs.on(function(args)
end)
1 Like

How do I send a table with different types of arguments such as strings, numbers ,booleans and etc. in one event to the client?

If itā€™s a mixed table (they can be at any arbitrary position) then unknown is your best bet, if they are always at the same position then consider switching to a struct or a type pack (tuple).

For example, If i fire an event every heartbeat from the server to the client, is it a typical behaviour for client to receive 3.5-5 kb/s if the event has no arguments?

Even if i dont limit the heartbeat function by using ticks, shouldnā€™t the packet size be like:

60 (fps) * 9 bytes (size of remotevent) + 2 bytes (empty table given as argument in the event) = 542 bytes that is NOT equal to 3-5kb

Hi, I just tried to use this but the 0.15.0 version gives error when i downloaded the plugin file in the releases page and opened up roblox studio. Error was:
Path must begin with either ā€˜./ā€™ or ā€˜ā€¦/ā€™: @lune/stdio
Script ā€˜user_Blink_plugin.rbxm.pluginā€™, Line 1062 function i
Script ā€˜user_Blink_plugin.rbxm.pluginā€™, Line 8 function load

Is it because I named the plugin file instead of just downloading what it was set to in the releases?