Giter VIP home page Giter VIP logo

Comments (6)

ef4 avatar ef4 commented on July 23, 2024 2

This is the same thing we already discussed. Rollup and webpack can both do this.

I think we should write into the v2 addon spec that all ember addons are required to be "side effect free" in the sense that this kind of transformation is safe. Then we can trust this pattern.

So ok, yes, let's design better imports. My remaining design concern is logical groupings. If we collapse things down too far people can't see what is a transition vs motion vs easing vs some other helper function provided by the library. One idea is to group into:

  • ember-animated for the things that are already on the top-level
  • ember-animated/motions to reexport all the motions
  • ember-animated/transitions to reexport all the transitions
  • ember-animated/easings to reexport all the easings

from ember-animated.

samselikoff avatar samselikoff commented on July 23, 2024

Super excited to think about standardizing around this in the wider community πŸŽ‰

I had the same thought, that

import { fade, fadeIn } from 'ember-animated';

would be confusing, since one is a motion and another is a transition.

I think your grouping idea makes perfect sense! πŸ‘

from ember-animated.

cibernox avatar cibernox commented on July 23, 2024

I just learned about that spec and I think it's great.

Do you think it would be possible to craft an ESLint rule that detects exported functions with side-effects, at least some of them?

from ember-animated.

ef4 avatar ef4 commented on July 23, 2024

We can lint for some potentially tempting Ember-specific things, like reopening a framework-provided class. But we definitely can't catch it all.

If these things were statically detectable, the whole problem would be a non-problem because instead of linting you could do the analysis in the module bundlers and they could automatically know which code is safe to strip.

from ember-animated.

samselikoff avatar samselikoff commented on July 23, 2024

I understand why they are not statically detectable (otherwise it'd be part of the language spec), but in that case how do the Webpack/Rollup features work?

from ember-animated.

ef4 avatar ef4 commented on July 23, 2024

Webpack makes npm package authors certify that they’re safe by setting a value in package.json.

from ember-animated.

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.