Code Monkey home page Code Monkey logo

esgleam's People

Contributors

enderchief avatar xhh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

esgleam's Issues

How to bundle for node

I'm getting this error here:

$ ./build/dev/bin/package/bin/esbuild ./build/dev/javascript/esme/gleam.main.mjs --bundle --outfile=./dist/esme.mjs --format=esm
✘ [ERROR] Could not resolve "node:net"

    build/dev/javascript/node_socket_client/node_socket_client_ffi.mjs:1:23:
      1 │ import { Socket } from "node:net";
        ╵                        ~~~~~~~~~~

  The package "node:net" wasn't found on the file system but is built into node. Are you trying to
  bundle for node? You can use "--platform=node" to do that, which will remove this error.

1 error

How do I get around this?

Entrypoint is not bundled so bundle is not runnable

Hello!

The module that contains the main function is bundled rather than actual entrypoint build/dev/javascript/$PACKAGE/gleam.main.mjs, so if the bundled program is run no code is executed. I think the bundle ought to have the same behaviour and entrypoint as gleam run.

Cheers,
Louis

Why does automatic install force erlang runtime?

When esgleam installs esbuild automatically, the JS implementation forces the use of the Erlang target.

In the context of a Gleam project that targets only JS this can be really confusing. I found out when my deployment CI failed after trying to execute escript despite me explicitly not installing Erlang because I wasn't supposed to need it.

Esbuild installs fine when running gleam run -m esgleam/install manually, which uses the JS target as prescribed by my project, so I'm not sure why the auto-install flow doesn't let that happen. I also tried removing --target=erlang from the JS implementation and didn't spot any obvious issues after using the auto-install.

Instruction how to use it with esbuild-runner

One cool thing about TypeScript is the ability to use it without the build step on Deno or on nodejs (using esbuild-runner). It would be very cool to be able to use gleam in a similar fashion. Can esgleam be somehow integrated into esbuild-runner?

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.