Comments (5)
For instance let’s say you have a server-sided component that has a default attribute and is connected to a tag. On the client you might want to get that component’s instance by tag and see it’s default attribute. You could just set the default attributes by hand but this is just a bit of quality of life and I don’t think it would be too costly.
Also I might be missing something but @Zyrakia said “modifying the attributes object will not result in any changes on the actual instance“ but on the documentation it states “The attributes object on components is mutable, so you can change the value and it'll change in both the component's copy and on the instance.”
So if the defaults are setting the attributes on the attributes object, and the attributes object is linked to the instance, it would appear from the documentation that defaults set attributes on the instance.
from core.
rbxts-flamework/components@2cee8e9
from core.
I believe this is intentional, modifying the attributes object will not result in any changes on the actual instance. Invalid or missing attributes on the instance are only ignored, not modified.
from core.
As said by @Zyrakia, this is intentional behavior. I'm open to hearing use cases on why you want the defaults to be added onto the instance, though.
from core.
I agree, this behavior is both undefined and confusing and limits my use case. They should be synced IMO, otherwise the “attributes” name is misleading
from core.
Related Issues (20)
- Compiled output is nonsensical HOT 1
- Macro nesting doesn't work if done between class methods
- Add a cleanup function for components, for when they are removed HOT 1
- Modding.Generic<T, "guard"> fails to pass nominal types due to intersection with primitives
- MacroManager could not find method for Vector2.idiv HOT 1
- Incorrect documentation for `ignite`
- More extensive way to enable verbose logging. HOT 1
- "delete" keyword on Component attributes does not remove the attribute HOT 1
- offer @Decorator usage for events HOT 2
- Transformer option for automatic debug profiling HOT 2
- running npx rbxtsc -w results in a runInitalCompile error HOT 1
- Network batching HOT 2
- Flamework macros not working inside decorators HOT 1
- Allow us to configure obsfucation separately for networking and singletons/components HOT 2
- Disable networking client guards by default in production HOT 1
- Add double quotes to typeRoots
- Ability to create unreliable remote events HOT 1
- support bun HOT 1
- Write to `component.attributes` before firing `onAttributeChanged` signals
- Option to not obfuscate internal ids for server files
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from core.