Live data from Hacker News

React Native for Windows and Mac

microsoft.github.io

291–300 of 505 posts

Re: React Native for Windows and Mac

#291
post #17

React Native scares me with its dependency webs: http://npm.anvaka.com/#/view/2d/react-native From my experience, it's really great to work with and definitely saves a ton of work, but the depgraph above fills me with doubt for use in sensitive applications such as in finance or healthcare. For this reason, I've been trying out Flutter or even considering to go back to native apps. Perhaps there's some kind of middle…

Speaking of trusting trust, I think I'd love for Node¹ to support something like OpenBSD pledge (2) and unveil (2) for imports, where once you enter into a particular package certain capabilities are disabled. I would like to be able to assert that when I import some package, it and all of the packages it recursively includes do not perform network requests, do not use the filesystem outside of some folder, and so on…

My first reaction was that if we need protection from pieces of software we ship because nobody knows what we ship, something must be deeply wrong.

But npm-snark aside, maybe some lack of trust must come from a highly modular open source ecosystem.

If a library I ship could abstain from unneeded platform capabilities, that would certainly reduce catastrophic bug/attack surface, and I'd sleep better.

Re: React Native for Windows and Mac

#292

Earlier quoted context omitted.

Wow, that React Native dep graph is crazy! But as I browse it, most of the dependencies seem to be build-time, not runtime dependencies (i.e. it seems like most of them are related to Babel). The React comparison doesn't include dev dependencies. While react-native does have more dependencies than vanilla react, on first glance the list doesn't seem too crazy https://github.com/facebook/react-native/blob/master/packa…

Am I the only one who just spent 5 minutes chasing moving nodes round in that graph looking for leftpad.js?

Definitely not.

Re: React Native for Windows and Mac

#293

Earlier quoted context omitted.

It gives you a list of directly depended-upon packages. It doesn't give you a list of _those_ packages' dependencies, or _their_ dependencies, which funnily enough also get installed when you install your direct dependencies. Plus I forgot to address this in my earlier comment: that visualizer only shows dependencies. By default it doesn't load any dev dependencies. You can confirm that for yourself by checking out h…

Your last paragraph is a bit inaccurate. The dependencies are needed by people developing WITH React Native as opposed to devDependencies (which are for people developing ON React Native). So whilst you will be using the complicated graph of dependencies at some point, that isn't the same as saying they'll be shipped to end users of the app. The line between dependencies and devDependencies got blurry the second npm…

Can you clarify the difference between developing "with" vs "on" react-native?

Re: React Native for Windows and Mac

#295
post #287

Earlier quoted context omitted.

Why would create react app add more run-time dependencies? Isn't that just Babel and stuff used for building? Also, with TypeScript, Babel becomes completely unnecessary. I haven't used it in any of my React projects for years. Many templates still include it by default to match the JS version, but if you create the project from scratch without any scaffolding, there is no reason to do so.

> Why would create react app add more run-time dependencies? Isn't that just Babel and stuff used for building? You can see all the dependencies it installs by running: $ npx create-react-app my-app > Also, with TypeScript, Babel becomes completely unnecessary. Right, as per my comment it's also my preferred approach: > My preference these days is to avoid npm/yarn all together and just use TypeScript watch In genera…

I just ran that. It took a long time, and the progress bar showed fetching 1381 packages. Definitely https://i.redd.it/i428f2ki0ho01.jpg.

However, the resulting `package.json` only shows 3 dependencies: react, react-dom and react-scripts. After `yarn build`, it added 3 more things from `@testing-library` (https://testing-library.com/), I assume those things won't make it into the production bundle.

react and react-dom only depend on a tiny number of things, you can check that with any dependency visualizer. 6 or 7 in total for the whole tree, and most of those are tiny things that they just split off from react itself (e.g. prop-types).

react-scripts is the huge beast that causes the dependency tree to explode. It is a `create-react-app`-specific package that contains all its build logic. So that seems to confirm the hypothesis that there actually aren't many runtime dependencies in the basic template, but who knows what it does behind the scenes. Also the LICENSE.txt file it generated for the biggest output .js file only includes entries for react, react-dom and object-assign.

No idea about React Native.

Re: React Native for Windows and Mac

#296

Earlier quoted context omitted.

Well javascript's package management is designed around the micropackage. It really doesn't bode well for microservices of any large scale complexity, unless there are concentrated meganodes with limited interconnects like cities and superhighways.

I think the micropackage system is great in theory; it just falls down with bloat and security. Security could at least in theory be mitigated by something like pledge. Right now every developer on the (transitive!) deps authors list effectively has full access to our production systems, and that's ridiculous. Bloat though ... I mean, if every npm module was simply a directory with a package.json file and a couple js…

That 10MB anecdote reminds me of someone that deconstructed a massive windows app and found tons of junk images, libraries, and other wasted space.

Meanwhile WinAmp was sooooo tiny.

Re: React Native for Windows and Mac

#297

Earlier quoted context omitted.

Your last paragraph is a bit inaccurate. The dependencies are needed by people developing WITH React Native as opposed to devDependencies (which are for people developing ON React Native). So whilst you will be using the complicated graph of dependencies at some point, that isn't the same as saying they'll be shipped to end users of the app. The line between dependencies and devDependencies got blurry the second npm…

Can you clarify the difference between developing "with" vs "on" react-native?

If you are trying to write an app using react-native, or if you are trying to improve react-native.

Re: React Native for Windows and Mac

#298

Earlier quoted context omitted.

Why does it have to be sad? To me it is good news! Especially if it is open source. The more software we can write that isn’t specific to a platform the more free and useful software can become. It wrestles back control from google, apple, microsoft et. al and makes their closed platforms less relevant.

"Useful" as long as you don't care about battery life, memory usage, taking advantage of features of the host platform, or the native UI. As an end user why do I care about "openness"? If I pay a premium for my platform, why would I want second rate cross platform software?

> If I pay a premium for my platform

this is something that you might value but I think it's fair to say it is already a minority position.

phones and the web have become the primary platform for software delivery, and people do not treat their desktop if they even have one as some sort of premium platform, it's a terminal for the internet.

at this point, people are probably more familiar with the look and feel of web applications than they are with native applications and value similarity across platforms over features of individual platforms. The operating system and the hardware are increasingly becoming irrelevant and a detail compared to the web on top.

Re: React Native for Windows and Mac

#299

Earlier quoted context omitted.

Wow, that React Native dep graph is crazy! But as I browse it, most of the dependencies seem to be build-time, not runtime dependencies (i.e. it seems like most of them are related to Babel). The React comparison doesn't include dev dependencies. While react-native does have more dependencies than vanilla react, on first glance the list doesn't seem too crazy https://github.com/facebook/react-native/blob/master/packa…

Am I the only one who just spent 5 minutes chasing moving nodes round in that graph looking for leftpad.js?

it's in there, somewhere.. https://github.com/microsoft/react-native-windows/blob/maste...

Re: React Native for Windows and Mac

#300

Earlier quoted context omitted.

"Useful" as long as you don't care about battery life, memory usage, taking advantage of features of the host platform, or the native UI. As an end user why do I care about "openness"? If I pay a premium for my platform, why would I want second rate cross platform software?

> As an end user why do I care about "openness"? If I pay a premium for my platform, why would I want second rate cross platform software? Falsehoods HNers believe about how people buy/use software. Didn't stop Slack/Discord from become ubiquitous. "But native tho" just becomes a circlejerk. Talking about what users care about, most people don't know what native means nor if a given app is it. They don't know if Zoom…

I remember when Spotify 'upgraded' from a native to a js application on MacOS. It bricked my wife's computer. She never installed Spotify again. This is someone who doesn't usually care about software. She did care about that annoyance.
Post reply on HN