This repository was archived by the owner on Dec 21, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
CORE-1242, CORE-1243, CORE-1244 Webpack and Stream API #13
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
f53eba7
installed webpack and es6-ified everything
hpihkala eab9168
to make websockets work, use separate builds for node and web
hpihkala aeb30a5
tweaks for running tests
hpihkala b65046b
delete unused dist files
hpihkala 313a090
add rest endpoint files
hpihkala dc9aef6
add restUrl option
hpihkala 41ba177
works otherwise but fetch is missing from node
hpihkala 1836072
added node-fetch + its shim for browser
hpihkala a8dbc2b
add integration tests, fix bugs
hpihkala 0b375f8
build
hpihkala 35e4a96
change author to 'Streamr'
hpihkala 00e5c2c
rename authKey to apiKey in README
hpihkala ba09fe3
refactor Subscription state, update eslint rules
hpihkala 1045d3f
Update readme, remove public read permission manipulation as that wil…
hpihkala bd7a452
delete files in dist
hpihkala 8cd5c3c
dist added to .gitignore
hpihkala 4aba673
fix webpack use of this module by adding 'module' field to package.json
hpihkala 61e9888
fall back to commonjs modules and drop node build
hpihkala File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "presets": ["env"], | ||
| "plugins": ["babel-plugin-add-module-exports", | ||
| ["transform-runtime", { | ||
| "polyfill": false, | ||
| "regenerator": true | ||
| }]] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,2 @@ | ||
| # Top-most EditorConfig file | ||
| root = true | ||
|
|
||
| [*.{js,html}] | ||
| indent_style = tab |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| module.exports = exports = { | ||
| extends: 'streamr', | ||
| rules: { | ||
| // Transpiling for node would add a lot of complexity, se let's accept having to write CommonJS modules | ||
|
|
||
| 'no-plusplus': ["error", { "allowForLoopAfterthoughts": true }], | ||
| 'no-underscore-dangle': ["error", { "allowAfterThis": true }] | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,3 +28,5 @@ node_modules | |
| .lock-wscript | ||
| .idea | ||
| *.iml | ||
| .DS_Store | ||
| dist/* | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| // To enable debug logging: | ||
| // DEBUG=StreamrClient node examples/node.js | ||
|
|
||
| const StreamrClient = require('streamr-client') | ||
|
|
||
| // Create the client with default options | ||
| const client = new StreamrClient() | ||
|
|
||
| // Subscribe to a stream | ||
| const subscription = client.subscribe( | ||
| { | ||
| stream: '7wa7APtlTq6EC5iTCBy6dw', | ||
| // Resend the last 10 messages on connect | ||
| resend_last: 10 | ||
| }, | ||
| function(message) { | ||
| // Handle the messages in this stream | ||
| console.log(JSON.stringify(message)) | ||
| } | ||
| ) | ||
|
|
||
| // Event binding examples | ||
| client.on('connected', function() { | ||
| console.log('A connection has been established!') | ||
| }) | ||
|
|
||
| subscription.on('subscribed', function() { | ||
| console.log('Subscribed to '+subscription.streamId) | ||
| }) | ||
|
|
||
| subscription.on('resending', function() { | ||
| console.log('Resending from '+subscription.streamId) | ||
| }) | ||
|
|
||
| subscription.on('resent', function() { | ||
| console.log('Resend complete for '+subscription.streamId) | ||
| }) | ||
|
|
||
| subscription.on('no_resend', function() { | ||
| console.log('Nothing to resend for '+subscription.streamId) | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "name": "streamr-client-node-example", | ||
| "version": "0.0.1", | ||
| "description": "Using streamr-client in node", | ||
| "main": "node.js", | ||
| "dependencies": { | ||
| "streamr-client": "0.10.0" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is breaking change a good idea? At least it would deserve a major version update in npm (
npm version major)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My reasoning was this: The name
authKeywas deprecated, but it is still supported at least until the next major version.