asyncliz / parse-literals Goto Github PK
View Code? Open in Web Editor NEWParse template literals from code
License: MIT License
Parse template literals from code
License: MIT License
uses tags from comments:
innerHTML = /*html*/`Hello world!`
having result:
{ tag: 'html', parts: ... },
maybe:
{ tag: '/*html*/', parts: ... },
In Chrome DevTools, we tend to use beta/release candidates of TypeScript to catch errors early. Currently, we are depending on 4.3.1-rc
. However, if we install rollup-plugin-minify-html-template-literals
(which has a transitive dependency on this package), we now get a duplicate installation of TypeScript.
This behavior is sadly intentional by npm
, as semver
doesn't think that 4.3.1-rc
matches ^4.0.0
. Based on https://survivejs.com/maintenance/packaging/managing-dependencies/#understanding-version-ranges I think it should be possible to update the ^4.0.0
range to ^4.0.0-0
to also include beta releases of any TypeScript 4.x version.
Could we update the dependency version of typescript
in this package to include pre-releases of TypeScript 4.x?
Hi,
it would be nice if the library will also return the locations of scripts.
this way you could modify them as well, for example, add escaping.
10x!
We can update typescript to ^3.0.0 so that there aren't multiple copies of TS downloaded when using this library.
Minifier fails to parse if comment is found next to expression inside template literal:
Parse Error: <div .icon=@TEMPLATE_EXPRESSION();* Some comment */}></div>
Code example that causes the problem:
html`<div .icon=${0/* Some comment */}></div>
Reproduction
https://repl.it/repls/ImmaterialPointedInternet
This makes using Typescript const enums and minification impossible.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.