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

feat: add magicHtml option #3717

Merged
merged 6 commits into from Aug 23, 2021
Merged

feat: add magicHtml option #3717

merged 6 commits into from Aug 23, 2021

Conversation

snitin315
Copy link
Member

  • This is a bugfix
  • This is a feature
  • This is a code refactor
  • This is a test update
  • This is a docs update
  • This is a metadata update

For Bugs and Features; did you add new tests?

Yes

Motivation / Use-Case

add magicHtml option.

Breaking Changes

None

Additional Info

No

@codecov
Copy link

codecov bot commented Aug 22, 2021

Codecov Report

Merging #3717 (b25b515) into master (8a3f0d8) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3717      +/-   ##
==========================================
+ Coverage   93.20%   93.21%   +0.01%     
==========================================
  Files          15       15              
  Lines        1324     1327       +3     
  Branches      458      460       +2     
==========================================
+ Hits         1234     1237       +3     
  Misses         83       83              
  Partials        7        7              
Impacted Files Coverage Δ
bin/cli-flags.js 100.00% <ø> (ø)
lib/Server.js 93.60% <100.00%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8a3f0d8...b25b515. Read the comment docs.

@alexander-akait alexander-akait merged commit 4831f58 into master Aug 23, 2021
@alexander-akait alexander-akait deleted the feat/magic-html branch August 23, 2021 12:51
@0rvar
Copy link

0rvar commented Sep 1, 2021

So, what does this magicHtml option do?

@NicolasBonduel
Copy link

NicolasBonduel commented Sep 1, 2021

@0rvar The doc is not very clear.
I believe it allows you to access some files without using their extension in the browser.

This image is from this stackoverflow from over 5 years ago, but I think it best describes what the magicHtml option does.

Also, it seems to corroborate what I see in the unit tests of this PR.

@snitin315
Copy link
Member Author

@ylemkimon
Copy link
Contributor

ylemkimon commented Sep 1, 2021

@0rvar It automatically generates HTML, which includes the specified JS file, via the path without .js extension. For example

If /foo/app.js is:

console.log("Hello world");

/foo/app will serve:

<!DOCTYPE html>
<html>
<head><meta charset="utf-8"/></head>
<body><script type="text/javascript" charset="utf-8" src="/foo/app.js"></script></body>
</html>

which then Hello world will be logged to the console.

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.

None yet

5 participants