Git Product home page Git Product logo

Comments (19)

justinr1234 avatar justinr1234 commented on June 16, 2024

@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.

larixer avatar larixer commented on June 16, 2024

@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.

justinr1234 avatar justinr1234 commented on June 16, 2024

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

@Vlasenko

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.

larixer avatar larixer commented on June 16, 2024

@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.

justinr1234 avatar justinr1234 commented on June 16, 2024

@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.

larixer avatar larixer commented on June 16, 2024

@justinr1234 Yes, I like this idea as well

from create-apollo-app.

justinr1234 avatar justinr1234 commented on June 16, 2024

@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.

larixer avatar larixer commented on June 16, 2024

@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.

justinr1234 avatar justinr1234 commented on June 16, 2024
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.

justinr1234 avatar justinr1234 commented on June 16, 2024

Removed my global tsc fixed it

from create-apollo-app.

larixer avatar larixer commented on June 16, 2024

ok

from create-apollo-app.

justinr1234 avatar justinr1234 commented on June 16, 2024

@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.

larixer avatar larixer commented on June 16, 2024

@justinr1234 I guess something like this:
https://github.com/sysgears/spin.js/blob/master/src/plugins/ApolloPlugin.ts#L67

from create-apollo-app.

larixer avatar larixer commented on June 16, 2024

@justinr1234 Are you still working on this plugin?

from create-apollo-app.

justinr1234 avatar justinr1234 commented on June 16, 2024

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.

larixer avatar larixer commented on June 16, 2024

@justinr1234 Very interesting ideas and a use case for virtual modules, thanks!

from create-apollo-app.

mitjade avatar mitjade commented on June 16, 2024

@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.

justinr1234 avatar justinr1234 commented on June 16, 2024

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.

mitjade avatar mitjade commented on June 16, 2024

@justinr1234 Cool. Will try it out.

from create-apollo-app.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.