JetBrains / kotlin-compiler-server

Server for executing kotlin code
Apache License 2.0
250 stars 73 forks source link

Webpack bundle support #33

Open rjaros opened 4 years ago

rjaros commented 4 years ago

Any chance of supporting Kotlin/JS features like bundling code with webpack?

AlexanderPrendota commented 4 years ago

Hello! Thanks for the feedback. Could you please add a little bit more description of that feature? It's a feature for Kotlin JS team or for this repository?

Thanks.

rjaros commented 4 years ago

As far as I understand webpack integration is part of the new Kotlin/JS gradle plugin. I'm not quite sure how it relates to the Kotlin/JS compiler or to this project.

AlexanderPrendota commented 4 years ago

So, that is a good feature request. But Actually, I don't have plans to implement that feature but you could create an issue in Kotlin and maybe someone could help you.🙂

rjaros commented 4 years ago

I think I'll try to play with your project, because I think it could be done with not much effort. I'll make a PR if I succeed.

AlexanderPrendota commented 4 years ago

Thanks. I will be waiting for your PR 😊

rjaros commented 4 years ago

I've opened a PR (#37). I've tested it successfully with my KVision framework (with a lot of npm dependencies from framework jar's). I would like to add Kotlin DCE support as well, but currently I have no idea if it's possible without Kotlin/JS gradle plugin.

AlexanderPrendota commented 4 years ago

Hello! Thanks for your PR. I need more time to have a look at it. 😊 (Currently, I'm working on creating a docker image and making configuration for starting the application as Amazon Lambda Function)

Also, probably that feature might be interesting for @gzoritchak and @calvellido. (sorry for disturbing)

calvellido commented 4 years ago

Indeed! Thanks, let me know if I can lend a hand :+1:

bashor commented 4 years ago

@rjaros could you please provide more about your usecases? Also, answer a few questions

  1. How are you going to use it?
  2. Should it be configurable by external users?
  3. If so, how and which parts?
bashor commented 4 years ago

@gzoritchak @calvellido please feel free to share your thought too.

rjaros commented 4 years ago

I would like to create an online playground app (kind of jsfiddle) for my framework (https://github.com/rjaros/kvision). I want to send a portion of Kotlin code from the user code editor to the service and get back a bundle.js file which can be used with a simple index.html file.

I think the current available configuration is fine (adding kotlinJsDependency in build.gradle.kts with external Kotlin/JS libraries). With my PR you can also configure webpack processing with webpack.config.*.js and package.json files. For my usecase I don't need additional configuration (e.g. with API parameters).