Giter VIP home page Giter VIP logo

fwrequirejs's People

Contributors

fwextensions avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

wavef

fwrequirejs's Issues

Triggering error paths in require.js

Hi John, we talked on twitter. I'm creating a github issue since it will be easier to talk about code this way, and we hopefully both will get notifications of updates.

I just looked at the current fwrequire.js and its override of requirejs.load(). It looks fine, the use of requirejs.onError() will end with a throw. The fireworks env looks like it is sync script loading/evaluation, which simplifies some things.

I assume in the context of fireworks JS, you really do want a throw of an error if there was no script at that location. If you wanted to tie into the errbacks use in requirejs 2.0, that would take a bit more work, playing with some of the internals. We can get more into that if you are interested, but what you have now works with the global onError throwing that is used when there are no errbacks on a module.

My first thought though is that you want load errors bubbled pretty quickly via exception vs. allowing for handling the error in the errback of a particular require call. You have probably already seen this, but here are some notes on error handling in requirejs.

You could format the error so that it has an error.requireModules = [moduleName] instead of error.module = moduleName;, and use an error.requireType = 'scripterror', if you want it to look more like an error that is generated from the regular requirejs code.

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.