-
-
Notifications
You must be signed in to change notification settings - Fork 143
feat(build): Add UMD support #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 |
|---|---|---|
| @@ -1,7 +1,9 @@ | ||
| *.suo | ||
| *.user | ||
| .DS_Store | ||
| dist | ||
| lib | ||
| types | ||
| node_modules | ||
| build | ||
| review/api/temp | ||
|
|
||
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
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,19 @@ | ||
| # example-dockpanel-amd | ||
| _AMD_ version of [example-dockpanel](../example-dockpanel) | ||
|
|
||
| ## Prerequisites | ||
| From the root lumino folder run: | ||
| ``` | ||
| yarn install | ||
| yarn run build | ||
| yarn run minimize | ||
| ``` | ||
|
|
||
| You should now be able to open [index.html](./index.html) directly into your web browser. | ||
|
|
||
| ## Notable differences | ||
|
|
||
| * All dependencies loaded via AMD + RequireJS, see `head` section of [index.html](./index.html) | ||
| * TypeScript converted to IE compatible JavaScript | ||
| * CSS files manually imported as needed via [style/index.css](style/index.css) | ||
|
|
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,48 @@ | ||
| <!DOCTYPE html> | ||
| <html> | ||
|
|
||
| <head> | ||
| <title>example-dockpanel-iife</title> | ||
|
|
||
| <link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> | ||
|
|
||
| <script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.auto.js"></script> | ||
| <script src="https://cdn.jsdelivr.net/npm/[email protected]/require.js"></script> | ||
|
|
||
| <script> | ||
| require.config({ | ||
| baseUrl: ".", | ||
| paths: { | ||
| // CDN testing --- | ||
| // "@lumino": "https://cdn.jsdelivr.net/npm/@lumino", | ||
|
|
||
| // Local testing --- | ||
| "@lumino/algorithm": "../../packages/algorithm/dist/index.min", | ||
| "@lumino/collections": "../../packages/collections/dist/index.min", | ||
| "@lumino/properties": "../../packages/properties/dist/index.min", | ||
| "@lumino/messaging": "../../packages/messaging/dist/index.min", | ||
| "@lumino/signaling": "../../packages/signaling/dist/index.min", | ||
| "@lumino/disposable": "../../packages/disposable/dist/index.min", | ||
| "@lumino/domutils": "../../packages/domutils/dist/index.min", | ||
| "@lumino/coreutils": "../../packages/coreutils/dist/index.min", | ||
| "@lumino/keyboard": "../../packages/keyboard/dist/index.min", | ||
| "@lumino/commands": "../../packages/commands/dist/index.min", | ||
| "@lumino/dragdrop": "../../packages/dragdrop/dist/index.min", | ||
| "@lumino/virtualdom": "../../packages/virtualdom/dist/index.min", | ||
| "@lumino/widgets": "../../packages/widgets/dist/index.min" | ||
| } | ||
| }); | ||
| </script> | ||
|
|
||
| <link href="./style/index.css" rel="stylesheet"> | ||
| </head> | ||
|
|
||
| <body> | ||
| <script> | ||
| requirejs(['./src/index'], function (main) { | ||
| main(); | ||
| }); | ||
| </script> | ||
| </body> | ||
|
|
||
| </html> | ||
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,11 @@ | ||
| { | ||
| "name": "@lumino/example-dockpanel-amd", | ||
| "version": "0.0.0", | ||
| "private": true, | ||
| "scripts": { | ||
| "test": "node ./test/runner.js" | ||
| }, | ||
| "devDependencies": { | ||
| "puppeteer": "^2.1.1" | ||
| } | ||
| } |
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.
I'm wary of adding the other examples since they aren't TS and they can easily get out of date.
Uh oh!
There was an error while loading. Please reload this page.
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.
Having them non TS is actually a good thing IMO (and why I went out of the way to convert them - including IE support).
While they shouldn't break for any minor/point releases they can certainly be added to the suite of tests (to check they load without warning) - I will look into this today?
Uh oh!
There was an error while loading. Please reload this page.
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.
Further Note: Once lumino has UMD support, then these types of examples work well in things like Gist, ObservableHQ and any online JS editor (the include paths will need to point to jasdelivr or unpkg or some other CDN server).
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.
👍 to including these with tests.
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.
@blink1073 you would think that would have been easy - ended up rolling my own with puppeteer