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 script: fix CSS extract with options.compress #4833

Merged
merged 2 commits into from
Jul 4, 2022
Merged

Build script: fix CSS extract with options.compress #4833

merged 2 commits into from
Jul 4, 2022

Conversation

arcanistzed
Copy link
Contributor

Description of changes:

During the build script, extract the CSS to the correct directory when options.compress is set to true. Otherwise, readdirSync on the next line will throw an error because the directory doesn't exist.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Signed-off-by: arcanist <arcanistzed@gmail.com>
arcanistzed added a commit to arcanistzed/acelib that referenced this pull request Jul 3, 2022
Makefile.dryice.js Outdated Show resolved Hide resolved
Signed-off-by: arcanist <arcanistzed@gmail.com>
@codecov
Copy link

codecov bot commented Jul 4, 2022

Codecov Report

Merging #4833 (b89c4db) into master (75984b7) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #4833   +/-   ##
=======================================
  Coverage   69.94%   69.94%           
=======================================
  Files         559      559           
  Lines       58338    58338           
  Branches    11235    11235           
=======================================
  Hits        40803    40803           
  Misses      17535    17535           
Flag Coverage Δ
unittests 69.94% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


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 75984b7...b89c4db. Read the comment docs.

@andrewnester andrewnester merged commit e9331bf into ajaxorg:master Jul 4, 2022
@anthonyryan1
Copy link

This change has broken the generation of css/ace.css

This particularly affects deployments with ace.config.set('useStrictCSP', true); because they require all styles be specified in ace.css since they can't use any inline style attribute.

Here's a diff of the css file after this change: https://gist.github.com/anthonyryan1/11620290f2d82d4ff2b91948bebfb4d6

I don't think it was the intention to delete all the CSS from all the builds. This has caused display bugs in every release since 1.8.0.

@anthonyryan1
Copy link

The problem seems to stem from the fact that extractCSS uses a pretty simple set of regexes to find the CSS hiding in the JavaScript files.

These worked perfectly on the raw source code, but once we minify it, the regexes no longer work and fail to extract the CSS properly.

We either need to continue running extractCSS on non-minified javascript, or we need a better regex that can identify CSS in the already minified javascript.

@andrewnester
Copy link
Contributor

Reverted the change and released new fixed 1.9.5 version

@arcanistzed
Copy link
Contributor Author

That's unfortunate because now options.compress is broken again. Is the only solution to ship non-minified scripts?

@nightwing
Copy link
Member

@arcanistzed are you using ace-builds or building from ace repo?

@arcanistzed
Copy link
Contributor Author

I was building directly from the ace repo before https://github.com/arcanistzed/acelib/blob/330c8e01b797aaa55cfc1c213351a89e3c8b273c/.github/workflows/ace.yml
I'm going to try switching to ace-builds.

@andrewnester
Copy link
Contributor

if you need to unminified code you can install new ace-code npm package which contains Ace code

@nightwing
Copy link
Member

#4899 fixes the issue with compressed mode

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.

4 participants