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

Don't reopen the store #367

Closed
runspired opened this issue Dec 20, 2022 · 7 comments · Fixed by #372
Closed

Don't reopen the store #367

runspired opened this issue Dec 20, 2022 · 7 comments · Fixed by #372

Comments

@runspired
Copy link

this reopen is largely unnecesssary as it is, just adding to the class directly would work though even better would be to keep these as utils only.

@fsmanuel
Copy link
Member

@runspired thanks for opening the issue. I'll look into it.

@fsmanuel
Copy link
Member

fsmanuel commented Dec 21, 2022

@runspired you are talking about this, right?

export function initialize() {
if (!Store.prototype._emberLocalStoragePatched) {
Store.reopen({
_emberLocalStoragePatched: true,
importData: function (json, options) {
return importData(this, json, options);
},
exportData: function (types, options) {
return exportData(this, types, options);
},
});
}
}

I was already planning to provide it as utility functions. So I'll deprecate it and remove it in a future version.

@mwpastore
Copy link
Contributor

mwpastore commented Apr 10, 2023

I'm getting the following error after doing an ember-cli-update to 4.12 updating to ember-data 4.12:

local-storage-adapter.js:11
Uncaught TypeError: _emberData.default.Store.reopen is not a function
    at Object.initialize (local-storage-adapter.js:11:1)
    at index.js:130:1
    at Vertices.each (dag-map.js:192:1)
    at Vertices.walk (dag-map.js:121:1)
    at DAG.each (dag-map.js:66:1)
    at DAG.topsort (dag-map.js:72:1)
    at App._runInitializer (index.js:154:1)
    at App.runInitializers (index.js:128:1)
    at App._bootSync (index.js:489:1)
    at App.domReady (index.js:390:1)

@fsmanuel
Copy link
Member

@runspired can you tell me which version of ember data removed the Store.reopen? From the failing tests I would say it's 4.12 is this correct?

@fsmanuel
Copy link
Member

Released in v2.0.5

@runspired
Copy link
Author

From the failing tests I would say it's 4.12 is this correct?

Yes. We're going to bring it back (for now) but glad usage here is removed.

@fsmanuel
Copy link
Member

@runspired Thanks for the confirmation! I'll have to get more familiar with the changes in ember data and how to utilize them here. From what I saw it looks like a lot of work with great results. Thanks for working so hard on ember data!

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 a pull request may close this issue.

3 participants