Skip to content

Modularly load the rest api and the explorer - #230

Closed
hacksparrow wants to merge 1 commit into
strongloop:masterfrom
hacksparrow:update/loopback2
Closed

hacksparrow wants to merge 1 commit into
strongloop:masterfrom
hacksparrow:update/loopback2

Conversation

@hacksparrow

Copy link
Copy Markdown
Member

This PR updates the templates to loopback 2 conventions, along with the updated name of the explorer, loopback-component-explorer.

Comment thread package.json Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't change the version as our release tool will do it automatically.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's great! Thanks for letting me know.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these two lines should use loopback-component-explorer?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Err, yes!

@bajtos

bajtos commented Sep 17, 2015

Copy link
Copy Markdown
Member

Hi @hacksparrow, thank you for the pull request! I found few issues (see above), could you please address them?

@hacksparrow

Copy link
Copy Markdown
Member Author

@bajtos thanks a lot. I will be making the changes you suggested.

@hacksparrow

Copy link
Copy Markdown
Member Author

@bajtos I just made the changes. Please take a look.

@cebor

cebor commented Sep 18, 2015

Copy link
Copy Markdown

👍 i have waited for this, thanks ...

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think you missed some configuration for this middleware, and you also can remove the code in the server.js

see the example app: https://github.com/strongloop/loopback-example-app/pull/77/files#diff-264492e8c99bdecaf2b533ecdb34a2ebR27

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those middleware are now added using middleware.json.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes i know, but in the example app these new lines were added to it, shouldn't we also add these here?

"files": {
    "serve-static": {
      "params": "$!../client"
    }
  },

https://github.com/strongloop/loopback-example-app/blob/master/server/middleware.json#L26

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bajtos suggested that it be removed from the template.

I think a SPA client should not be a part of "API Server" template, please remove this middleware.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes i know, but in the example app these new lines were added to it, shouldn't we also add these here?

No, we shouldn't. This template is generating an "API server", the example application is built on top of this template (but it's not the same!).

In particular, the static client is configured here: https://github.com/strongloop/generator-loopback/blob/01a38d519e4b3c8b63c10a3a84c43c1b24aefdaa/example/index.js#L401-L421

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hacksparrow please remove serve-static from package.json dependencies since it's not used.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I can take care of that myself, to speed things up.

@bajtos

bajtos commented Sep 18, 2015

Copy link
Copy Markdown
Member

@hacksparrow we have renamed loopback-explorer to loopback-component-explorer in the meantime, could you take that into account too?

See https://github.com/strongloop/loopback-example-app/pull/79

@hacksparrow

Copy link
Copy Markdown
Member Author

@bajtos I thought I replaced all instances of loopback-explorer to loopback-component-explorer in this project? Or am I missing something?

@bajtos

bajtos commented Sep 21, 2015

Copy link
Copy Markdown
Member

I thought I replaced all instances of loopback-explorer to loopback-component-explorer in this project? Or am I missing something?

You are right, I must have missed that.

@bajtos

bajtos commented Sep 21, 2015

Copy link
Copy Markdown
Member

Landed via 18053ce, thank you for the contribution.

I had to also fix server/server.js to correctly load the new explorer component.

@bajtos

bajtos commented Sep 21, 2015

Copy link
Copy Markdown
Member

Released in loopback-workspace@3.18.0.

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

Successfully merging this pull request may close these issues.

5 participants