Coder Social home page Coder Social logo

amber-snapsvg-demo's People

Contributors

hhzl avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

philippeback

amber-snapsvg-demo's Issues

Installation no longer works in Amber v0.14.3

The code in this repo works fine for Amber v0.14.1

However if I do

git clone https://github.com/hhzl/Amber-snapsvg-demo.git
cd Amber-snapsvg-demo
npm install
bower install
grunt devel

no longer works.

Reason

A newer version of Amber is loaded. This probably causes the problem.

Update #doSnapSvg for 0.14.4

Before

| s snapLib bigCircle smallCircle |

snapLib := require value: 'snap.svg'.
s := snapLib value: 300 value: 600.

After

doSnapSvg
"translation to Smalltalk points 1 to 4 of http://snapsvg.io/start/ "

| s bigCircle smallCircle |

s := snapSvg value: 300 value: 600.

Update to 0.14.4

Herby writes on ML:

Update you amber pieces:

Globally:

npm -g install amber-cli

Per project:

bower install
npm update

In 0.14.4, finally import feature works in compiler as well, not just in the core. In Helios, you can see this line in any package template:

  imports: {}

The '{}' is just a plain dynamic array. Here you specify, which external modules your package depends upon. Let's say you need snap.svg and bootstrap and they are known via names 'snag.svg' and 'bootstrap' in *.amd.json files. You put there

  imports: {'snapSvg' -> 'snap.svg'. 'bootstrap'}

You then must commit the package and reload to take effect.

When you put just strings in imports (like 'bootstrap'), the module is just loaded as a package dependency. If you put association there (like 'snapSvg' -> 'snap.svg'), you also define a variable where to import the dependency. In that case, any method within a package can freely use variable 'snapSvg' which will contain anything what 'snap.svg' module exports. If you use that variable outside the package, you get a compile error, of course - the variable is only known within a package.

That said - jQuery was listed among the 'allowed to compile everywhere' exceptions along with window, document, process and global. It is now deprecated (already deleted in master) and will be removed in 0.14.5 or 0.15.0, whichever comes first. Web is the only package that uses jQuery. Try to reuse its #asJQuery to wrap objects and 'PlatformInterface ajax:' to call ajax API. If you absolutely need it, just do what Web package did:

  imports: {'jQuery' -> 'jquery'}

Update README for 0.14.4

Update the README for Amber 0.14.4.

The instructions say that

'snap.svg',

should be added manually to deploy.js. This should not be done for 0.14.4.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.