Comments (10)
https://github.com/evanw/esbuild probably has the most robust "install the right native dep or use wasm" approach - maybe that's a method to copy
from ezno.
haha yeah will probably make public the same time as the checker. once I have a got a few things in place (like this issue) and then find the time to clear up my current checker code then will make that public.
from ezno.
The only problem is that these binaries are platform specific. Currently not sure how to communicate the platform the binary is built for to NPM, so that
npx
andnpm install
only install and run the binary for the user's platform.
I skimmed through the Cypress package (that have platform-specific binaries) for 5 mins but I didn't found what's their approach 🤔
from ezno.
Yes I have seen a bunch of packages doing it but not sure how they do it. Looking into it there doesn't seem to be a supported way by NPM 😢
One way I think is to download all the binaries and then have a script that calls something like exec(`/binary-${platform}`)
. But it seems a bit wasteful to download all the binaries?
Maybe you could download the binaries afterwards in a script, not sure?
from ezno.
Maybe you could download the binaries afterwards in a script, not sure?
Uhm you're right, I just realized that installing Cypress (the npm dependency, I mean) itself is quick but when you launch it, it installs more things and takes longer...
from ezno.
Hmm looking at the "bin" field docs it seems NPM is missing something like:
{
"bin": {
"myapp:platform=windows": "./cli-windows.exe",
"myapp:platform=unix": "./cli-unix.exe",
}
}
Would be really nice if something like that was added. It would be the most optimal in terms usability, download and minimal overhead when calling.
Some other options I can currently think of:
- Package per platform, with a single specific bin field. Use with
npm install ezno-windows
, not great :/ - Use the #4 (when it is out). The single WASM version should be work on any platform. Not sure whether could use the CLI setup and error reporting inside wasm (pass flags through), don't want to rewrite and maintain the CLI logic in JS.
- Some script that downloads a specific binary to a location on first run (which I think is what you have found that Cypress does). May be good if not too difficult and is reliable.
maybe some other methods?
from ezno.
3. Some script that downloads a specific binary to a location on first run (which I think is what you have found that Cypress does). May be good if not too difficult and is reliable.
Especially since it's idempotent and quite versatile (for instance: allows working locally with a Windows machine and running in CI in a Linux one seamlessy)
2. Use the #4 (when it is out). The single WASM version should be work on any platform. Not sure whether could use the CLI setup and error reporting inside wasm (pass flags through), don't want to rewrite and maintain the CLI logic in JS.
I agree it's not worth and too hard to maintain
from ezno.
WASM looks the best way to go. Just played around and managed to get argh
(the cli argument parsing framework ezno-cli current uses) to work in WASM. Requires injecting a file to pass over arguments but that should be fine.
#[wasm_bindgen(raw_module = "./get_args")]
extern {
#[wasm_bindgen]
fn get_args() -> String;
}
#[wasm_bindgen(start)]
fn main() {
let get_args = get_args();
let arguments = get_args.split('\0').collect::<Vec<_>>();
match FromArgs::from_args(&["ezno-cli"], &arguments) {
Ok(TopLevel { nested }) => {
todo!()
}
Err(err) => {
log(&err.output);
}
}
}
Can work on this at the same time as #4
from ezno.
ezno-lsp when 👀
from ezno.
This is now implemented as well as automated deploys. Package @ https://www.npmjs.com/package/ezno
It uses the WASM version (option 2) which seems the simplest and least effort. Maybe at some point could have an additional --native
flag and review option 3.
from ezno.
Related Issues (20)
- More configuration and per file options/configuration
- Implement destructuring assignment (declaration works already)
- feat(ci): auto-fix formatting and linting on new PRs HOT 1
- Improve fuzzing tests HOT 11
- Check using the type annotation for default parameter value and try-catch variable HOT 2
- Typescript definition for wasm target HOT 4
- Is there still a way to convert from OXC parsed AST to Ezno? HOT 1
- Crates in this repository have a different versions HOT 2
- Missing `Console` methods HOT 3
- Class types and class extends
- Allow for more than u16::MAX types HOT 1
- Merge Ezno runtime definitions with existing TS definition files HOT 3
- Narrowing
- Interface extends and type parameters extends
- Closure TDZ HOT 1
- Nominal classes
- `console.log` not variadic HOT 2
- Bug: Unsound checking of function calls with array parameters HOT 3
- `never` type lookup - "Cannot find type never" HOT 4
- Proposal: Support `unknown`, rename `TypeId::ANY_TYPE` -> `TypeId::UNKNOWN_TYPE` 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 ezno.