Skip to content

idea: replace require() calls with full component name #130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jonathanong opened this issue Oct 29, 2013 · 5 comments
Closed

idea: replace require() calls with full component name #130

jonathanong opened this issue Oct 29, 2013 · 5 comments
Labels

Comments

@jonathanong
Copy link
Contributor

ex:

require('delegate') -> require('component/delegate#0.1.0')
require('component-delegate') -> require('component/delegate#master')

Then don't even bother aliasing at all. All dependency checking will happen at build time. We can resolve the names based on the dependencies.

Only edge case i can think of is when users do * with their dependencies, then we can resolve the dependency at require() time.

Of course, this won't work with any components that do silly stuff with their require calls.

@tj
Copy link
Contributor

tj commented Oct 31, 2013

yeah that's the plan, screws over dynamic requires but I can't see any practical use-cases for that on the client side anyway

@tj
Copy link
Contributor

tj commented Oct 31, 2013

we don't need a require implementation at all if we do that it would just be var delegate = modules['component/delegate@whatever']

@jonathanong
Copy link
Contributor Author

Would still like a require implementation though since I require components outside the build, but I guess it'll be much simpler and could be opt in.

@tj
Copy link
Contributor

tj commented Dec 29, 2013

didn't bother going with building the dep tree first, but that'll be the next optimization for sure

@tj tj closed this as completed Dec 29, 2013
@jonathanong
Copy link
Contributor Author

Yeah I'm working on a "resolver" for both locals and dependencies. Want to wait until the registry is up though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants