Meteor App hangs when adding Ecmascript - meteor

I recently updated my Meteor App to 1.3 and also want to migrate to the "new style" of coding, meaning ES2015, React, later on Apollo/GraphQL.
First I only want to use the import syntax. But when I meteor add Ecmascript it will then hang on meteor:
Building for web.browser /
takes forever.
Any ideas why?

I had the same issue. In my case this is how I got it fixed. May be it is the same for you.
I had multiple third party libraries in client/lib folder.
To use ES6 syntax, I added 'ecmascript' to my .meteor/packages file and after that issuing the meteor command would just hang.
During trial and error, I figured out that
deleting the client/lib directory made meteor to start
.
For the libraries my application depends on, I went to https://atmospherejs.com, searched for the meteor specific package name for the dependency and added these to .meteor/packages file.
e.g: Instead of copying the datatables.js and datatables.css inside client/lib folder, add 'menway:jquery-datatables' to .meteor/packages or issue the command meteor add menway:jquery-datatables

Related

Meteor AngularJS adding external js libraries

I am a little new to angular-meteor and want to add an external js library to my project.
The library is Fusioncharts.js http://www.fusioncharts.com/angularjs-charts/#/demos/ex1 and it cannot be installed using any of these options
1) bower install
2) npm install
3) meteor add (from atmosphere)
So what i did is, I followed these steps How can I add third-party JavaScript libraries to a Meteor application?
and added the libraries manually under public/js directory
Created a main.js file and added all the scripts using $.getScript
Strange thing is when I add the dependency of the 'ng-fusioncharts' module in my angular.module it throws an error
" Module 'ng-fusioncharts' is not available! You either misspelled the module name or forgot to load it."
Please let me know what could be going wrong here.
P.S : When I type in FusionCharts in the console.log I do see that object.
So it means the Fusioncharts libraries were imported properly but not added to the angular dependency
Thanks in advance
Please note that $.getScript is asynchronous, so you would need a little timeout to wait for the module to be available to the rest of your code.
Another possibility to try out would be to include your script rather in client/compatibility special folder. It will be included in your JS and execute before the rest of your client JS code.

meteor can't find global variable in node_modules

I want to use packages such as shelljs(https://atmospherejs.com/izzilab/shelljs) but I am getting an error, "can't find variable: shell". It is an npm package wrapped around for Meteor. Why wouldn't the variable be global scoped though?
Does anyone know what the best way to list all files in a local directory is within meteor client code?
if your project runs on the version of meteor 1.3 and you're writing everything in the imports folder, then you need to use export/import feature of es6 modules.

how to make meteor ignore files in a Package?

I have a package which includes a file that gets frequently rebuilt. This causes meteor to restart each time that file is edited.
There are ways to get meteor to ignore files within the main app, eg putting inside a .directory but is there a way to do this within a package?
The catch is that I DO need the final file to be included for deployment, so it has to be named - as an asset - and included in the package addFiles.
The only solution I have so far is to host the asset external to the meteor app and load it in via http or something on each cold start, but that's a bit fragile.
As of Meteor v1.5.2.1, there is support for a .meteorignore file. It behaves the same as a .gitignore. Have you tried using it?
You can use them in any directory of your project and are fully integrated with the file watching system.

Do I have a bad installation of Bootstrap 3 in my Meteor app?

I have installed two Bootstrap add-ons in my Meteor App and neither one work properly.
First I installed tsega:bootstrap3-datetimepicker and it works when I click inside the element but until I do that it appears at the very bottom of the page waiting for me to pick a date. It also doesn't display the glyphicon on the form.
Now I installed bootstrap-combobox and it doesn't work at all. It just appear as an ordinary input field with none of my four options showing.
Here is where I installed the files that came with these two add-ons:
/myapp/client/ bootstrap-datepicker.js bootstrap-combobox.js
/myapp/client/css/ bootstrap-combobox.css datepicker.css
What can I do to see what I could have done wrong with Bootstrap? This is what I followed during install:
meteor add less
meteor add nemo64:bootstrap
At the beginning of his tutorial he shows all the installed files in a /lib directory. I have no /lib directory after install.
You create /lib directory yourself, as well as /server and /client, at start of application /lib is what Meteor reads first, therefore every collection and allows to them should be placed in there, but you can check details here http://docs.meteor.com/#structuringyourapp .
And about bootstrap-3 - try to add whole package to meteor, in lib you add packages that aren't on Atmosphere platforms - https://github.com/oortcloud/unofficial-meteor-faq#how-can-i-use-someone-elses-javascript-in-my-meteor-project
meteor add mizzao:bootstrap-3

No sure how to create the Todo app using Meteor Framework

I tried replicating the todos application without using the example meteor terminal commentlets
Steps, i followed, (I'm using Ubuntu 12.04 build)
In terminal - meteor create todos
-- created the todos
a default *.html, *.css, *.js create underneath to the todos folder,
i deleted and replaced the actual todo artifacts into to it (e.g. client, server, public folders to the root) -> tried running the app - UI appears but the functionality breaks
I just wanna know what is ideal way create a app something similar structure as todos app.
This might help other folks to create a larger applications... currently i stuck in single *.js.
There's also a .meteor directory per project. Did you copy that too?
I've used a vagrant (https://github.com/pixelhandler/vagrant-dev-env) to install all of the dependencies and have an app running fine.
I just used 'meteor create myapp' like the docs say.
My bad i found it, just use this commentlet on terminal
meteor list --using
the above commentlet will list you out all the packages used for the current meteor project
Just add those project to the newly create meteor project and write your own structure, i found another way struture the project which i post as soon as possible...
meteor list --using
underscore
backbone
spiderable
accounts-ui
accounts-weibo
accounts-google
accounts-facebook
accounts-password
accounts-twitter
jquery
preserve-inputs
intersting fact is todo example comes two version one with secure and non secure packages - out-of-box build release with 0.4.2, and 0.5.0 respectively...

Resources