Comments (12)
There is no simple workaround and Parse / FB is not going to do it because you know, React! Good news is that I'm almost done with creating a Backbone 1.2.3 fork that works fully with Parse 1.6. About 95% of the way there at this point pending a little more testing. I should have it done this week and open sourced. Nice thing too is that I modularized Backbone and made it ES6 making it easy to modify it in a clean way. I'll also be distributing minimal / lightweight ES5 bundles designed to be consumed in various module systems (RequireJS, SystemJS, etc.) along with an all inclusive bundle designed for global usage.
from parse-sdk-js.
Thanks a million, @typhonrt ! Looking forward to it.
from parse-sdk-js.
My app just came to a screeching halt because of this. Looking forward to your implementation typhonrt.
The least Parse could do is provide a migration guide or something.
from parse-sdk-js.
@cfoulston Thanks for reminding me of this issue...
I've had the repos up for a week or so, but have been polishing off documentation and I have still to get a repo up for a full SystemJS / JSPM demo which is a great way to consume the ES6 source. If you want to check things out though the Backbone-Parse-ES6 repo is: https://github.com/typhonjs-parse/backbone-parse-es6
The /dist
directory has various ES5 bundles for AMD, CJS, and global consumption.
If you weren't using Backbone / Parse previously with a module system you'll want to choose the global bundles. The basic global bundle has Backbone & Parse. You'll need to load Underscore & a jQuery equivalent via script tags before the backbone-parse library. The "global inclusive" bundle also contains Underscore and jQuery.
and the main SystemJS / JSPM + global demo will be up here before the end of the week most likely:
- https://github.com/typhonjs-demos/backbone-parse-es6-todos
- https://github.com/typhonjs-demos/backbone-parse-es6-todos-improved
Technically you should be able to use things just like before and I have a whole framework on top of Backbone that works, but that doesn't mean I have all the angles tested. I'm going to be updating to Backbone 1.2.4 / or the next latest release and port over all of the tests from the original Backbone repo at that time and also see if I can come up with some way of auto-testing Parse thoroughly.
Drop an issue in the repos for questions.
from parse-sdk-js.
@typhonrt I have an old parse project which uses JS SDK 1.2.12, Can I use your library as a drop in replacement for parse library? I'm already using require-js for my modules like,
define(
[
'jquery',
'underscore',
'parse',
'models/Comment',
'collections/Comments'
], function($, _, Parse, Comment, Comments)
{
}
);
Do I need to make code changes in every file to get it work with new parse open-source server?
from parse-sdk-js.
Unfortunately RequireJS support is a bit challenging. There is an existing issue: typhonjs-backbone-parse/backbone-parse-es6#8 regarding RequireJS support where I detail the problem. A small change to the Parse JS SDK could solve the problem: #144, but @andrewimm has not weighed in on the solution. backbone-parse-es6 does support JSPM and potentially other package managers. More or less my hands are tied in being able to support RequireJS easily.
from parse-sdk-js.
@typhonrt Thank you so much for the prompt response. Could you please point a PR or add somewhere the changes required in Parse JS SDK, so we can continue with AMD module from your repo?
from parse-sdk-js.
We'll my hands are tied as I'm not involved with Parse and #144 has gone without answer or confirmation from @andrewimm for months, so a PR is pointless as it will just sit by the wayside as well most likely. There is a simple solution; Parse.encode = encode; Parse.decode = decode;
in Parse.js, but if I can't get FB to acknowledge it then it's beyond what I can do personally. I already provided the only community solution to the outright abandonment of Backbone in regard to Parse.
It works great for modern package managers such as JSPM presently. It's not like I don't want to support legacy solutions like RequireJS as well, but such is life. Upgrading your web app while taking more work to use JSPM, Webpack, etc. will solve things. I've posted the solution above, but it's a crapshoot if FB will add it to the JS SDK.
Unfortunately the solution to typhonjs-backbone-parse/backbone-parse-es6#5 outweighs the side effect of breaking easy RequireJS support, but once again a small modification to the Parse JS SDK would allow things to proceed with full RequireJS support out of the box. Contact the Parse team and let them know you'd like to see this solved.
from parse-sdk-js.
I'm using parse-bone with require-js with few modifications to remove the wrapper and it is working as expected. Thanks for your support @typhonrt
from parse-sdk-js.
@midhunanew parse-bone may work for now and is the best drop in replacement, but likely won't see much further progress. I guess the difference with https://github.com/typhonjs-backbone-parse/backbone-parse-es6 is that I am supporting the latest Backbone release and updates and you can use the latest version of the Parse JS SDK.
The problem I outlined above is that to get nested pointer relationships to encode / save correctly I have to directly access the encode file of the Parse JS SDK. This makes usage in RequireJS a bit messy. I haven't tried all too hard to get it working as well I don't need that functionality as modern package managers solve the problem transparently. I gather one can duplicate the parse JS SDK to create a hack workaround with RequireJS, but it's not clean per se. I'm not getting paid for any of this so can't exactly focus on this since there is such an easy solution if the Parse JS team takes my suggestion up for consideration. The problem is that encode.js references a bunch of other internal Parse JS files and the dependencies continue to chain up to foul things up w/ RequireJS. If it were exposed via Parse.js / ala Parse.encode(...)
there would be no problem.
from parse-sdk-js.
So I know that this a bit old but was able to fix a lot of the bugs in are parse code by doing this close to start of the page load. Hope this helps other solve this problem.
define (['underscore', 'parse', 'backbone'], function (_, Parse, Backbone) {
Parse.Collection = Backbone.Collection;
function extend(obj, destination, source) {
for (var k in source) {
if (!destination.hasOwnProperty(k)) {
obj[k] = source[k];
}
}
return obj;
};
// add all methods that are in backbone and not in parse, to make it more like the old parse library
extend(Parse.Object.prototype, Parse.Object.prototype, Backbone.Model.prototype);
var models = {};
models.Campaign = Parse.Object.extend({
// parse model logic
});
return models;
});
from parse-sdk-js.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
from parse-sdk-js.
Related Issues (20)
- API Reference Documentation not updated HOT 1
- SDK throws error in web contexts where calling into `window.indexedDB` is prohibited, but not undefined on the window HOT 2
- Calling `.add` multiple times on relations is broken HOT 4
- Refused to get unsafe header "access-control-expose-headers" on Chrome HOT 17
- Allow for REST Content Override for Server protection HOT 2
- Align currently supported Node.js version HOT 4
- `Parse.User.verifyPassword` does not pass request options to server HOT 5
- Parse SDK 4.3.1 is not working with React Native / Expo HOT 9
- Expo RN and ParseLiveQuery EventEmitter error HOT 13
- Cannot set ACL from JSON HOT 1
- Infinite loop in `encode.js` HOT 5
- Missing test for `Parse.User.verifyPassword` option `ignoreEmailVerification` HOT 2
- `Parse.Object.set` sliently handles validation errors HOT 1
- TypeError: attempted to use private field on non-instance, js engine: hermes HOT 3
- Installation support for JS SDK HOT 4
- Allow to run queries through LiveQueryClient (Parse Server issue #9086) HOT 5
- Local state of objects not correct if setting multiple properties HOT 2
- LocalDatastore tests fail HOT 4
- Parse.Installation doesn't handle deleted Installation objects on server HOT 3
- Replace dependency ip-node HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from parse-sdk-js.