-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Refactor to use API for data access #755
Comments
closes TryGhost#755 - added html escape for post title - changed author for rss feed to current user - added simple test to check rss is working
Thinking about this - should the config really be behind the api? It's read only and environment specific. |
I have uploaded a WIP branch to https://github.com/sebgie/Ghost/tree/issue%23755 to keep everyone updated on what is going on. It is not finished and I'm not totally happy with it yet. Any feedback/thoughts welcome! cc @hswolff |
Looks like a bloody good start to me. If it works and tests are passing, I would PR it now and improve later? Note: Cos lots of people are working on refactors, smaller more frequent PRs are useful to help keep everyone up to date with each others' work. |
Added a couple of comments on that commit @sebgie. It looks really really really f'n awesome. I'm super jazzed about it, and can't wait to have it finished and merged upstream. I already have 3 things in mind that I want to do once that's merged in: F'n rock star. 🤘 |
covers 90% of TryGhost#755 - moved ghost.settings to api.settings - moved ghost.notifications to api.notifications - split up api/index.js to notifications.js, posts.js, settings.js, tags.js and users.js - added instance.globals as temp workaround for blogglobals (Known issue: blog title and blog description are updated after restart only) - added webroot to config() to remove `var root = ...` - changed `e` and `url` helper to async - updated tests
Now that #1627 is merged, is there anything left to do here? |
You can close the issue and I'm going to open a new issue for the remaining 10%. In fact, I would like to go though the code and remove direct access to the models everywhere possible and use data API instead. |
OK cool 👍 |
One step towards #360 (Big fat refactor). Refactor ghost.js so that the following data is available with functions in api.js only:
SettingsCache, ghost.config() and ghost.dataProvider should be moved to api while keeping initialization and migrations working.
The text was updated successfully, but these errors were encountered: