-
-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
bindable decorator should not be giving a runtime error #1980
Comments
Hi @dkent600, it seems like a vite+esbuild issue. As the latest esbuild added support for the native decorators, it is worth updating the version of esbuild. Moreover, as the parameter decorators are not yet supported by the new decorator specs, those instances needs to be refactored. The Au2 release notes mention this. I have tried the aforementioned changes in your repo. Here is a change.patch that you can apply and check. However, it seems that the decorators are still not transpiled. Unfortunately, I am not much familiar with vite and/or esbuild. @3cp @bigopon Do you guys notice anything configuration change that needs to be made in order to transpile the code view vite/esbuild? |
It seems the version of |
Thanks @Sayan751! FYI I went ahead and committed those changes to master, here: dkent600/douglaskent@fb3c171 |
@Sayan751 @bigopon FYI I updated the vite config to use
The changes are here: dkent600/douglaskent@e1c46f9 PS: There is also a production build issue from rollup. I will investigate. |
Both the above error and the production build issue from rollup go away if I restore the following to tsconfig.json:
Of course that causes other issues to ensue, namely in
|
I'm not sure what's causing the prod issue, since everything looks fine.
We should not need these 2, since it's for the old decorators code, we no longer have it. |
It seems like a configuration issue to me, since the latest version of esbuild can transpile the decorators. Maybe something in the in vite config or rollup is missing. |
@bigopon a side issue. Our plugin-conventions is pinned to one typescript version, should we relax it to "^..."?.
|
My bad, missed your condition. |
Yes we should, completely missed it, thanks @3cp @dkent600 I tried to debug by removing everything and only had these:
And it still couldn't compile the decorator! Will check further. |
For what it is worth, running
|
I quite give up on this ... but the good news is if you use true for |
@bigopon I have set
This can be seen in this commit: dkent600/douglaskent@fdd152c |
I tried too. I think the setup somehow skipped typescript compilation which Vite should do automatically for .ts files. So even conventions handled the decorator, user code still fails with decorator. I could not figure out what happened. |
@bigopon Assuming this issue is addressed by Vite, which do you generally recommend for `enableConventions'? true or false? I am not clear what is its purpose. |
I created a branch for this issue: https://github.com/dkent600/douglaskent/tree/decorators-issue And a ticket for vite: vitejs/vite#17308 (I hope I didn't make any mistakes with the facts of the matter) |
I have a feeling that you guys and Vite may not be aligned about what should be happening here. In the given scenario, should the decorator syntax be getting transpiled for the browser, and if so, to what? Please see: vitejs/vite#17308 (comment) |
Sounds like
is the temporary solution here before esbuild follows tsc behaviour. |
Oh yes. Probably esbuild's decorator helper (in the compiled code) is for legacy decorator spec (honours experimentalDecorators), while Aurelia's decorator is using latest spec. |
Status: Awaiting the fix in vite to address this issue that is apparently due to vite not using the latest version of esbuild. |
Thanks @dkent600 , I'm not sure what vite does internally, because even with overrides in package json to ensure esbuild version 0.21.3, it still didn't compile, as shown in my comment above. |
This setting does fix the issue. I will put it in our WIP vite skeleton.
|
Confirmed this setting does fix the issue: #1980 (comment) If there has yet been a Vite release of what was supposed to be a fix, it is not sufficient. |
Fixed by #1980 (comment) Thanks for everyone's help! |
馃悰 Bug Report
bindable
decorator is giving a runtime error.馃 Expected Behavior
should not give the error
馃槸 Current Behavior
bindable
decorator is giving runtime error:It is happening on this line:
aurelia/packages/runtime-html/src/bindable.ts
Line 101 in 9aeeffa
where
context
equals the string "inline" andcontext.metadata
is undefined.baseline
equals 'au:annotation:bindables'馃拋 Possible Solution
馃敠 Context
I'm stuck. The app won't run. You may reproduce as follows:
npm install
You will see the error message in the browser console.
馃捇 Code Sample
I am using this repo at this commit: dkent600/douglaskent@1a5de33
馃實 Your Environment
Definitely love Aurelia, for a long time
The text was updated successfully, but these errors were encountered: