react-sketchapp icon indicating copy to clipboard operation
react-sketchapp copied to clipboard

Support for Linux

Open nrydevopswatch opened this issue 4 years ago • 16 comments

Background: I am a React full stack dev currently working with Grommet UI and would really like to use React Sketchapp for UI/UX. However, I do not have access to an OS X system. Most users are on Windows, OS X and Linux (in that order) but Linux and OS X are less than 10% of all computer users. Windows is closer to 90% but as developers most of us use Linux. Personally I work in Linux for almost everything including desktop and server. I would expect any Node.js based app to be able to run seamlessly across Windows, OS X and Linux the same.

| -------------------------------------------------------------------------------------------------

Requesting a new feature

Proposal/Feature-request: I would like to request a feature to have the ability to run React Sketch.app on Linux. I feel that most developers will then have access to either OS X and or at least Linux like myself. If not possible with Node directly, I would like to propose an Electron based version.

| -------------------------------------------------------------------------------------------------

Reporting a bug or issue (not really a bug, but more of a feature request)

Expected behavior: Is to run on Linux following npm install and then npm run render

Observed behavior:

git clone https://github.com/airbnb/react-sketchapp.git
cd react-sketchapp/examples/basic-setup && npm install

Works with no issues as expected

nrydevops@cloudshell:~/react-sketchapp (nrydevops)$ npm run render
npm ERR! missing script: render

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/nrydevops/.npm/_logs/2019-12-30T21_17_51_020Z-debug.log

additional logging:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'render' ]
2 info using [email protected]
3 info using [email protected]
4 verbose stack Error: missing script: render
4 verbose stack     at run (/usr/lib/node_modules/npm/lib/run-script.js:155:19)
4 verbose stack     at /usr/lib/node_modules/npm/lib/run-script.js:63:5
4 verbose stack     at /usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:116:5
4 verbose stack     at /usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:436:5
4 verbose stack     at checkBinReferences_ (/usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:391:45)
4 verbose stack     at final (/usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:434:3)
4 verbose stack     at then (/usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:161:5)
4 verbose stack     at /usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:382:12
4 verbose stack     at /usr/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:115:16
4 verbose stack     at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61:3)
5 verbose cwd /home/nrydevops/react-sketchapp
6 verbose Linux 4.19.72+
7 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "render"
8 verbose node v12.14.0
9 verbose npm  v6.13.4
10 error missing script: render
11 verbose exit [ 1, true ]

Sketch version: latest as of December 30, 2019

nrydevopswatch avatar Dec 30 '19 21:12 nrydevopswatch

I would expect any Node.js based app to be able to run seamlessly across Windows, OS X and Linux the same

I'd say it depends what the app is doing, isn't it?

The issue with running react-sketchapp on Linux is those 2 methods: https://github.com/Lona/node-sketch-bridge

If you can create a platform agnostic version of them, I'd be happy to merge it.

mathieudutour avatar Dec 30 '19 21:12 mathieudutour

@mathieudutour Thanks for the reply. What is the Sketch app doing on OS X that is specific to Apple OS?

Is Sketch app using Apple Metal? Is that why it is not cross platform agnostic?

nrydevopswatch avatar Jan 02 '20 16:01 nrydevopswatch

Sketch is an macOS only app. This project is not associated with the company Sketch. If you’d like to ask for a feature request to support other platforms, feel free to contact them specifically.

For this particular project, follow the link above to see what are the macOS specific API we need

mathieudutour avatar Jan 02 '20 17:01 mathieudutour

I created this issue to ask for Linux support for React Sketchapp. I work on Linux most of the time and do not currently have access to a Mac computer. I'm not sure if I have capacity to create this capability.

nrydevopswatch avatar Jan 02 '20 17:01 nrydevopswatch

Right. I don’t have the bandwidth to work on that now, and it’s pretty low priority for me so I added the “help wanted” label. I’d be happy to merge a PR.

mathieudutour avatar Jan 03 '20 08:01 mathieudutour

@mathieudutour Thanks! I'm going to work on getting a macOS computer setup so I can work with React Sketchapp and become more familiar with it. I figure this way I can better understand the functionality and maybe help with this technical enhancement request.

nrydevopswatch avatar Jan 03 '20 16:01 nrydevopswatch

Hi, I think needing a Mac will be required for the foreseeable future to integrate React with design tooling, I would recommend getting a Mac Mini, or to use a VM (which as you mention, should be on Mac hardware or server for it to be licensed). (A lot of musicians/filmmakers are locked to the Mac ecosystem also :/ ). Migrating programs away from Objective C would be a lot of work – not really anything to do with the Metal API; there's more chance of having a Sketch app built for iPad OS, with the iPad/Mac ecosystem merge, I'd say, especially as macOS migrates away from x86.

I've looked into integrating React with Adobe XD (for cross-platform purposes). The XD API is too restrictive and closed for now, and can't be easily run in the cloud (or on Linux) due to the closed file format.

I believe https://github.com/amzn/sketch-constructor is cross platform, would need to integrate it together with react-sketchapp and a web viewer though.

What you could do, is use GitHub Actions (or another CI with a macOS VM) to automatically generate a Sketch library with react-sketchapp, and use something like Storybooks for design/dev.

macintoshhelper avatar Mar 04 '20 15:03 macintoshhelper

Well that is really lame to tell someone they must buy a Mac in order to use your product. I guess I will go with Figma then. Not going to fiddle with a Mac VM as that violates Apple's EULA and I refuse to be forced into the Apple closed ecosystem just to use one app. This is 2020, not 1990 when certain graphic apps only ran on Apple. Whoever is in charge of this project needs to get with the times and make this cross-platform.

nrydevopswatch avatar Apr 06 '20 14:04 nrydevopswatch

react-sketchapp is not associated with Sketch. Sketch is a macOS only app. If you have a problem with that, you are welcome to complain to their customer support - but this is not the place to do it.

It is kind of obvious that to run a Sketch plugin (what you tried to do in the OP), you need Sketch.

There are some efforts to add support to generating a Sketch file with Node on Linux but that involves a lot of work around the layout algorithm and typography (https://github.com/airbnb/react-sketchapp/pull/472). You are also welcome to contribute and propose solutions instead of complaining.

mathieudutour avatar Apr 06 '20 14:04 mathieudutour

@mathieudutour I was responding to the comment from @macintoshhelper telling me I had no choice but to buy a Mac or illegally run a Mac OS VM or not use this project...

nrydevopswatch avatar Apr 06 '20 14:04 nrydevopswatch

That's what you need to do at the moment yes, my comment still stands. Instead of reacting like that when someone takes the time to answer with not only 1 but 3 solutions is lame.

mathieudutour avatar Apr 06 '20 14:04 mathieudutour

Okay dude, I'm lame for complaining about Mac fanboys getting upset because I complained about not only sketch-app but Sketch itself being a closed off ecosystem. 1994 called and they want their IBM PowerPC Mac back! lol

nrydevopswatch avatar Apr 06 '20 14:04 nrydevopswatch

As I said twice already, react-sketchapp is not associated with Sketch. This is not the place to complain about it. I'm going to remove comments going forward. This is a valid issue but the way you are reacting isn't.

Furthermore, this has nothing to do with fanboyism: I would love Sketch to be available on more platform, and we are doing what we can to make react-sketchapp cross-platform regardless.

mathieudutour avatar Apr 06 '20 14:04 mathieudutour

Okay...back to the discussion at hand! I have done a lot with cloud since the early days of "cloud." As the founder of www.revuprender.com My only other question at this point; Why not make this tool cloud based? What is stopping you as the main dev @mathieudutour from making it into something like VS Code Server?

nrydevopswatch avatar Apr 06 '20 14:04 nrydevopswatch

see my first answer

mathieudutour avatar Apr 06 '20 14:04 mathieudutour

Haha, okay so I would need a Mac...in order to (in your words) "create a platform agnostic version of them," ?

Strange that I would need a Mac, to create something for Linux...just saying! ;-)

nrydevopswatch avatar Apr 06 '20 15:04 nrydevopswatch