Giter Site home page Giter Site logo

Comments (5)

buschtoens avatar buschtoens commented on July 16, 2024 2

There is also ember-auto-import, which allows you to import any standard JS lib.

from rfcs.

rwjblue avatar rwjblue commented on July 16, 2024

I don’t fully understand. The exact suggestion that you made actually does work (and has for a long time), are you saying that we should do that by default, something else?

from rfcs.

jamesarosen avatar jamesarosen commented on July 16, 2024

The exact suggestion that you made actually does work

Oh! Is it documented somewhere? I read through the extending docs. They discuss using the main property, but not ember-addon.main.

from rfcs.

jamesarosen avatar jamesarosen commented on July 16, 2024

Authoring a pure-JS module and using ember-auto-import is a great start.

One thing that I'd like to be able to do is export a function for pure-JS users and that same function wrapped in a Helper for Ember users:

// addon/my-function.js
export default function() {  }

// addon/helpers/my-function.js
import { helper } from '@ember/component/helper'
import myFunction from '../my-function'

export default helper(myFunction)

// index.js
export default {
  myFunction: require('./addon/my-function')
}

// ember-addon.js
export default {
  name: 'my-package'
}

from rfcs.

rwjblue avatar rwjblue commented on July 16, 2024

We are working on closing the ember-cli/rfcs repo in favor of using a single central RFC's repo for everything. This was laid out in https://emberjs.github.io/rfcs/0300-rfc-process-update.html.

Sorry for the troubles, but would you mind reviewing to see if this is still something we need, and if so migrating this over to emberjs/rfcs?

from rfcs.

Related Issues (20)

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.