-
Notifications
You must be signed in to change notification settings - Fork 984
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
Move goog.i18n deps to a module #8360
Conversation
Pull Request Checklist
|
Jenkins BuildsClick to see older builds (64)
|
1ddb1e3
to
ac10daa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work does it means that we can expect i18n calls to be slightly more performant ? Computing timestamps is actually one of the bottlenecks so that'd be neat!
I doubt that it will have any effect in runtime. |
@rasom ok thanks. btw I've read that type hinting in cljs is only useful for booleans, I wonder if we are using enough of them for it to be worth doing |
100% of end-end tests have passed
Passed tests (49)Click to expand |
Makefile
Outdated
@@ -100,16 +100,22 @@ prod-build: | |||
|
|||
prod-build-android: export TARGET_OS ?= android | |||
prod-build-android: | |||
lein prod-build-android | |||
cp params_prod.edn params.edn && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this cp
be here? Why not make it e separate target? Like:
prod-params:
cp params_prod.edn params.edn
prod-build-android: prod-params
Or something like that.
Also, can you explain what this file changes exactly? Maybe you can add that as a comment to the Makefile target?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file changes the parameter which makes macro behave differently in prod and dev env.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Obviously, but differently how?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, who use these files? Is there any reason why this can't be managed by env variables?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currently defmodule
macro uses this file (introduced in this PR), another macro will need platform version in that file. This is necessary to provide env vars during cljs compile time. It can be done via env vars though might be a bit implicit. I would merge it as it is and then spend time on this later, because I'm kind of have a bit different objective. It works and I'm happy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, just don't want to multiply entities in the repo if it's not necessary. And it doesn't have to be implicit, you can clearly define the env variable above the Makefile target and make it very clear so as to what it does, like so:
prod-build-android: export TARGET_OS ?= android
prod-build-android: export BUILD_ENV ?= prod
prod-build-android:
lein prod-build-android && \
node prepare-modules.js
We also have .env*
files in the repo root which contian various settings like that, might be a good place for that too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for some reason BUILD_ENV
is not seen from lein if defined this way, only if I make it BUILD_ENV=prod lein prod-build-android && \
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be because of --pure
.
https://github.com/status-im/status-react/blob/cdae3423bcc986d9a390de0a5479cfa4c005c121/nix/shell.sh#L34-L38
For now the simplest thing to do would be to just add a --keep BUILD_ENV
somewhere in there. What do you think @pombeirp ?
I can do a separate PR that will add an env variables to do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about this: #8398
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've merged #8398 so try rebasing and adding an export NIX_KEEP ?= 'BUILD_ENV'
somewhere at the top of the Makefile
, probably next to this:
https://github.com/status-im/status-react/blob/0e7f73fd11e396c5e5fa898178d3872eb676f234/Makefile#L29
And add a comment saying something like:
# Defined which variables will be kept for Nix pure shell, use semicolon as divider
And we should be golden.
This PR now has conflicts due to #8360 being merged. |
@jakubgs rebased |
100% of end-end tests have passed
Passed tests (49)Click to expand |
100% of end-end tests have passed
Passed tests (49)Click to expand |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much nicer.
No regression found.
|
This PR adds the first cljs module to the project and introduces
defmodule
macro which makes definition of module's api and loading of module a bit simpler.Moving all
goog/i18n
mentions to a separate module makesindex.android.js
8.91% smaller (2729KB vs 2996KB) and startup ~4% faster. The loading of the module even on a slow device is quite fast (90ms), assuming its size is ~216KB. Probably it is smaller and faster than it was before this PR because I rewrote it a bit so that compilation warning doesn't appear anymore, and thusgood/i18n
calls are now optimized better during compilation.This warning is fixed:
Loading of module on Samsung a500d:
status: ready