Comments (16)
looks like an issue with Cassowary.js...
@bergie, maybe something with the component.io wrapper?
from engine.
Am finding this reoccurring with 1.0.0.rc1
We use requirejs for loading in js dependencies and GSS seems to conflict with the global require
function.
from engine.
On 1.0.4-beta we can actually correctly load both GSS and requirejs as long as we load in GSS first and then let requirejs take over the global require variable. Not the case on 1.0.0.rc1 though.
from engine.
Rc provides require() shim to enable loading file-by-file. Cassowary provides logic to export global variable. I understand, that re-defining require function is a bad idea, and we try not to do it.
What would be the desired change? Avoid playing with require? or leaking cassowary global variable?
from engine.
Hopefully there's a way to avoid playing with require
and not leak a global variable.
Could we use browserify (or their technique) so that require
isn't globally scoped?
from engine.
require() leaking shouldnt be an issue as it seems to me, because everybody who's concerned about it already has it defined. Is it correct?
The idea is to move gss.js out of repo to avoid hundred-ish mb repo as we have now. We'll only have compiled js files separately in the git. We'll have some kind of includes.js which will include each file one by one to use in tests. require() shim will just return globals.
gss.js will be built separately and put on the cdn with a script, it will use browserify thus will not mess with require(), because it'll be predefined there
Current code is set to define a single global variable GSS when you include gss.js. Would you like me to add some sniffing so when you do require('gss') it will not define a global? Both in browserify & node?
from engine.
A nice advantage of browersify is not needing to compile intermediate files: https://github.com/substack/browserify-handbook#transforms
from engine.
Current code is set to define a single global variable GSS when you include gss.js. Would you like me to add some sniffing so when you do require('gss') it will not define a global? Both in browserify & node?
@Inviz - I created this repo to demonstrate how I think this would be taken care of by browserify: https://github.com/paulyoung/browserify-gss-demo
from engine.
Thanks for example. Latests code already doesnt do anything with require() but I still would like to be able to include GSS file by file and not have gss.js in the repo - i'll figure something out
from engine.
You should be able to do that based on my example. Just imagine that my demo project is responsible for only building gss.js
and that GSS.coffee
comes from the engine project.
from engine.
Though I think it plays against that other feature to update only a portion of a file on grunt watch, which would be even more desirable.
from engine.
I put together a very basic pen http://codepen.io/adampilks/pen/vExNZe that show the errors with requirejs. Requirejs introduces a globals of require
and define
which are conflicting with gss.
Is there a way to have these work side by side currently?
from engine.
This was addressed in acfae7d in case that's an option for you until it gets merged to master.
from engine.
Actually, the relevant commits are 8334f86 and 77e1a7e but it's all part of the move to browserify that exists on the queries
branch.
from engine.
Great, we are in early development so will point our bower config to that branch for now.
from engine.
We tagged v2.0.0
which includes those commits.
from engine.
Related Issues (20)
- [Question] GSS and SVG? HOT 1
- GSS does support electron or nwjs(node-webkit)? HOT 8
- Constraint ignored in ruleset, but respected as standalone. HOT 2
- Order of members in constraint declaration matters. Why? HOT 2
- VFL and border - extra 1px in viewport HOT 1
- Inline Styles HOT 4
- CDN-provided gss.js doesn't parse when inlined
- can't build from source HOT 2
- Support for other CSS attribute constraints HOT 6
- Support for ::before and ::after pseudo elements?
- Parent selector not working HOT 3
- Hello World example errors when using Electron HOT 1
- !require has no effect on input width HOT 11
- Is there a way to reference the viewport's position? HOT 3
- Certain conditionals not working properly in gss file
- Is this project still alive? HOT 1
- get properties without tag
- Is this project dead? HOT 2
- your website seems to be hacked HOT 2
- [spam]
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 engine.