-
Notifications
You must be signed in to change notification settings - Fork 5
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
fix: marko/compiler deprecation warning #21
Conversation
|
const result = compiler[ | ||
(browser || (config as any).browser) && | ||
compiler.compileForBrowser /** Only Marko 4 supports compileForBrowser, otherwise use compile */ | ||
? "compileForBrowser" | ||
: "compile" | ||
](src, filename, MARKO_OPTIONS); | ||
|
||
const result = compiler.compileSync(src, filename, MARKO_OPTIONS); |
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.
This is definitely the biggest unknown; there is no compileForBrowser
in Marko 5
let code = typeof result === "string" ? result : result.code; // Marko 3 does not support sourceOnly: false | ||
let map = result.map; | ||
let map: any = result.map; |
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.
concatMap.add(filename, code, map);
yields
Argument of type 'SourceMap' is not assignable to parameter of type 'string | RawSourceMap | undefined'.
Type 'SourceMap' is not assignable to type 'RawSourceMap'.
Types of property 'version' are incompatible.
Type 'number' is not assignable to type 'string'.ts(2345)
@snyamathi thanks for creating the PR! I'd rather keep it so that this module can support both Marko 4 and 5. |
Absolutely - I was going to just raise an issue, but felt bad at least not attempting to see if I could do it myself. Per tradition, I'll continue to ignore the warning for the time being 😆 Thanks for all the work you (all) do with Marko, much appreciated. Feel free to close this if you don't need it open for tracking. |
@snyamathi I just did some project cleanup and improvements including this change over in #22. |
Description
This PR switches from using
marko/compiler
to@marko/compiler
, resolving the deprecation warning (below). There's a few things that I don't like about this PR, but lack the context to resolve quickly. I might need some help getting this over the finish line (cc @DylanPiercey).However, the changes do work for me locally 🎉
Motivation and Context
Screenshots (if appropriate):
Checklist: