-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(maleo playground): add default server and client (#29)
add defult server, client, and routes for auto import, so user no need to register snippet BREAKING CHANGE: client haven't use the route yet feat(client route): add register route added register route for client to be able to pass it to window and feed to default client docs(readmemd): update docs for default server and client feat(webpack client wrap): add register wrap to window feat(webpack register-loader client): auto register add auto register using register loader for wrap and routes to be used by client feat(webpack app client): add auto register for app refactor(webpack): clean up static entries refactor static entries to be more readable fix(webpack): comment out hardsourcewbp fix(webpack): fix node externals fix(webpack server tsplugin): fix error not bundling on client error caused by webpack getting imported to server.ts not sure what cause the error feat(client): added register entry class docs(readmemd): update register route readme
- Loading branch information
1 parent
159e30a
commit e40897b
Showing
37 changed files
with
572 additions
and
175 deletions.
There are no files selected for viewing
This file contains 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 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 was deleted.
Oops, something went wrong.
This file contains 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 was deleted.
Oops, something went wrong.
This file contains 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 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 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 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 +1 @@ | ||
module.exports = require('./lib/client/Client'); | ||
module.exports = require('./lib/client/client'); |
This file contains 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 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 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 @@ | ||
module.exports = require('./lib/routes/registerRoutes'); |
This file contains 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 +1 @@ | ||
module.exports = require('./lib/server/Server.js'); | ||
module.exports = require('./lib/server/server.js'); |
This file contains 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
23 changes: 23 additions & 0 deletions
23
packages/Maleo.js/src/build/loaders/maleo-register-loader.ts
This file contains 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,23 @@ | ||
import { loader } from 'webpack'; | ||
import loaderUtils from 'loader-utils'; | ||
import { REGISTERS } from '@constants/index'; | ||
|
||
const maleoRegisterLoader: loader.Loader = function() { | ||
const { absolutePagePath, page }: any = loaderUtils.getOptions(this); | ||
const stringifiedAbsolutePagePath = JSON.stringify(absolutePagePath); | ||
const stringifiedPage = JSON.stringify(page); | ||
|
||
return ` | ||
(window.${REGISTERS.WINDOW_VAR_NAME}=window.${ | ||
REGISTERS.WINDOW_VAR_NAME | ||
}||[]).push([${stringifiedPage}, function() { | ||
var page = require(${stringifiedAbsolutePagePath}); | ||
if(module.hot) { | ||
module.hot.accept(${stringifiedAbsolutePagePath}); | ||
} | ||
return page.default || page; | ||
}]); | ||
`; | ||
}; | ||
|
||
export default maleoRegisterLoader; |
This file contains 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.