template files relative to requirejs baseUrl #647

Merged
merged 1 commit into from Jan 13, 2014

Conversation

Projects
None yet
3 participants
@stevenvachon
Contributor

stevenvachon commented Jan 7, 2014

Adds support for relative URLs in templates loaded with RequireJS. Allows us to work with custom baseUrls in require.config(). For development environments only, but it's not necessary for production if using can-compile.

@justinbmeyer

This comment has been minimized.

Show comment
Hide comment
@justinbmeyer

justinbmeyer Jan 7, 2014

Contributor

This breaks the tests. Please fix and re-submit.

Contributor

justinbmeyer commented Jan 7, 2014

This breaks the tests. Please fix and re-submit.

@stevenvachon

This comment has been minimized.

Show comment
Hide comment
@stevenvachon

stevenvachon Jan 7, 2014

Contributor

Yep, trying. I think I'm finding that RequireJS' almond does not support dynamic loading, so it does not have require.toUrl().

Contributor

stevenvachon commented Jan 7, 2014

Yep, trying. I think I'm finding that RequireJS' almond does not support dynamic loading, so it does not have require.toUrl().

@stevenvachon

This comment has been minimized.

Show comment
Hide comment
@stevenvachon

stevenvachon Jan 11, 2014

Contributor

I'm not sure how to write a QUnit test for this because it needs to run in a dev environment with the full version of RequireJS (not almond). Is this currently possible?

Contributor

stevenvachon commented Jan 11, 2014

I'm not sure how to write a QUnit test for this because it needs to run in a dev environment with the full version of RequireJS (not almond). Is this currently possible?

@daffl

This comment has been minimized.

Show comment
Hide comment
@daffl

daffl Jan 11, 2014

Contributor

Yes Travis and therefore grunt test are running tests on the standalone and AMD builds. You can run them in the browser by going to test/amd/index.html (which only works after running grunt build).

Your test just needs to be conditional:

if(window.require) {
  test('test baseUrl', function() {
    require.config({ baseUrl: 'bla/ });
    // Do tests here
  });
}
Contributor

daffl commented Jan 11, 2014

Yes Travis and therefore grunt test are running tests on the standalone and AMD builds. You can run them in the browser by going to test/amd/index.html (which only works after running grunt build).

Your test just needs to be conditional:

if(window.require) {
  test('test baseUrl', function() {
    require.config({ baseUrl: 'bla/ });
    // Do tests here
  });
}
@stevenvachon

This comment has been minimized.

Show comment
Hide comment
@stevenvachon

stevenvachon Jan 12, 2014

Contributor

I am never using issue/PR numbers in a commit message ever again.

Contributor

stevenvachon commented Jan 12, 2014

I am never using issue/PR numbers in a commit message ever again.

daffl added a commit that referenced this pull request Jan 13, 2014

Merge pull request #647 from stevenvachon/patch-2
template files relative to requirejs baseUrl

@daffl daffl merged commit e1a8d72 into canjs:master Jan 13, 2014

1 check passed

default The Travis CI build passed
Details

@stevenvachon stevenvachon deleted the stevenvachon:patch-2 branch Jan 23, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment