-
Notifications
You must be signed in to change notification settings - Fork 334
Bundler: New tool to bundle Cadl libraries for browser usage #510
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
Bundler: New tool to bundle Cadl libraries for browser usage #510
Conversation
d16e6a8 to
765a98b
Compare
|
Is it possible to make this work with Vite since it uses rollup behind the covers and can take rollup config? I really appreciate Vite's speed and live reload functionality and it would be sad to leave that behind. |
|
@bterlson would you mean as you do some change in the compiler or one of the libraries and vite auto compile+reload? I guess could maybe make that work with using some watch functionality which then gets picked up by vite. Are you using the playground as a way to quickly develop the compiler or libraries? Never thought about using it that way. |
|
Right now you can run |
|
I agree with the playground dev experience and if you are just adding/working on the playground this shouldn't change. The problem is indeed if you need to touch up compiler and other libraries, in that case right now it wouldn't get picked up. I think that could then depend on |
I'm not sure what this means. Can't you do this today? |
|
@nguerrera no if you run The main use case for that originally was the library linter but that can also be used in this case and just to do a build/validation of your own library to make sure it is valid. |
|
@bterlson Also looking at vite plugins seems like it does look like I might be able to tweak how rollup is run to make this a rollup plugin which is then usable in vite. |
|
@timotheeguerin I see, that seems worth fixing for sure! |
69b2d4f to
719bbd3
Compare
|
You can try these changes at https://cadlplayground.z22.web.core.windows.net/prs/510/ |
|
@bterlson @nguerrera, ok so in its current state if you make changes in the other packages then it will automatically reload the playground in watch mode. Updated:
|
bterlson
left a comment
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.
Looks good to me. Just to confirm, with the latest changes there shouldn't be any changes to workflow?
|
@bterlson nope, just |

Been playing a while back with making a bundler so we can bundle our libraries and use them in the browser instead of the hard coded loading we currently have in the playground.
This simplify:
This would unlock a few possibilities:
How this work:
_CadlLibrary_object that contains all the info to load the library._CadlLibrary_to add all the cadl files and js files to the brwoser host.Todo: