Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Meteor.js package? #1757

Closed
brylie opened this issue Nov 17, 2015 · 10 comments
Closed

Create Meteor.js package? #1757

brylie opened this issue Nov 17, 2015 · 10 comments

Comments

@brylie
Copy link

brylie commented Nov 17, 2015

We are trying to integrate the Swagger UI into a Meteor.js application. So far, we have succeeded by using an iFrame around the static HTML provided in the /dist folder.

We would, however, like to use swagger programatically, via the SwaggerUi instance. When including Swagger UI in our Meteor project, we have a myriad of difficulties and errors.

Would you please consider packaging Swagger UI, even if via autopublish, so that it can be used with Meteor.js?

@brylie
Copy link
Author

brylie commented Nov 17, 2015

I can open separate issues for the errors we have encountered. One example states that Handlebars.template() is undefined. This error is resolved when we use Handlebars 3.x+, but other errors occur.

@brylie
Copy link
Author

brylie commented Nov 17, 2015

@frenchbread, will you please provide additional error details?

@frenchbread
Copy link

First of all sometimes this is more common to see meteor crashing while building a newly-created meteor app with swagger-ui.js (with/without dependent libs included e.g. handlebars, backbone, underscore..). Application build stucks at this step:

=> Started proxy.                             
=> Started MongoDB.                           
   Building the application                  -

After that, there is a need to manually kill node process to be able to run the app on same port.

Also, getting same error, even though handlebars-2.0.0.js successfully loaded:

Uncaught TypeError: Handlebars.template is not a function

@brylie
Copy link
Author

brylie commented Nov 18, 2015

When we switch the Handlebars version from 2.0.0 to 3.0.0 the TypeError goes away.

Then, we have to track down errors stemming from jQuery BBQ:

TypeError: $.browser is undefined

This may be due to Meteor.js inclusion of jQuery 1.11.x

@bshamblen
Copy link

@frenchbread The version of Swagger UI that I currently have integrated is about a year old. Since it took me a few days to slowly chip away at all of the compatibility issues with Meteor I haven't felt the need to update to the latest version yet. However, it's probably time to automate the process of packaging it, so I can keep it up to date. The biggest issues were the Handlebars compatibility and global variables (since Meteor wraps each file to make everything local). I also ran into formatting issues with some of the css class names conflicting with Bootstrap (like container). I'll take a look at it again and get back to you when I have an estimate of how long I think it'll take to create a package.

@brylie brylie closed this as completed Nov 24, 2015
@brylie brylie reopened this Nov 24, 2015
@brylie
Copy link
Author

brylie commented Nov 24, 2015

@BShamblin, thanks for your response. Please let us know how we may help with testing and/or implementation. We were able to chip away at a few of the errors, but it was a bit difficult. We needed to complete a related task, so had to shift priority back to the main focus.

@fehguy
Copy link
Contributor

fehguy commented Nov 28, 2015

@brylie I'd be happy to pull in improvements to swagger-ui if they are generalized enough. I agree that some of the dependencies are getting long in the tooth.

@brylie
Copy link
Author

brylie commented May 24, 2016

@fehguy we are still unable to render the Swagger UI in our Meteor.js project that uses the Blaze template engine. It seems that Blaze, and its underlying version of Handlebars, is incompatible with the version of Handlebars used in Swagger UI.

Our code is really simple, but the Swagger UI fails to render:

Template.body.onRendered(function () {
  var swaggerUi = new SwaggerUi({
    url:"http://petstore.swagger.io/v2/swagger.json",
    dom_id:"swagger-ui-container"
  });

  swaggerUi.load();
});

The browser console contains only one error:

Uncaught TypeError: Handlebars.template is not a function

@fehguy
Copy link
Contributor

fehguy commented May 24, 2016

OK sorry. We're putting efforts into a redo of swagger-ui right now, so upgrading handlebars is not on the list. You can consider framing the UI though, or browserifying it on your own.

@webron
Copy link
Contributor

webron commented Jun 9, 2017

This should no longer be relevant. If anyone has related issues with the new UI, please file a ticket and consider submitting a PR.

@webron webron closed this as completed Jun 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants