Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deno bundle misbehaving output #13048

Closed
tdillon opened this issue Dec 10, 2021 · 8 comments
Closed

deno bundle misbehaving output #13048

tdillon opened this issue Dec 10, 2021 · 8 comments
Labels
bug Something isn't working needs investigation requires further investigation before determining if it is an issue or not

Comments

@tdillon
Copy link

tdillon commented Dec 10, 2021

I'm using Deno's bundle command to create a simple Lit web app. What I'm finding is the output of deno bundle for newer versions of Deno (anything after 1.4.6) actually changes the behavior of Lit. No errors are shown in the browser console, but the functionality appears to be broken. I assume Deno's newer bundling is different somehow and generates different output for the same input.

Here are 3 examples to show the behavior mentioned above. Browse to any of these pages, click the text, and the bolded text should update if everything is working.

All of the source code and build commands can be found at
https://gitlab.com/tdillon/lit-deno-example/.

@kitsonk
Copy link
Contributor

kitsonk commented Dec 10, 2021

There was a significant update landed yesterday in main. Can you please try again with Deno canary? deno upgrade --canary or wait until next week for 1.17?

@tdillon
Copy link
Author

tdillon commented Dec 17, 2021

Can you please try again with Deno canary? deno upgrade --canary or wait until next week for 1.17?

I tried with both canary and 1.17.0. Neither version fixed the issue.

@kitsonk kitsonk added bug Something isn't working needs investigation requires further investigation before determining if it is an issue or not labels Dec 20, 2021
@tdillon
Copy link
Author

tdillon commented Jan 11, 2022

Deno 1.17.2 has resolved my issue. Besides some very minor formatting differences, the output of deno bundle in version 1.17.2 includes the following code which does not exist in the output from 1.17.1.

var own = Object.getOwnPropertyDescriptor(target, property);
if (own && (own.get || own.set)) {
    delete desc1.writable;
    delete desc1.initializer;

@tdillon
Copy link
Author

tdillon commented Mar 29, 2022

The issue is back since it was briefly fixed with 1.17.2. I'm not sure which version caused the regression.

I've updated my issue reproduction page to simplify everything as well as include a working vanilla Lit implementation. For simplicity sake, I haven't implemented a page which shows Deno's behavior for each version (that seems like overkill), but I could make that happen if it would be helpful.

https://tdillon.gitlab.io/lit-deno-example/

Hope this helps.

@beingminimal
Copy link

@ry Just a feedback | New version release of deno without existing bug fixing will be useless for adoption of deno.
And soon deno will become new node only if we will not solve this soon. See open issues of bugs only in deno here https://github.com/denoland/deno/issues?q=is%3Aissue+is%3Aopen+label%3Abug
Let us know how can we make deno more reliable which will not break existing production workflow atlist.
Awaiting your response.

@beingminimal
Copy link

beingminimal commented Apr 22, 2022

@bartlomieju @kitsonk @piscisaureus @caspervonb @lucacasonato
It's my humble request to solve this issue. It's breaking our production workflow.
So we are not able to ship new features and releases.
Please understand this urgent need and help to solve this issue.
Just we have tested and still this bug is there in new release v1.21.0
And please make sure how this type of bug can be prevented in future?
Awaiting your response.

@willmartian
Copy link

willmartian commented May 7, 2022

I believe this is the same issue as #14329.

Using declare with the Lit element decorator (as described in that issue) makes the component reactive.


Also @codecycleteam, I know this probably wasn't intentional, but it is typically considered rude to tag a bunch of maintainers on an issue. Hopefully this issue will be fixed soon, but in the mean time you can try the workaround above ^

@tdillon
Copy link
Author

tdillon commented May 10, 2022

Lit's documentation aligns with #13281.

https://lit.dev/docs/components/properties/#avoiding-issues-with-class-fields

For TypeScript, you may use class fields for declaring reactive properties as long as the useDefineForClassFields setting in your tsconfig is set to false.

I assume we just have to wait until the spec is finalized for the proper behavior without any sort of workaround.

@tdillon tdillon closed this as completed May 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs investigation requires further investigation before determining if it is an issue or not
Projects
None yet
Development

No branches or pull requests

4 participants