Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NODEJS Version #328

Closed
luni-moon opened this issue Jan 13, 2022 · 7 comments
Closed

NODEJS Version #328

luni-moon opened this issue Jan 13, 2022 · 7 comments
Labels
enhancement New feature or request

Comments

@luni-moon
Copy link

The current NODEJS version is outdated by a few major versions (12.19.0), with the current version being 17.3.1, and the Active LTS being at 16.13.2

This is causing a message to appear for me in panel, (node:11915) ExperimentalWarning: The ES module loader is experimental., which is prohibiting my programme from running. Thanks!

@bummoblizard bummoblizard added the enhancement New feature or request label Jan 13, 2022
@bummoblizard
Copy link
Member

This isn't as straight forward as it seems. Porting NodeJS and its underlying JavaScript engine to iOS is challenging and currently we rely on https://github.com/JaneaSystems/nodejs-mobile which is no longer actively maintained. Codesandbox's Play.js uses a modified version of it but it's still at 12.19.0.

I've seen newer versions of NodeJS ported to jailbroken iOS devices but I'm not sure if it's feasible for normal devices.

@luni-moon
Copy link
Author

luni-moon commented Jan 13, 2022

This isn't as straight forward as it seems. Porting NodeJS and its underlying JavaScript engine to iOS is challenging and currently we rely on JaneaSystems/nodejs-mobile which is no longer actively maintained. Codesandbox's Play.js uses a modified version of it but it's still at 12.19.0.

I've seen newer versions of NodeJS ported to jailbroken iOS devices but I'm not sure if it's feasible for normal devices.

I totally understand that. As a former Swift developer, I understand these constraints. If you don't mind, I can look for alternatives that do not require Jailbreaking. On a side-note, what does iOS 15 use for Javascript in the Safari Browser? I am sure we could find something that works in there, or at least some pointers.

@bummoblizard
Copy link
Member

I think it's called JavaScriptCore. Here's a repo that ported v8.11.1 using it https://github.com/mceSystems/node-jsc.

I actually have done some research on it. The engine desktop node uses (V8) can actually be compiled for iOS with their JITless mode. See nodejs/node#26758.

@bummoblizard bummoblizard pinned this issue Jan 13, 2022
@luni-moon
Copy link
Author

I think it's called JavaScriptCore. Here's a repo that ported v8.11.1 using it mceSystems/node-jsc.

I actually have done some research on it. The engine desktop node uses (V8) can actually be compiled for iOS with their JITless mode. See nodejs/node#26758.

That is good news, I wonder if that can be somewhat applied (like how we cannot install certain modules with the current in-app version), with at least the Active LTS (16.13.2), or at least V16.

@wattsie
Copy link

wattsie commented Feb 11, 2022

How’s this going?
Wondering if this would help?
https://v8.dev/docs/cross-compile-ios

@bummoblizard
Copy link
Member

Thanks to a pull request at https://github.com/nodejs-mobile/nodejs-mobile/, the included node version is now LTS (16.13.2).

@bummoblizard bummoblizard unpinned this issue Mar 24, 2022
@luni-moon
Copy link
Author

Thanks to a pull request at https://github.com/nodejs-mobile/nodejs-mobile/, the included node version is now LTS (16.13.2).

I just recently learned that the V8 engine has a command line flag for devices that don’t allow executable memory access, or need special security features - and iOS/iPadOS are one of them. The flag is:

node --jitless <file>

It is very important that the flag goes before the file name, otherwise it won’t use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants