Code Monkey home page Code Monkey logo

Comments (7)

jaydenseric avatar jaydenseric commented on May 10, 2024 3

If extensions have a JS API, it would be great if they can be standard ESM instead of CJS like Nova requires for its extensions:

https://docs.nova.app/extensions/#javascript-modules

CJS makes it tricky (but not impossible) to author extensions using Deno or other standards-aligned tooling without introducing a build step.

from codeedit.

jasonplatts avatar jasonplatts commented on May 10, 2024 1

Hi @jaydenseric.

Thanks for joining the discussion. @austincondiff and I talked about this and it has been brought up in our Discord too.

Since it is early in the development, no decisions have been made in relation to the extension architecture. JavaScript Core (https://developer.apple.com/documentation/javascriptcore) has been mentioned as a possible option for implementing extensions. Unfortunately, as far as I am aware, it does not support ESM.

Having developed some extensions for Nova, I know this has been a frustration shared by other devs too. And, hopefully we can find a final solution that supports ESM. We also have an extensions channel in our Discord if you would like to get involved in the conversation.

from codeedit.

jaydenseric avatar jaydenseric commented on May 10, 2024

Related: https://github.com/CodeEditApp/CodeEditTextView/issues/40 .

from codeedit.

chriskrycho avatar chriskrycho commented on May 10, 2024

Whether or not the host environment supports ESM, it should be straightforward to provide a standard bit of boilerplate to make bundling it into a version which handles module scopes etc. easy for end user developers. (I'm happy to provide some input that way if/as you get there; just ping me about it!) Related: please do what Nova has not yet done and build your JS API in TypeScript and shipping types natively. (I'm also happy to advise on that!)

from codeedit.

austincondiff avatar austincondiff commented on May 10, 2024

@chriskrycho That would definitely be ideal for a JS/TS API. We'd love to hear what you had in mind!

from codeedit.

TheBlckbird avatar TheBlckbird commented on May 10, 2024

What about an extension system via WebAssembly? You could use WasmKit.

from codeedit.

TheBlckbird avatar TheBlckbird commented on May 10, 2024

If extensions have a JS API, it would be great if they can be standard ESM instead of CJS like Nova requires for its extensions:

https://docs.nova.app/extensions/#javascript-modules

CJS makes it tricky (but not impossible) to author extensions using Deno or other standards-aligned tooling without introducing a build step.

How do you plan to run the JS? Cuz if you were using Bun, the whole CJS/ESM thing wouldn’t be such a problem, since Bun supports both, even in the same file.

from codeedit.

Related Issues (20)

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.