Skip to content

Detect strong-globalize in a shared module#92

Merged
bajtos merged 1 commit intomasterfrom
feature/detect-exports
Sep 15, 2016
Merged

Detect strong-globalize in a shared module#92
bajtos merged 1 commit intomasterfrom
feature/detect-exports

Conversation

@bajtos
Copy link
Copy Markdown
Member

@bajtos bajtos commented Sep 7, 2016

In this pull request, I am extending the code detecting strong-globalize instances in the application code to support the use-case described in #87, which is

// lib/globalize.js
var SG = require('strong-globalize');
SG.SetRootDir(path.join(__dirname, '..'), { autonomousMsgLoading: 'all' });
module.exports = SG();

// lib/loopback.js
var g = require('./globalize');

// lib/registry.js
var g = require('./globalize');

// etc.

Connect to strongloop-internal/scrum-loopback#1044
See also #87

@Setogit please take a look

cc @0candy

@bajtos bajtos force-pushed the feature/detect-exports branch from ed25310 to 06a0fb3 Compare September 8, 2016 13:17
@bajtos bajtos changed the title [PoC] Detect strong-globalize in a shared module Detect strong-globalize in a shared module Sep 8, 2016
@bajtos
Copy link
Copy Markdown
Member Author

bajtos commented Sep 8, 2016

@Setogit I have cleaned up my patch. slt-globalize -e works well in test/fixtures/extract-shared-globalize. The test is not passing yet, I'll investigate.

Could you please review?

@bajtos bajtos force-pushed the feature/detect-exports branch 3 times, most recently from 85592ce to 16cf5f9 Compare September 8, 2016 14:01
Improve lib/extract to support the following use case:

```js
// lib/globalize.js
var SG = require('strong-globalize');
SG.SetRootDir(path.join(__dirname, '..'), { autonomousMsgLoading: 'all'
});
module.exports = SG();

// lib/loopback.js
var g = require('./globalize');

// lib/registry.js
var g = require('./globalize');

// etc.
```
@bajtos bajtos force-pushed the feature/detect-exports branch from 16cf5f9 to d5e9e03 Compare September 8, 2016 14:10
@bajtos
Copy link
Copy Markdown
Member Author

bajtos commented Sep 8, 2016

Done, npm test is passing on my machine now. @Setogit the patch is ready for your review.

@bajtos
Copy link
Copy Markdown
Member Author

bajtos commented Sep 14, 2016

Considering that @Setogit is busy working on other priories, can perhaps one of you, @0candy @pthieu @kraman or @sam-github review this patch please?

@sam-github
Copy link
Copy Markdown
Contributor

@bajtos your use-case is compelling, I don't know the s-g code very well, I'll find time today to read through more closely.

@0candy
Copy link
Copy Markdown
Contributor

0candy commented Sep 14, 2016

LGTM

@bajtos bajtos merged commit ba78f9a into master Sep 15, 2016
@bajtos bajtos deleted the feature/detect-exports branch September 15, 2016 14:05
@sam-github
Copy link
Copy Markdown
Contributor

If it doesn't break anything, and makes things better for you, LGTM

@bajtos
Copy link
Copy Markdown
Member Author

bajtos commented Sep 15, 2016

Released as strong-globalize@2.7.0

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants