Git Product home page Git Product logo

Comments (6)

gmencz avatar gmencz commented on May 4, 2024 4

I personally prefer~/* aswell. I don't really like using @ for aliasing because it collides with npm scopes

from remix.

ryanflorence avatar ryanflorence commented on May 4, 2024 3

Related #146

I see three choices to bikeshed:

import * from "@app/something"
import * from "@/something"
import * from "~/something"

I think I like ~/* personally. It's pretty much the same thing as your home directory on a file system.

If we want to make it easier to migrate from next we'd support a list of aliases in remix.config like:

{
  compiler: {
    "base": "app",
    "paths": {
      "@/components/*": [ "components/*" ]
  }
}

I don't like that much control personally, just make up your mind and do a relative import or a root import. Codebases with a bunch of configurable import aliases get confusing (I worked in a huge one), you look at an import statement and don't know where the heck anything is really coming from.

from remix.

mjackson avatar mjackson commented on May 4, 2024

I really like this idea, and I think I know exactly how we could implement it. So ~ in this case would just mean "the app directory", right? Would it ever be useful to be able to refer to the project root directory?

from remix.

sergiodxa avatar sergiodxa commented on May 4, 2024

If you want for some reason to refer to the project root directory I think ~/../server should work? Like in a CLI

from remix.

kentcdodds avatar kentcdodds commented on May 4, 2024

I'm good with it 👍 would make things much nicer since I can't colocate my files

from remix.

mjackson avatar mjackson commented on May 4, 2024

This was added in #253 and will be released in 0.18

from remix.

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.