You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 11, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 11, 2023. It is now read-only.
This would be very important. I've tried for hours to get Jaydata + Webpack work with no success. Since webpack is currently pretty much the only supported (or at least somewhat documented) way for bundled angular2 applications, Jaydata currently prevents me from shipping a release version of the application. The development version using SystemJS is working, however. But we can't ship with a full node_modules folder in a release build, so webpack is currently the only solution.
I added the json-loader (I had it in my project for other libs) but still there are problems with webpack: Main cause is that under webpack, Jaydata will require('jaydata/core') in my Context.js generated by jaysvcutiland at runtime will lazily try to load storage providers (odata, sqlite). But the lazy loading fails as the load location does not exist in a webpack bundle (i get 404 to /jaydataproviders/oDataProvider.min.js). There should be some way to hard-include the storage providers with webpack and lazy loading must follow commonjs and/or AMD semantics.
Edit/Note: Now that I think of it, lazy (async) loading is not supported in CommonJS modules (and thus not in webpack). Currently, jaydata tries to load the storage provider (i.e. odata) once factory() is called with a { provider: 'odata' } argument. This lazy-loading code has to be changed for CommonJS/Webpack envs, as CommonJS does not allow to load modules asynchronously at all.
Reacted by Brandon R Staley and Vladan K. Stojanović
Activity
satlom commentedon Sep 20, 2016
+1
bstaley commentedon Nov 7, 2016
@robesz @lazarv This would be great to have. Any update on this?
Dynalon commentedon Nov 8, 2016
This would be very important. I've tried for hours to get Jaydata + Webpack work with no success. Since webpack is currently pretty much the only supported (or at least somewhat documented) way for bundled angular2 applications, Jaydata currently prevents me from shipping a release version of the application. The development version using SystemJS is working, however. But we can't ship with a full
node_modulesfolder in a release build, so webpack is currently the only solution.PeterAronZentai commentedon Nov 8, 2016
@lazarv ^^
Sorry guys for not earlier - but we pick this up today.
Fix webpack support #271
lazarv commentedon Nov 9, 2016
Sorry for being so late with the webpack support fix, please update JayData to latest version from npm (1.5.10).
You have to include the json-loader in the webpack config file.
A simple example webpack.config.js:
Dynalon commentedon Nov 9, 2016
I added the json-loader (I had it in my project for other libs) but still there are problems with webpack: Main cause is that under webpack, Jaydata will
require('jaydata/core')in myContext.jsgenerated byjaysvcutiland at runtime will lazily try to load storage providers (odata, sqlite). But the lazy loading fails as the load location does not exist in a webpack bundle (i get 404 to/jaydataproviders/oDataProvider.min.js). There should be some way to hard-include the storage providers with webpack and lazy loading must follow commonjs and/or AMD semantics.Edit/Note: Now that I think of it, lazy (async) loading is not supported in CommonJS modules (and thus not in webpack). Currently, jaydata tries to load the storage provider (i.e. odata) once
factory()is called with a{ provider: 'odata' }argument. This lazy-loading code has to be changed for CommonJS/Webpack envs, as CommonJS does not allow to load modules asynchronously at all.lazarv commentedon Nov 9, 2016
Just
require("jaydata/odata");(orimport "jaydata/odata";in TypeScript) before you import your generated context.