-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
Optionally build with icu #20
Comments
Found another issue with the https://github.com/colinhacks/zod library.
Because in code it looks like this in the code: Note the |
Check BUILDING.md and if that's not sufficient, let me know (in details) why.
I have also stumbled into this problem in the past and it's solvable with a hard-coding approach like these: |
I thought i had written my initial problem with the Intl date time stuff, but it somehow didn't end up in the text. Note that my problems are with third party modules, not code of mine, so these modules won't help in that case. As far as building goes here are some of the problems encountered so far.
|
I was able to successfully get it to build by adding some missing
I'm suprised these changes weren't already backported to v16, but maybe they will be in the future. Here's one of them for reference: https://chromium-review.googlesource.com/c/v8/v8/+/3934140 . It is possible that one those edits i made was unnecessary or that there is another patchset I haven't found that covers the other file. When building with icu (small-icu), it seems like icu might not be cleaned properly when choosing If I get a chance to replicate that I'll let you know. |
As far as actually running the build process goes, the instructions say to check out node-js-mobile branch, but maybe that's just a leftover from the previous setup? So far i've been able to build from the main branch. |
I'd love to be able to use a build (for android) with libicu support, but...seems painful. @jrobeson are you using that build? Just building locally? Maintaining that for my org sounds pretty painful, but if someone maintained a fork I'd probably try it. I currently use this gnarly snippet as a weak workaround (for reference and in case it's useful to anyone who lands here - YMMV): // polyfills for nodejs-mobile
global.IntlPolyfill = require('intl/lib/core');
require('intl/locale-data/jsonp/en');
global.Intl = global.IntlPolyfill;
global.IntlPolyfill.__applyLocaleSensitivePrototypes();
require('date-time-format-timezone/build/src/date-time-format-timezone-golden-zones-no-locale'); |
it didnt' feel that painful. and you probably wouldn't run into that The |
So shouild small_icu be used by default? be provided as a separate build? |
If anyone has built nodejs-mobile with icu (of any kind) enabled, what is the final size of the compiled |
the total size for arm64 libnode is 60M (that's the only one i've built). The stripped and release mode version is 48M. |
That's not too bad, just 10MB more. The new Node.js Mobile v18 may be approx 60MB with icu=none, so the baseline is going up. But anyway, 10MB for icu=small is not too bad and I can consider building for both cases and devs can pick which one they want. |
I wonder if small ICU may give us also Debugger support. |
@staltz : That's what the maintainer of capacitor-nodejs thinks: hampoelz/Capacitor-NodeJS#23 (comment) What would it take to offer an alternative build with icu? After some experience I do know that it works fine in with the small icu in practice, so it's all about the size. I only have to worry about english, so small is fine for me, but perhaps not others. If more and more libs are likely to depend on icu, then maybe the default should just be small icu even if it is bigger. |
What is the problem this feature will solve?
I'd like to use a node module that relies on on the
Intl
global, but theIntl
global is not available. I know full icu can be rather large, so the small variant might be a good default. Node itself defaults to providing icu since 14, so it is now more likely to be depended upon.I still haven't grasped how to build this project properly yet though, so I'm not quite sure how to fix it mysef.
What is the feature you are proposing to solve the problem?
Provide alternative libnode built with
--with-intl=small-icu
What alternatives have you considered?
none
The text was updated successfully, but these errors were encountered: