Skip to content
This repository has been archived by the owner on May 17, 2019. It is now read-only.

Commit

Permalink
Export workerUrl virtual method
Browse files Browse the repository at this point in the history
#360

Co-authored-by: Kevin Grandon <[email protected]>
  • Loading branch information
KevinGrandon authored and fusion-bot[bot] committed Mar 1, 2019
1 parent 2076ee6 commit acd9422
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/__tests__/exports.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import App, {
chunkId,
syncChunkIds,
syncChunkPaths,
workerUrl,
RenderToken,
ElementToken,
SSRDeciderToken,
Expand Down Expand Up @@ -48,6 +49,7 @@ test('fusion-core api', t => {
t.ok(compose, 'exports compose');
t.ok(memoize, 'exports memoize');
t.ok(assetUrl, 'exports assetUrl');
t.ok(workerUrl, 'exports assetUrl');
t.ok(chunkId, 'exports chunkId');
t.ok(syncChunkIds, 'exports syncChunkIds');
t.ok(syncChunkPaths, 'exports syncChunkPaths');
Expand Down
3 changes: 3 additions & 0 deletions src/__tests__/virtual.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,20 @@ import {
chunkId,
syncChunkIds,
syncChunkPaths,
workerUrl,
} from '../virtual/index.js';

tape('virtualModules api', t => {
t.equal(typeof assetUrl, 'function');
t.equal(typeof chunkId, 'function');
t.equal(typeof syncChunkIds, 'function');
t.equal(typeof syncChunkPaths, 'function');
t.equal(typeof workerUrl, 'function');

t.equal(assetUrl('0'), '0');
t.equal(chunkId('0'), '0');
t.equal(syncChunkIds(0), 0);
t.equal(syncChunkPaths(0), 0);
t.equal(workerUrl('0'), '0');
t.end();
});
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export {
chunkId,
syncChunkIds,
syncChunkPaths,
workerUrl,
} from './virtual/index.js';

export {
Expand Down
8 changes: 8 additions & 0 deletions src/virtual/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,11 @@ export function syncChunkPaths(argument: any): any {
*/
return argument;
}

export function workerUrl(url: string): string {
/**
* PLEASE NOTE: a build step transforms
* the arguments provided to this function
*/
return url;
}

0 comments on commit acd9422

Please sign in to comment.