Code Monkey home page Code Monkey logo

Comments (11)

jeroenptrs avatar jeroenptrs commented on June 18, 2024 1

Yep, I'm thinking of a good way to support this going forward. I think I might need to change the Terser plugin back to minifying the bundle chunks instead of as a transform hook or something similar. Will test some approaches this week after I finished up the plugins I've been working on 😄

from denopack.

jeroenptrs avatar jeroenptrs commented on June 18, 2024 1

Thanks for renaming the issue btw 👍

from denopack.

jeroenptrs avatar jeroenptrs commented on June 18, 2024

Hey @PaulLeCam what version of denopack are you using? Could you share your denopack config?
I'm not 100% certain, but I think the issue isn't necessarily the fact that it's using WASM, so I'd like to investigate it further.

from denopack.

PaulLeCam avatar PaulLeCam commented on June 18, 2024

Yes WASM is my assumption but that might be something else, this was just the most obvious difference I found between std/hash and other std libraries.

Here is a simple way I could reproduce the issue (I'm using Deno 1.3.0):

File test.ts:

export { createHash } from 'https://deno.land/[email protected]/hash/mod.ts'

And running:

deno run --unstable --allow-env --allow-net --allow-read --allow-write https://deno.land/x/[email protected]/cli.ts bundle -i test.ts

from denopack.

jeroenptrs avatar jeroenptrs commented on June 18, 2024

@PaulLeCam I have some good news and bad news:
the good news is that as far as I know, this is not related to WASM, and I'm fairly certain bundling WASM should work.
the bad news however is that this is related to the fact that Terser does not support top level awaits yet and this is used inside of the implementation of std/hash.

https://deno.land/[email protected]/hash/_wasm/hash.ts {
  error: SyntaxError: Unexpected await identifier inside strict mode

I will leave this issue open as this is fairly annoying to anyone wanting to use std/hash

from denopack.

PaulLeCam avatar PaulLeCam commented on June 18, 2024

Thanks for investigating!
Too bad about Terser, I guess it's even a larger problem than std/hash because any module could possibly user a top-level await.

from denopack.

lucacasonato avatar lucacasonato commented on June 18, 2024

I think I fixed this in a terser update a few weeks ago.

from denopack.

jeroenptrs avatar jeroenptrs commented on June 18, 2024

Does Terser 5 support TLA now?

from denopack.

lucacasonato avatar lucacasonato commented on June 18, 2024

I think that is why I updated it in the first place... can't remember now though. I'll check real quick.

from denopack.

lucacasonato avatar lucacasonato commented on June 18, 2024

Oh never mind - I updated because optional chaining... so this is not fixed yet.

from denopack.

jeroenptrs avatar jeroenptrs commented on June 18, 2024

Yeah I just checked and the issue regarding awaits on Terser's github is still open :c sucks but we'll keep an eye out on it ;)

from denopack.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.