Introducing Require-by-String

Honestly, it should just default to the current script if no dots are placed, that would actually make it faster since you could technically type just require("childScript"). I don’t know if this isn’t possible for whatever reason but it would be way more convenient.

No clue why they would purposefully make it less convenient than script.childScript but like whatever

image

3 Likes

Wait… doesn’t the single dot mean sibling?

1 Like

Wow, never thought I’d see the day. Thank god we can use relative paths now.

Only took like what? 18 years?

I’m starting to think that NPM is going to follow me everywhere. I’m not really a fan of this. I get why its useful and the purpose but, it takes away clarity as to where those paths (from alias) derive from.

A bit scared as to how Roblox would implement this if they chose that route.

1 Like

bro this is crazy update for the roblox IDE, i love it!!11

this is better for us, thanks!

was this a beta feature before? because I was able to require modules by strings for a long time and it marked type errors with strict mode, but it didn’t autocomplete like it’s now which is a great thing

meh addition. at first, i was under the impression that you could use global references

also for anyone who has module scripts scattered around and don’t want the hassle of typing the full path to them, might as well assign tags for your module scripts and use CollectionService to retrieve. i’m using this approach when i’m editing someone’s messy workspace

2 Likes

didn’t know you could use do that, i always use CollectionService not in it’s intended purpose, merely just to run server code on the client (i.e script that usually runs a infinite loop to change a few properties of an object)

This feature is AMAZING I am so excited to use this omg

Unironically dot requires are better when string requires were ment to be a fix. :sob:
Because at least i can just type script and not the scripts name.

4 Likes

no it was a unannounced thing like how one could use the new audio api stuff before it was announced, albeit this time it only worked in studio

require by string does not work in the studio command-line

I quite don’t get it. Why are people dissatisfied with this? For example, C and C++ use the exact same system.

1 Like

This is amazing!

As a person who uses many Modules, imagine the amount of code i can save with this new feature! Roblox Studio seems to be evolving very fast!

I think it’s because people expected aliases to also be released in the same time.

1 Like

incredibly solid, can increase efficiency in coding work

I prayed for days like this
image
This is pretty nice, wondering if aliasing is also planned.

2 Likes

you are correct, and the user you’re replying to is using it correctly as well. single dot accesses the scripts current directory (e.g. script.Parent ) and two dots for the parent dir (e.g. script.Parent.Parent ) normal roblox instance hierarchy just doesn’t explain this intuitively

1 Like