Comments (7)
This library doesn't have any side-effecting getters. It has a bunch of getters, but they are pure. At least, I have ripgrepped the codebase pretty hard and examined the ones it has. If you can find one yourself, let me know.
If it's a getter problem, it's either upstream (dnd-core
) or in your code. My guess from your stack trace is the latter (it has beginDrag
a few frames back). Edit: being in your code is supported by the fact that ng build --prod
is working just fine on the examples page.
It's not necessarily a getter problem, though. I'll think about what else it could be.
from angular-skyhook.
Hey, thank you for the quick response!
I checked our code, and there is not a single place where we call endDrag
ourselves, thus making me think it cannot be our fault.
If this assumption is wrong and it could still be our fault please say so, then I will do another more thorough examination.
Edit: I checked our code quickly, none of our getters seem to have side-effects.
from angular-skyhook.
I also did a quick search in dnd-core, and found this issue that is atleast somewhat similar: react-dnd/react-dnd#1049
Will have another, better, look tomorrow.
from angular-skyhook.
So this morning I did some searching around and I found more issues on dnd-core
related to minimization. So if you agree that they should fix this we can close this issue here, and I'll make a new one over there.
Some related issues on dnd-core
:
https://github.com/react-dnd/react-dnd/issues?utf8=%E2%9C%93&q=is%3Aissue+minimize
None of them over any real solution other than to disable the minification.
from angular-skyhook.
Wew, after what looked like it was turning into a very big headache this morning turned out pretty great, I found a workaround!
Basically it boils down to not using UglifyJS as minimizer in webpack, as that somehow breaks something somewhere related to using drag and drop (in skyhook). Instead I switched to using Terser
, which is actually planned to be the default in webpack 5. To achieve this I made a sort of hack for the @angular-devkit/build-angular
package using the patch-package
package.
patch-package
was used to generate a patch for the @angular-devkit/build-angular
package (I used this site as a how-to). I attached the patch file's content at the bottom. Then I set up a prepare
hook in the package.json
like this:
"scripts": {
"prepare": "patch-package",
...
}
And it works! :D
Patch file used:
diff --git a/node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/common.js b/node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/common.js
index 99903a9..717f3bb 100644
--- a/node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/common.js
+++ b/node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/common.js
@@ -22,7 +22,7 @@ const find_up_1 = require("../../utilities/find-up");
const utils_2 = require("./utils");
const ProgressPlugin = require('webpack/lib/ProgressPlugin');
const CircularDependencyPlugin = require('circular-dependency-plugin');
-const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
+const TerserPlugin = require('terser-webpack-plugin');
const StatsPlugin = require('stats-webpack-plugin');
/**
* Enumerate loaders and their dependencies from this file to let the dependency validator
@@ -267,12 +267,7 @@ function getCommonConfig(wco) {
// component styles retain their original file name
test: (file) => /\.(?:css|scss|sass|less|styl)$/.test(file),
}),
- new UglifyJSPlugin({
- sourceMap: buildOptions.sourceMap,
- parallel: true,
- cache: true,
- uglifyOptions,
- }),
+ new TerserPlugin(),
],
},
plugins: extraPlugins,
from angular-skyhook.
You should probably run your (unfixed) code in a debugger with pausing on exceptions enabled (and source maps). Then you’ll know where it actually is.
from angular-skyhook.
Closing because the examples still work with --prod
so it’s not this library’s problem.
from angular-skyhook.
Related Issues (20)
- Skyhook 1.2.1 seems to cause a script error with Angular 8 and Edge browser. HOT 4
- bug: type error in `@angular-skyhook/multi-backend` 1.2.1 HOT 8
- SkyhookPreview out of position
- Simple sortable freeze on drop HOT 4
- Can skyhook support nested sortable lists HOT 7
- backend.backend is not a constructor HOT 6
- wrong offset in preview in chrome with win10 scaling on HOT 4
- Single backends do not work in 1.3.0 HOT 8
- Providing options is not working yet
- ivy runtime error HOT 26
- inject() must be called from an injection context HOT 1
- Multiple Drag and Drop HOT 3
- working with iframe?
- peer dependency for 1.4.0.rc-0 not updated in multi-backend
- Library breaks when enabling optimizations on Production, on v1.3.3
- skyhook-preview: binding style template via async pipe causes unnecessary change detection HOT 1
- "Cannot find namespace 'NodeJS'" and Module '"../../node_modules/react-dnd-html5-backend/lib"' has no exported member 'default'.
- Are you happy to add me as a contributor to fox the library? HOT 3
- ERROR Error: inject() must be called from an injection context
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 angular-skyhook.