Git Product home page Git Product logo

jsc-compiler's Introduction

JSC Compiler

A ๐Ÿ”ฅ BLAZINGLY FAST ๐Ÿ”ฅ, but โ„๏ธ refreshingly simple โ„๏ธ JavaScript to JavaScript compiler.

Why?

As JavaScript has become more popular and powerful, its ecosystem has become increasingly convoluted. Developers have built many tools such as Babel and TypeScript to help them manage the complexity and streamline their workflows. However, although these tools bring many sophisticated features, they can be burdensome and frustrating to use due to their complexity.

For years, developers have been looking for a simpler alternative, and it has finally arrived: the JSC Compiler. Say goodbye to frustration and complexity and say hello to the future of JavaScript development!

How?

The JSC Compiler simplifies JavaScript compilation by not including rarely-used features such as:

  • Syntax transformation
  • Performance optimisation
  • Polyfills
  • Type safety
  • Size optimisation
  • Code obfuscation

Usage

Install the JSC Compiler using the command npm install -D jsc-compiler.

You can then run it using npx jsc <input file/directory> <output file/directory>.

Contributing

I'd love to have your help developing this awesome project! Feel free to open up issues and pull requests to address any issues you may find in the code!

Note that JSC uses Babel to ensure that the Jest tests run correctly.

jsc-compiler's People

Contributors

maddyguthridge avatar

Stargazers

ebigram avatar Jess Julian Nielsen avatar Chris Hatton avatar Bartek ลuka avatar Andrew Johnson avatar

Watchers

Charles Kerr avatar Chris Hatton avatar  avatar

jsc-compiler's Issues

bug: inplace compilation fails

My workflow involves copying the original source files into an intermediate location where I'd like to run JSC in place on them before packing.

JSC fails when the input and output files are the same:

$ cd JSC-Compiler
$ ELECTRON_RUN_AS_NODE=1 electron index.js index.js -o index.js
node:internal/errors:484
    ErrorCaptureStackTrace(err);
    ^

SystemError [ERR_FS_CP_EINVAL]: Invalid src or dest: cp returned EINVAL (src and dest cannot be the same) index.js
    at new SystemError (node:internal/errors:244:5)
    at new NodeError (node:internal/errors:355:7)
    at checkPathsSync (node:internal/fs/cp/cp-sync:68:13)
    at cpSyncFn (node:internal/fs/cp/cp-sync:58:33)
    at Object.cpSync (node:fs:2904:3)
    at file:///tmp/JSC-Compiler/index.js:18:4
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:530:24)
    at async loadESM (node:internal/process/esm_loader:91:5) {
  code: 'ERR_FS_CP_EINVAL',
  info: {
    message: 'src and dest cannot be the same',
    path: 'index.js',
    syscall: 'cp',
    errno: 22,
    code: 'EINVAL'
  },
  errno: [Getter/Setter],
  syscall: [Getter/Setter],
  path: [Getter/Setter]
}

Node.js v18.12.1

Tested on a 17" Dell laptop running Ubuntu 22.10 with Electron v23.0.0.

Document TypeScript support

While performing some Benchmarks and other tests I noticed the compiler appears to have undocumented support for TypeScript -> Typescript conversion as well; is this just in tech preview stage or is it safe to use in production?

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.