Live data from Hacker News

Create React apps using Kotlin

github.com

41–50 of 68 posts

Re: Create React apps using Kotlin

#41

I was trying to get this setup going the other day and found it a little fiddly with some of the Jetbrain’s documentation on Kotlin->JS being outdated it seemed and the sample application they have supplied having some issues with missing dependencies, specifically missing package versions on NPM. I’ll be trying this out straightaway, so many thanks for this!

What's the fix to config mgmt jitter, entropy? Every time I set aside a few hours to do a React tutorial, I'm defeated by the stack. I'm very late to docker. I always liked the idea, but didn't have the immediate need. But Python, trying to fix bugs in someone else's project, has now made that need urgent. After spending WAY TOO MUCH TIME getting the exact right constellation of stuff installed. Switching from macpor…

Can you clarify what you mean by "defeated by the stack"? Are you having trouble setting up a React development environment?

If you want to try using React without any build tooling or process at all, the main suggestions are:

- Use an online IDE like https://codesandbox.io , which is a complete online editor that lets you write React apps, view them in the browser, and even make use of NPM packages . CodePen and StackBlitz are other good choices for online editors.

- Create an index.html file with three script tags for React, ReactDOM, and the Babel transformer. There's a pre-written example at https://raw.githubusercontent.com/reactjs/reactjs.org/master... .

If you do want a local project with the right build setup, the official Create-React-App tool will create projects with the build config abstracted away: https://reactjs.org/docs/installation.html

So, while the recommended way to use React is with a full build process (which lets you use the JSX syntax for rendering components, other modern JS syntax, and produces a proper bundle for deployment), you don't have to learn Webpack or Babel as a prerequisite for learning React.

Re: Create React apps using Kotlin

#42
post #32

Earlier quoted context omitted.

> React is becoming a de-facto standard The Vue.JS community would beg to differ. But yeah, if JetBrains could implement something like the Rust Language Server for Kotlin I would be so happy.

Agreed with this. I use both React and Vue intensively, day to day. React and Vue both have pros and cons, but I would argue it's actually easier to optimize Vue apps. Vue's reactive nature actually is superior, because something like Redux requires destroying, regenerating, and messaging around entire objects. This can create serious problems when, for example, trying to use Chrome APIs or manage component renders.…

Can you clarify how Redux causes issues in those scenarios?

Re: Create React apps using Kotlin

#43

How is the debugging experience? Is there a debugging experience? I'm currently a typescript user and I like what VS code has going on with attaching to chrome and providing debugging within the ide. Source maps are okay but a seamless experience in the source language is better. Does the kotlin IDE have facilities for debugging what is going on in the browser?

Sourcemaps work. If they doesn’t work, it‘s a bug

Re: Create React apps using Kotlin

#44
post #40

Earlier quoted context omitted.

> React is becoming a de-facto standard The Vue.JS community would beg to differ. But yeah, if JetBrains could implement something like the Rust Language Server for Kotlin I would be so happy.

I'll take a look at Vue.JS, thanks! Is there a way to use it from Kotlin or some other "sane" language as well?

It has pretty decent TypeScript bindings iirc, but the fundamental thing it does is prevent the need to mix HTML and JS inline. If you can hold your nose at Javascript, most of the project generators for Vue.JS seem to prefer using ES6/ESnext syntax so the language is much more tolerable than, e.g. Angular and Circa-2007 JavaScript.

Re: Create React apps using Kotlin

#45

How is the debugging experience? Is there a debugging experience? I'm currently a typescript user and I like what VS code has going on with attaching to chrome and providing debugging within the ide. Source maps are okay but a seamless experience in the source language is better. Does the kotlin IDE have facilities for debugging what is going on in the browser?

Being a grumpy old man: it's not programming if I can't set a breakpoint.

You've obviously never done embedded systems programming. Try debugging timing issues with a breakpoint.

Re: Create React apps using Kotlin

#46

I was trying to get this setup going the other day and found it a little fiddly with some of the Jetbrain’s documentation on Kotlin->JS being outdated it seemed and the sample application they have supplied having some issues with missing dependencies, specifically missing package versions on NPM. I’ll be trying this out straightaway, so many thanks for this!

What's the fix to config mgmt jitter, entropy? Every time I set aside a few hours to do a React tutorial, I'm defeated by the stack. I'm very late to docker. I always liked the idea, but didn't have the immediate need. But Python, trying to fix bugs in someone else's project, has now made that need urgent. After spending WAY TOO MUCH TIME getting the exact right constellation of stuff installed. Switching from macpor…

> But Python ... bootstrapping pip ... When does it get better?

In Python 3. The pip and venv stuff is built-in and works much more smoothly. (But I realize that this doesn't help you on an old Python 2 project.)

Re: Create React apps using Kotlin

#47
post #35

Earlier quoted context omitted.

>(e.g. in PyCharm it became completely useless) Very weird; what happened ? In java/kotlin it is as great as ever in Android Studio

No idea; I do extensive tensorflow/keras/opencv/numpy/openai stuff and code completion there is a joke, I just get completely unusable hints. Maybe I am A/B tested by them or something, but I am forced to have browser with documentation/stack overflow opened these days. And IntelliJ used to be much better for me at around IDEA 12, since then code completion doesn't predict my typical choices at top places, I need to…

Code completion has always been hit-or-miss in dynamic languages like python. Is it possible that something in your libraries (or maybe something in your programming style) changed such that the IDE can no longer make good guesses?

FWIW I've never found IntelliJ code completion in Javascript, Ruby, or Python to be very accurate. It's fantastic in Java and Typescript.

Re: Create React apps using Kotlin

#49
post #35

Earlier quoted context omitted.

No idea; I do extensive tensorflow/keras/opencv/numpy/openai stuff and code completion there is a joke, I just get completely unusable hints. Maybe I am A/B tested by them or something, but I am forced to have browser with documentation/stack overflow opened these days. And IntelliJ used to be much better for me at around IDEA 12, since then code completion doesn't predict my typical choices at top places, I need to…

Code completion has always been hit-or-miss in dynamic languages like python. Is it possible that something in your libraries (or maybe something in your programming style) changed such that the IDE can no longer make good guesses? FWIW I've never found IntelliJ code completion in Javascript, Ruby, or Python to be very accurate. It's fantastic in Java and Typescript.

It's also fantastic for JavaScript in VSCode, thanks to VSCode automatically downloading type definitions.

Re: Create React apps using Kotlin

#50
post #32

Earlier quoted context omitted.

> React is becoming a de-facto standard The Vue.JS community would beg to differ. But yeah, if JetBrains could implement something like the Rust Language Server for Kotlin I would be so happy.

Agreed with this. I use both React and Vue intensively, day to day. React and Vue both have pros and cons, but I would argue it's actually easier to optimize Vue apps. Vue's reactive nature actually is superior, because something like Redux requires destroying, regenerating, and messaging around entire objects. This can create serious problems when, for example, trying to use Chrome APIs or manage component renders.…

Redux is not actually necessary for React, you can manage state without it.
Post reply on HN