I'm using Webpack as core for all my front-end js project since more than a year. I'm starting to work with KRPano to create customized virtual tour. My goal is to be able to continue using my module style developement with Webpack, and include KRPano to this kind of project.
Actually the framework is a JS file with several functions to embed the viewer etc... And several js files that contains all krpano plugins.
I tried to just export the krpano file functions and include that in my project, but i got several errors and impossible de compile.
Wanted to know if someone ever done something like that, or if is there an alternative to webpack that will allow me to solve that issue ?
Thanks,
Navalex.
There are many similar frameworks. And each for their own purposes. Frameworks like Electron, Cordova may suit you. On Cordova, I created APK from Krpano tour and worked fine on my phone
Maybe your problem is that krpano is already "webpacked" and depending on which framework are you working you need the builded version and a server running.
What i have done is:
create react app
import vtour folder inisde src (for example)
navigate with a single button into vtour/index.html
build js app (react in my case)
add vtour files in the same route in builded app
sumbit to githubpages or glitch.me or something to test
Result Example:
https://imaciap.github.io/Manresa360Deploy/
Related
I am using ionic to create a mobile app following the link at http://ionicframework.com/docs/v2/getting-started/tutorial/.
ionic start my-mobileapp sidemenu --v2
Then I start my app in a browser as follows.
ionic serve
All of this worked until I changed my file extensions from *.js to *.ts.
Error: Cannot find module './pages/getting-started/getting-started'
from '/Users/jwayne/git/my-mobileapp/app'
If I simply toggle/change the file extensions back to js then things work.
My question is how does ionic know that code stored in a js file is actually TypeScript and not JavaScript if TypeScript code is stored in a js file?
I think you should be typing that...
ionic start my-mobileapp sidemenu --v2 --ts
If you want to work with Typescript, you should start a project with the --ts flag, as suggested above. Then, you should go about changing parts of your code to make them Typescript compliant.
See here for a good short overview of Javascript (ECMA6) VS Typescript:
http://www.joshmorony.com/converting-ecmascript-6-to-typescript-in-ionic-2/
As a side note, if your project is not too complex yet, I highly suggest you follow the guide and move to Typescript.
https://facebook.github.io/react-native/docs/embedded-app-ios.html#content
This facebook guide and other resources online seem to have the same current implementation guidelines. Something that seems pretty insane, and not something I'm looking to do for my react-native app.
Basically, my goal is to create a simple react-native app in a separate repo and dev space, build/bundle the JS in to the main.jsbundle file and have my current iOS application pull that script and use it on deployments.
In this case, all that is required in my old codebase is a simple wrapper function that launches the react-native app when requested, otherwise functionality acts as it has always done.
It seems pretty weird to me that people would want to write both types of code inside a single codebase, and that is not my goal.
Has anyone got any insight in to how I would accomplish this task?
My project dirs should look something like this:
iOS/
Project.xcodeproj
Project/
AppDelegate.m
main.jsbundle
React-Native/
iOS/
AppDelegate.m
index.ios.js
The main.jsbundle in iOS/ is simply the generated bundle from the react-native project.
There's an "integration with existing app" in the official doc. Looks like the way to go : https://facebook.github.io/react-native/docs/integration-with-existing-apps.html
You should be able to build the bundle outside of your iOS main project and import it later in the process. Everything should be quite easily automated.
https://apphub.io could be also a great solution. They're a a commercial service but also have an opensource self-hostable server.
edit :
MS Codepush (part of appcenter) is a great tool as well.
This is my first time develop an app using meteor, I find out there are many js files included in , like files from the default/installed packages and the clients files.
However when I view the in the live sites that created by meteor, there are very little or no js files in there at all. How can do this?
I can't find the information about this topic. Is it because the meteor will hide these js files once the app is deployed?
Yes, when your application will be deployed you'll not see them anymore. Like said by zero298, they will be minified and bundled.
In all examples for famo.us the required scripts are loaded directly from the famo.us website.
The download link at the top right of the homepage gives you an example for a boilerplate, which also contains the download of the required files from the cdn.
<script type="text/javascript" src="http://code.famo.us/lib/require.js"></script>
...
There is no download for the needed includes on the site.
Is there a way to program an offline version of your apps?
Your Question is valid but might be better worded as "Is there a download of the Famo.us javascript library in it's entirety?"
As of this Answer, there is not a download of the library unless you download it yourself from the cdn links. This is feasible and would work fine. But that is not the purpose of how you should probably use the library except for doing a proof or example.
The intention of the library is to create a leaner build by using the scaffold project created by the Yeoman generator generator-famous to scaffold a grunt and bower project. OR Another package to create the leanest project build for your application.
Here are some options:
Famous Tools Dist Generator (Tools to create a local copy in different builds)
Famous Seed (Create local project using the generator)
Browserify Seed
Webpack Seed (Not official, but in review by Famo.us)
They are working on that, but it might take a few weeks.
Your best bet is to simply install all needed resources and generate the sample project yourself. This takes about 2 minutes of your time and you will have the source code of all resources available.
Here is a step by step guide: https://www.npmjs.org/package/generator-famous
I agree that there is no a downloadable package that allow you to work with project relative links. But it is simple to achieve, just navigate to the link "http://code.famo.us/lib/require.js copy the code, place it into your javascript usual folder and you can work offline with it by having the src attribute pointing to that file. You also need to have the style sheet or your tests will not be visualised as you expect.
I have been messing around with embejs and I have been using default index.html with script tags to render templates on the page, sufice to say my index.html file is littered with:
<script type="text/x-handlebars" data-template-name="aisis">
</script>
That I would like to split up. Now I have worked with ember a little bit in rails applications, but this app doesn't have a back end, doesn't use anything other then javascript and html as its a simple internal app.
My question is, how do I split this up into partials and various other templates and still keep the app nice and small, nice and simple? I have seen a bunch of ember tools out there that generate or scaffold projects for you, but I get lost and confused fast. Where as the way I have been doing it has taught me a lot, it's just my project is massive in one index file...
Ember is designed so that each route should correspond against a template. Whenever you enter a new route, a corresponding template will automatically be rendered unless you override the "renderTemplate" hook.
Try going through the "getting started" guide here: http://emberjs.com/guides/
I would recommend looking at the yeoman suite of tools: http://yeoman.io/
It includes an Ember generator that will scaffold your project, create your bower dependencies, generate a grunt file for builds, etc. Install generator-ember to get started with the scaffolding.
Just create an empty folder, and from there use yo ember to get a complete working app. Take a look at what is generated and you can get some ideas of what to incorporate in your app.
I would check out Ember App Kit. It lets you break up the templates into various files in addition to automatically importing correct modules, linting your code and providing various build options.
Ember App Kit (EAK) is a robust starter kit for developing
applications in Ember.js. EAK makes it easy to develop, build, test,
and deploy applications independent of any back-end build process.