Comments (9)
We'll add a fix for this in the next update by supporting both the old and the new decorator syntax:
_propertyKey: string | { name: string }
a call to toString()
in this case doesn't make sense since we need the decorated field/property name here. The new method argument (ClassFieldDecoratorContext) has that inside the name
property so we have to properly handle both types and extract the information necessary.
That being said our package will continue using experimentalDecorators
as long as it's officially supported by typescript to not break backwards compatibility - according to their announcement it won't be removed anytime soon.
from needle-engine-support.
Hey, which version of typescript are you using?
from needle-engine-support.
Oh is this a fault on my end only? Sorry, I'm new to this whole ecosystem.
Anyway, this is what i found:
> npm ls typscript
[email protected]
├─┬ @needle-tools/[email protected]
│ └─┬ @needle-tools/[email protected]
│ └── [email protected]
└── [email protected]
from needle-engine-support.
Thanks, I havent tested it with typescript 5 yet.
Can you try if changing the type to string | symbol
works for you as well?
https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/#more-accurate-type-checking-for-parameter-decorators-in-constructors-under-experimentaldecorators
from needle-engine-support.
Thanks, I havent tested it with typescript 5 yet.
Oh? That's what gets installed automatically using the exporter though? I did not (knowingly) deviate from the defaults.
Can you try if changing the type to
string | symbol
works for you as well? https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/#more-accurate-type-checking-for-parameter-decorators-in-constructors-under-experimentaldecorators
from needle-engine-support.
Ah sorry I wasnt aware that it was updated in the vite template. So that can't be it
What do you get when you change it to any
to make typescript happy and if(typeof _propertyKey !== "string") console.log(typeof _propertyKey, _propertyKey)
?
from needle-engine-support.
Interesting: Does not log anything. I can set a breakpoint there and it hits (after un-ingoring the file). Is there some magic going on?
from needle-engine-support.
Ah you need to edit the file in lib/engine
(the .js file) and not in src/engine
from needle-engine-support.
Looks like in TS5 this parameter is a ClassFieldDecoratorContext
instead of a string. My understanding would be that there's different TS versions conflicting, one with a config of experimentalDecorators (like we're using, with the string parameter) and one without.
This issue would likely go away if we switch to TS5 entirely and drop support for experimentalDecorators, instead using the non-experimental ones with that context.
I'm not sure if we can use ClassFieldDecoratorContext
as alternative type or if that's just not available in TS4, which would make it seem like "any" and casting to string is the right way for now...
Here are some decorator usage notes for TS5:
https://devblogs.microsoft.com/typescript/announcing-typescript-5-2-beta/#decorator-metadata
And the info in the PR that added it is much better than the current docs:
microsoft/TypeScript#50820
from needle-engine-support.
Related Issues (20)
- Animation Bug in AR-view when using GPU Instancing
- Unity Assertion Error on needle engine unity package import HOT 2
- UI Text Tags does not get corrrectly applied when setting with Text.text HOT 4
- Transform with rect transform parent in UI Canvas is offsetted (since Needle exporter 3.3.0)
- Ignored AR-Scale in iOS HOT 2
- "Needle" banner in AR on iOS in commercial version HOT 1
- SpatialTrigger Receiver fails to execute AudioSource.Play on Audiosource HOT 1
- AR DOM Overlay not working HOT 4
- UI Text: Empty textboxes when switchting out text with rich text <tags> via script HOT 3
- RectTransform.offsetMin/offsetMax values are not usable in build HOT 1
- When clicking on HTML overlay in AR last clicked object in the scene receives a click event as well
- Editor Sync only partially working in 2022.3 HOT 2
- Editor Sync: X-Axis flipped when editing via inspector HOT 2
- CSS changes in .webxr-buttons in the style.css are being ignored HOT 1
- Opening .ts files is somewhat broken HOT 4
- The whole AR scene jumps to the side 10-15 sek after placement HOT 5
- CodeGen stops working, incorrectly warns about Node.js not installed HOT 1
- Editor Sync: Messing with UnityEvents HOT 1
- Sliced UI Image support HOT 1
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 needle-engine-support.