Comments (19)
@Vlasenko Another question is the best place to put this loading code:
https://github.com/expo/nativebase-example/blob/master/main.js#L33
from create-apollo-app.
@justinr1234 I believe packagerOpts
should be in app.json
in the application code. And loading code should also be in entry of application code. I think both should be outside of spin.js
. But I'm open to discussion.
from create-apollo-app.
Ya for situations like this where there's "additional setup code required", how would you want to handle that in the instructions / documentation?
For instance, I think for the app.json
we could theoretically merge extra opts in similar to here: https://github.com/sysgears/spin.js/blob/master/src/executor.ts#L609
Specifically ttf
needs to be added to packagerOpts
: https://github.com/expo/nativebase-example/blob/master/exp.json#L20
"packagerOpts": {
"assetExts": ["ttf", "mp4"]
},
from create-apollo-app.
@justinr1234 Good idea, we actually can. But I have no yet plugin architecture for executor. Feel free to just hack in needed logic into executor.ts
directly to support native-base
from create-apollo-app.
@Vlasenko Another idea for the case of the async loading of fonts on startup, there could be the possibility of exposing a higher order component to do async loading of things that are required by packages in the spin plugin: https://github.com/expo/nativebase-example/blob/master/main.js#L33
import { withSpin } from 'spinjs';
import App from './App';
export default withSpin(App);
from create-apollo-app.
@justinr1234 Yes, I like this idea as well
from create-apollo-app.
@Vlasenko any ideas here?
> tslint --fix 'src/*.ts*' -p tsconfig.json --type-check && tslint 'test/*.ts*' -p tsconfig.json --type-check --lib es6,dom
Error at src/executor.ts:106:30: Property 'files' does not exist on type 'string'.
Error at src/executor.ts:138:31: Property 'unshift' does not exist on type 'string'.
Error at src/executor.ts:140:27: Property 'unshift' does not exist on type 'string'.
Error at src/executor.ts:179:27: Property 'push' does not exist on type 'string'.
Error at src/executor.ts:181:27: Property 'push' does not exist on type 'string'.
Error at src/executor.ts:326:30: Property 'files' does not exist on type 'string'.
That's in code I didn't touch.
from create-apollo-app.
@justinr1234 I have just tried to run yarn lint
and I don't see any errors. How do you launch linting?
from create-apollo-app.
spin.js$ yarn lint
yarn lint v0.27.5
$ tslint --fix 'src/*.ts*' -p tsconfig.json --type-check && tslint 'test/*.ts*' -p tsconfig.json --type-check
Error at src/executor.ts:106:30: Property 'files' does not exist on type 'string'.
Error at src/executor.ts:138:31: Property 'unshift' does not exist on type 'string'.
Error at src/executor.ts:140:27: Property 'unshift' does not exist on type 'string'.
Error at src/executor.ts:179:27: Property 'push' does not exist on type 'string'.
Error at src/executor.ts:181:27: Property 'push' does not exist on type 'string'.
Error at src/executor.ts:326:30: Property 'files' does not exist on type 'string'.
error Command failed with exit code 1.
spin.js$ npm run tsc --version
4.6.1
spin.js$ npm run tslint --version
4.6.1
from create-apollo-app.
Removed my global tsc fixed it
from create-apollo-app.
ok
from create-apollo-app.
@Vlasenko Any ideas on how to expose client side stuff with this architecture? My initial tries have been failure.
Not sure how to do runtime checking of the stack on the client to make sure what functions would be run.
from create-apollo-app.
@justinr1234 I guess something like this:
https://github.com/sysgears/spin.js/blob/master/src/plugins/ApolloPlugin.ts#L67
from create-apollo-app.
@justinr1234 Are you still working on this plugin?
from create-apollo-app.
Yes, been slammed. I was pretty close but never settled on a way to do client side startup. I had a proof of concept with your virtual modules, but I think I want to do reading in a file and then export it as a virtual module. That way each plugin can define a startup.js
and then it would read in the file as a string and export a virtual webpack module. The issue with making it non virtual would be the need to take a client side dependency on spinjs. Also using a virtual module would let a plugin decide to export its startup as a string with replacement. Finally I was going to export a virtual import for async spinStartup()
that would allow the client to decide when to run the startup functions.
I was close to having this finished but I won't be able to get back to it until this weekend probably.
from create-apollo-app.
@justinr1234 Very interesting ideas and a use case for virtual modules, thanks!
from create-apollo-app.
@justinr1234 Did you manage to get this working? I am would like to add this to the sysgears/apollo-universal-starter-kit
.
from create-apollo-app.
I didn't get the virtual files working. I had to manually add font loading on startup to the starter kit. Otherwise yes native base works.
from create-apollo-app.
@justinr1234 Cool. Will try it out.
from create-apollo-app.
Related Issues (20)
- backendUrl vs __BACKEND_URL__ clarification HOT 1
- node externals for backend HOT 9
- server restart when webpack throws warning [HMR] Cannot find update. HOT 2
- when using react-hot-loader and typescript throws errors HOT 4
- Problem with lack of extra option support for CSS/LESS loaders HOT 2
- docker question HOT 1
- external plugins HOT 1
- New Logo/Icon HOT 1
- Error: spawn yarnpkg ENOENT (windows) HOT 5
- using npm library in babelrc HOT 8
- spin error WebpackOptionsValidationError HOT 2
- Yarn errors when trying to create a React app HOT 1
- Storybook HOT 1
- [Enhancement] support for Docker
- error package.json: Name contains illegal characters HOT 1
- Drop GraphiQL in favor of already integrated playground? HOT 4
- error Cannot create "/usr/local/bin/create-apollo-app" due to insufficient permissions. HOT 2
- upgrade the expo dependencies
- Add .gitignore to scaffolding process HOT 3
- Fresh install no matter what type of app I create gets error envelope routines unsupported HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from create-apollo-app.