[Feedhenry-raincatcher] TypeScript version of raincatcher-mediator ready

Summers Pittman supittma at redhat.com
Wed Mar 15 14:22:15 UTC 2017


On Wed, Mar 15, 2017 at 9:43 AM, Paolo Haji <phaji at redhat.com> wrote:

> Hello everyone,
>
> So I was talking with Wojtek and since he's going to do some changes to
> the mediator, and master is up to par with the feature-set on which the
> typescript branch was started from, we want to go ahead and merge the PR
> <https://github.com/feedhenry-raincatcher/raincatcher-mediator/pull/16>.
> I've cherry-picked/ported all the relevant PRs to master done recently,
> and after merging we should probably go for a minor or even major version
> bump (current fh-wfm-mediator at latest is 0.3.1, so either 0.4.0 or 1.0.0)
>
> The typescript version, once compiled and published, is practically a
> drop-in replacement except for a small API change in the topics utility:
>

How hard will it be to make this change across all of the projects in
dependent code?


>
> - topics.prefix('foo') becomes topics.withPrefix('foo')
> - topics.entity('foo') becomes topics.withEntity('foo')
>
> Also, some of the dev modules required for building won't run on node 0.10
> (they use Set
> <https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Set>),
> so we can't keep it on the Travis matrix on this module, but others that
> will depend on the built version of it will still run on 0.10 AFAIK
>
> On Mon, Feb 13, 2017 at 2:39 PM, Paolo Haji <phaji at redhat.com> wrote:
>
>> Following up on the previous thread on this subject.
>>
>> So the final steps of the conversion of the module to typescript weren't
>> as straightforward, the biggest gotcha was that apparently the es6 module
>> spec makes it so you can't do `module.exports = X`. and `export default X`
>> actually becomes `exports.default = X` (more on this on a upcoming blog
>> post).
>>
>> But currently the high-level worries when moving to TS are:
>>
>>
>>    1. Since we use the lib/ directory to contain our js files, put TS
>>    code in a src/ directory and configure the compiler to output to the lib/
>>    directory (js + d.ts typing files + js.map source maps)
>>    2. Delete the original lib/ tree from source control and .gitignore
>>    it since it'll be generated by the TS compiler
>>    3. Configure npm to include only the needed files via .npmignore or
>>    package.json.files <https://docs.npmjs.com/files/package.json#files>.
>>    You can check out what would be published to npm via npm pack
>>    <https://docs.npmjs.com/cli/pack>
>>    4. Tests in TS can be run with ts-node
>>    <https://github.com/TypeStrong/ts-node> on top of grunt-mocha-test
>>    5. Make it so the public exports of your module use the special
>>    `export = X` TS syntax (if you need module.exports = X)
>>    6. You can still use `export default` for internals, but non-es6
>>    consumers will have to use it through `require('my-module').default`
>>
>> PR for this is up at https://github.com/feedhenr
>> y-raincatcher/raincatcher-mediator/pull/16
>>
>
>
> _______________________________________________
> Feedhenry-raincatcher mailing list
> Feedhenry-raincatcher at redhat.com
> https://www.redhat.com/mailman/listinfo/feedhenry-raincatcher
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/feedhenry-raincatcher/attachments/20170315/df856e64/attachment.htm>


More information about the Feedhenry-raincatcher mailing list