cljsrn

joshmiller 2022-11-09T16:18:49.408349Z

set the channel topic: ClojureScript on mobile devices via React Native | https://cljsrn.org/

πŸ‘ 3
joshmiller 2022-11-09T17:09:58.034819Z

My RN+Krell template has been updated, and should now give you the latest RN version (0.70.5) when initializing a new project: https://github.com/joshuamiller/react-native-template-cljs-krell-storybook

πŸ‘ 2
πŸ‘πŸ½ 1
πŸŽ‰ 6
tifa 2022-11-23T08:19:43.613929Z

@joshmiller Is it possible to write stories(and components) for a Storybook in ClojureScript using your RN+Krell template?

joshmiller 2022-11-23T15:28:20.143819Z

I am sure it is possible, but I have not tried to do it. The stories are so minimal it doesn’t seem worth the effort.

Will Weiss 2022-11-10T06:11:14.335289Z

Thanks @joshmiller for this work! I'm trying to get this project set up and am running into an issue with bundler. I'm seeing that the version of bundler is older than the version that created the lock file. When I subsequently run ruby -v and gem update bundler it looks like I have the correct versions. Any idea what might be going on? Thanks in advance!

$ npx react-native init cljkrelltest --template react-native-template-cljs-krell-storybook           

                  Welcome to React Native!                
                 Learn once, write anywhere               

βœ” Downloading template
βœ” Copying template
βœ” Processing template
β„Ή Executing post init script 
βœ– Installing Bundler
error Warning: the running version of Bundler (2.1.4) is older than the version that created the lockfile (2.2.27). We suggest you to upgrade to the version that created the lockfile by running `gem install bundler:2.2.27`.
Your Ruby version is 2.7.5, but your Gemfile specified 2.7.4

βœ– Installing Bundler
error Error: Looks like your iOS environment is not properly set. Please go to  and follow the React Native CLI QuickStart guide for macOS and iOS.
β”Œ[willweiss@isengard]-(~/dev)
β””> gem update bundler
Updating installed gems
Nothing to update
Gems already up-to-date: bundler
β”Œ[willweiss@isengard]-(~/dev)
β””> ruby -v
ruby 2.7.4p191 (2021-07-07 revision a21a3b7d23) [arm64-darwin22]

Will Weiss 2022-11-11T14:56:18.735329Z

Thanks for that fix! I got further this time, and then ran into this issue when running npx react-native run-ios

info Reloading app...
 BUNDLE  ./index.js 

error: Error: Unable to resolve module ./target/main.js from /Users/willweiss/dev/cljkrelltest/index.js: 

None of these files exist:
  * target/main.js(.native|.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)
  * target/main.js/index(.native|.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)
   8 | } from 'react-native';
   9 | import {name as appName} from './app.json';
> 10 | import {krellUpdateRoot, onKrellReload} from './target/main.js';
     |                                               ^
  11 |
  12 | let plainStyle = {
  13 |     flex: 1,
    at ModuleResolver.resolveDependency (/Users/willweiss/dev/cljkrelltest/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:152:15)
    at DependencyGraph.resolveDependency (/Users/willweiss/dev/cljkrelltest/node_modules/metro/src/node-haste/DependencyGraph.js:264:43)
    at Object.resolve (/Users/willweiss/dev/cljkrelltest/node_modules/metro/src/lib/transformHelpers.js:170:21)
    at resolveDependencies (/Users/willweiss/dev/cljkrelltest/node_modules/metro/src/DeltaBundler/graphOperations.js:466:33)
    at processModule (/Users/willweiss/dev/cljkrelltest/node_modules/metro/src/DeltaBundler/graphOperations.js:232:31)
    at async traverseDependenciesForSingleFile (/Users/willweiss/dev/cljkrelltest/node_modules/metro/src/DeltaBundler/graphOperations.js:221:3)
    at async Promise.all (index 0)
    at async initialTraverseDependencies (/Users/willweiss/dev/cljkrelltest/node_modules/metro/src/DeltaBundler/graphOperations.js:204:3)
    at async DeltaCalculator._getChangedDependencies (/Users/willweiss/dev/cljkrelltest/node_modules/metro/src/DeltaBundler/DeltaCalculator.js:208:25)
    at async DeltaCalculator.getDelta (/Users/willweiss/dev/cljkrelltest/node_modules/metro/src/DeltaBundler/DeltaCalculator.js:90:16)

joshmiller 2022-11-11T22:57:03.948559Z

This is because you haven’t built the CLJS yet. yarn cljs:build should do that for you. yarn cljs:repl will do it and leave a repl connection open.

πŸ‘ 1
joshmiller 2022-11-10T15:57:15.330659Z

@will568 I wonder if deleting Podfile.lock and then reinstalling would fix this? If so, I can make that fix on the repo as well.

Will Weiss 2022-11-10T16:05:12.006559Z

Thanks for helping out Josh! I'm looking at the project and don't see a Podfile.lock file. I also have flutter installed which appears to have Podfile.lock files stored elsewhere

/opt/homebrew/Caskroom/flutter/3.3.4/flutter/dev/integration_tests/flutter_gallery/macos/Podfile.lock
/opt/homebrew/Caskroom/flutter/3.3.4/flutter/examples/platform_view/ios/Podfile.lock

joshmiller 2022-11-10T16:06:53.167899Z

Hm, that’s weird, because the error message about the older version of Bundler would refer to a previous version of Podfile.lock, so I sssumed it was in there.

Will Weiss 2022-11-10T16:07:19.376479Z

Hm, strange...

joshmiller 2022-11-10T16:08:01.244719Z

Did you try gem install bundler:2.2.27

Will Weiss 2022-11-10T16:08:29.586709Z

gem install bundler:2.2.7
Fetching bundler-2.2.7.gem
Successfully installed bundler-2.2.7
Parsing documentation for bundler-2.2.7
Installing ri documentation for bundler-2.2.7
Done installing documentation for bundler after 1 seconds
1 gem installed

joshmiller 2022-11-10T16:08:50.083489Z

Sorry, 27, typo on my part

Will Weiss 2022-11-10T16:09:07.649509Z

no worries!

$ gem install bundler:2.2.27
Fetching bundler-2.2.27.gem
Successfully installed bundler-2.2.27
Parsing documentation for bundler-2.2.27
Installing ri documentation for bundler-2.2.27
Done installing documentation for bundler after 1 seconds
1 gem installed

joshmiller 2022-11-10T16:09:30.565449Z

Maybe try a clean new install from the template now that you have that exact version?

Will Weiss 2022-11-10T16:09:42.337739Z

Ok! trying now...

Will Weiss 2022-11-10T16:11:50.479339Z

Ok! That appeared to fix the bundler version issue, but not the ruby version issue. I have rbenv installed and my global ruby version set to 2.7.4 β€” so I'm not sure what's going on.

$ npx react-native init cljkrelltest --template react-native-template-cljs-krell-storybook

                  Welcome to React Native!                
                 Learn once, write anywhere               

βœ” Downloading template
βœ” Copying template
βœ” Processing template
β„Ή Executing post init script 
βœ– Installing Bundler
error Your Ruby version is 2.7.5, but your Gemfile specified 2.7.4

βœ– Installing Bundler
error Error: Looks like your iOS environment is not properly set. Please go to  and follow the React Native CLI QuickStart guide for macOS and iOS.
β”Œ[willweiss@isengard]-(~/dev)
β””> ruby -v
ruby 2.7.4p191 (2021-07-07 revision a21a3b7d23) [arm64-darwin22]

joshmiller 2022-11-10T16:13:36.346299Z

Hm, maybe remove the .ruby-version?

Will Weiss 2022-11-10T16:14:32.943739Z

$ cd cljkrelltest/
Version 'nvm' not found - try `nvm ls-remote` to browse available versions.
β”Œ[willweiss@isengard]-(~/d/cljkrelltest)
β””> ls -la
total 1352
drwxr-xr-x    31 willweiss  staff     992 Nov 10 10:10 ./
drwxr-xr-x    40 willweiss  staff    1280 Nov 10 10:09 ../
-rw-r--r--     1 willweiss  staff     114 Nov 10 10:09 .buckconfig
drwxr-xr-x     3 willweiss  staff      96 Nov 10 10:09 .bundle/
-rw-r--r--     1 willweiss  staff      74 Nov 10 10:09 .eslintrc.js
-rw-r--r--     1 willweiss  staff    1451 Nov 10 10:09 .flowconfig
-rw-r--r--     1 willweiss  staff     844 Nov 10 10:09 .gitignore
-rw-r--r--     1 willweiss  staff       3 Nov 10 10:09 .node-version
-rw-r--r--     1 willweiss  staff      16 Nov 10 10:09 .nvmrc
-rw-r--r--     1 willweiss  staff     141 Nov 10 10:09 .prettierrc.js
-rw-r--r--     1 willweiss  staff       6 Nov 10 10:09 .ruby-version
drwxr-xr-x     3 willweiss  staff      96 Nov 10 10:09 .storybook/
-rw-r--r--     1 willweiss  staff       2 Nov 10 10:09 .watchmanconfig
-rw-r--r--     1 willweiss  staff    2465 Nov 10 10:09 App.js
-rw-r--r--     1 willweiss  staff     168 Nov 10 10:09 Gemfile
-rw-r--r--     1 willweiss  staff    2414 Nov 10 10:09 Gemfile.lock
drwxr-xr-x     3 willweiss  staff      96 Nov 10 10:09 __tests__/
drwxr-xr-x     9 willweiss  staff     288 Nov 10 10:09 android/
-rw-r--r--     1 willweiss  staff      61 Nov 10 10:09 app.json
-rw-r--r--     1 willweiss  staff      77 Nov 10 10:09 babel.config.js
-rw-r--r--     1 willweiss  staff      80 Nov 10 10:10 build.edn
-rw-r--r--     1 willweiss  staff     164 Nov 10 10:09 deps.edn
-rw-r--r--     1 willweiss  staff    1631 Nov 10 10:09 index.js
drwxr-xr-x     6 willweiss  staff     192 Nov 10 10:09 ios/
drwxr-xr-x     4 willweiss  staff     128 Nov 10 10:09 js/
-rw-r--r--     1 willweiss  staff     299 Nov 10 10:09 metro.config.js
drwxr-xr-x  1101 willweiss  staff   35232 Nov 10 10:10 node_modules/
-rw-r--r--     1 willweiss  staff    1466 Nov 10 10:10 package.json
-rw-r--r--     1 willweiss  staff    1210 Nov 10 10:09 post_install.cljs
drwxr-xr-x     3 willweiss  staff      96 Nov 10 10:10 src/
-rw-r--r--     1 willweiss  staff  607433 Nov 10 10:10 yarn.lock
β”Œ[willweiss@isengard]-(~/d/cljkrelltest)
β””> rm .ruby-version 

Will Weiss 2022-11-10T16:14:59.384799Z

How do I then restart the install process (not from scratch via npx react-native init cljkrelltest --template react-native-template-cljs-krell-storybook)

joshmiller 2022-11-10T16:17:38.166519Z

I don’t think there’s any functionality to do that unfortunately, it just points you at the quick start guide.

joshmiller 2022-11-10T16:18:51.477219Z

I think there also might be a conflict between .node-version (I think new in this RN version) and .nvmrc.

joshmiller 2022-11-10T16:19:10.647439Z

I’m going to be afk for a while, but I can look into these later today.

Will Weiss 2022-11-10T16:19:23.817939Z

Ok, thanks for your help Josh!

Will Weiss 2022-11-10T17:07:47.263759Z

I noticed that the version numbers in the Gemfile and ruby_version don't match, so here's a PR to fix that: https://github.com/joshuamiller/react-native-template-cljs-krell-storybook/pull/4

joshmiller 2022-11-11T02:50:18.258419Z

@will568 Awesome, thanks for finding that. I ended up going the opposite direction and updating the Gemfile instead (as I should have done when upgrading RN).

πŸ‘ 1
joshmiller 2022-11-11T02:50:39.573589Z

Did you end up getting everything going after making that change? Or still having issues with Node?