Skip to content
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

🏗️build (browser): rewrite build with a browser build #232

Closed
wants to merge 16 commits into from
Closed

🏗️build (browser): rewrite build with a browser build #232

wants to merge 16 commits into from

Conversation

mathe42
Copy link
Contributor

@mathe42 mathe42 commented Aug 4, 2021

PR for #231.

Works in Browser!

ToDo:

  • Rewrite build tools (use rollup and esbuild for js and tsc for d.ts files)
  • Add Browser Build file
  • Add Polyfills for Browser build
  • Add Module file for Node (this works better if you use a bundler in your build chain)
  • Add source map for better debugging (with just a tsc build this was not important but now with minified code this is a big benefit)
  • change readme
  • Remove Demo document and demo.html

package.json Show resolved Hide resolved
src/__tests__/error_handling.test.ts Outdated Show resolved Hide resolved
src/jsSandbox.ts Outdated Show resolved Hide resolved
tsconfig.json Outdated Show resolved Hide resolved
src/browser.ts Show resolved Hide resolved
@mathe42
Copy link
Contributor Author

mathe42 commented Aug 4, 2021

Ok it is not working I have to "polyfill" the following internal node modules. Good for us browserify maintain some modules for this...

events -> events
stream -> stream-browserify
util -> util
vm -> vm-browserify
Buffer global -> buffer but has to get attacht to global

Build is now at 300K minified js code and 70K with brotli kompression and 85K gzip that is quite good.

Only thing missing is a readme update.

@jjhbw can you have a look? I added a demo.html and a demo docx file to test it out - should be removed before merge.

@mathe42 mathe42 changed the title WIP: 🏗️build (browser): rewrite build with a browser build 🏗️build (browser): rewrite build with a browser build Aug 4, 2021
package.json Show resolved Hide resolved
package.json Show resolved Hide resolved
@mathe42
Copy link
Contributor Author

mathe42 commented Aug 5, 2021

@jjhbw ready for review!

rollup.config.js Outdated Show resolved Hide resolved
@mathe42
Copy link
Contributor Author

mathe42 commented Aug 5, 2021

@jjhbw Done changed it back to tsc build. And I changed the rollup config.

@mathe42
Copy link
Contributor Author

mathe42 commented Aug 6, 2021

Just as a information: I use this now in production and it is running good! It is not a big template but it uses nested if, for, etc. so if this runs all should be fine 👍

@jjhbw
Copy link
Collaborator

jjhbw commented Aug 6, 2021

Looks great, thanks! I changed some minor things and merged it offline, see 3d6c1a8 for the end result.

@mathe42
Copy link
Contributor Author

mathe42 commented Aug 6, 2021

LGTM 👍 Thanks!

@mathe42 mathe42 closed this Aug 6, 2021
@jjhbw
Copy link
Collaborator

jjhbw commented Aug 6, 2021

@mathe42 small extra change: 527259e
LMK if I misunderstood.

@mathe42
Copy link
Contributor Author

mathe42 commented Aug 6, 2021

Yes is correct missed that 👍

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.

2 participants